An "ancestor seed" issue

Users who are viewing this thread

Alexandru_cel_Mare

Sergeant at Arms
To have normal relationships between lords and ladies in a certain faction and avoid messed up stuff, there is the "ancestor seed" that needs to be edited. It is found in module_scripts, for each faction, like this:

        (is_between, ":cur_troop", "trp_knight_6_1", "trp_knight_7_1"),
        (store_sub, ":npc_seed", ":cur_troop", "trp_knight_6_1"),
        (assign, ":ancestor_seed", 31),
      (else_try),
        (is_between, ":cur_troop", "trp_knight_7_1", "trp_kingdom_1_pretender"),
        (store_sub, ":npc_seed", ":cur_troop", "trp_knight_7_1"),
        (assign, ":ancestor_seed", 37)

The difference between "ancester seed" numbers 31 and 37 is 6, and if you create as many extra factions as you want you need to add 6 to any number (for example, after 37 would come 43, than 49, etc). That goes very well with factions having 20 lords.

But the question is what should i do with factions having less than 20 lords, whith minifactions of maybe 8 lord and 6 ladies ? I lowered the difference from 6 to 3, or even 2, and i ended up with messed up family relationships...  :sad:

Any help and suggestion would be more than welcome,
respectfully,
Alexandru
 
I'm only a novice myself but I believe your problem lies here:

(store_random_in_range, ":father", 0, 6), #six possible fathers
(val_add, ":father", ":ancestor_seed"),
(troop_set_slot, ":cur_troop", slot_troop_father, ":father"),

From what I can tell the script is adding a random value to the ancestor_seed when it determines paternity. You'll need to create a logic gate that checks whether or not the troop in question belongs to a smaller faction and change how ancestry is assigned.

For example:
(lt, ":npc_seed", 8), #NPC seed is the order in the faction
applies to the first 8 lords in a faction as determined by the troop list, so for a smaller faction you'll probably want to change that to the number of patriarchs you're going for. I'm not sure on the syntax but check whether the current troop's faction is one of the smaller ones you've created and then make a default (else) for the standard 20 lord factions.

Likewise you'll need to modify
(is_between, ":npc_seed", 8, 12),
for the Older nobles who have a sister but aren't a part of the families.

Finally you'll need to take care of the sons of your patriarchs:

(store_sub, ":father", ":cur_troop", 12),
(troop_set_slot, ":cur_troop", slot_troop_father, ":father"),
(troop_get_slot, ":mother", ":father", slot_troop_spouse),
(troop_set_slot, ":cur_troop", slot_troop_mother, ":mother"),

Where 12 is the number of lords between the first Patriarch and the corresponding Son. So for every Patriarch and Older lord you remove from the faction, reduce that highlighted number by an equal amount. That should store the Father's ID properly, which then is assigned to the current troop's father slot.

Ladies seem to be automatically generated alongside the Patriarch (Wife + Daughter) and the Older non-family lords (Sister).
 
Back
Top Bottom