AI lords not reinforcing properly

Users who are viewing this thread

In all of my games after around 200 days, several lords and every faction leader stop properly reinforcing their party. For example the Khan will stop recruiting with no more than 70 men, and the Tzar will stop at just 7. I've also had a long look through module system.

 
NPC99 said:
bob123 said:
...... the faction leaders became trapped in small parties. The problem affects every faction leader (and many lords), i used the Tzar's 7 as the lowest example. I don't think it's attrition since even if they stay at a fortress or town for a long time it doesn't increase. All 3 of my different characters over 200 days have the reinforce problem, so it's probably not corruption. I'll see how editing the save file goes, but i'm really hoping for a permanent fix. 

Permanent fix.

add to the bottom of module_scripts.py:

("reset_kings_type",#unbugs kingdom_lord's slot_party_type
[
  (try_for_parties, ":cur_party"),
      (party_is_active, ":cur_party"),
      (party_stack_get_troop_id, ":leader_troop", ":cur_party",0),
      (this_or_next|eq,":leader_troop","trp_kingdom_1_lord"),
      (this_or_next|eq,":leader_troop","trp_kingdom_2_lord"),
      (this_or_next|eq,":leader_troop","trp_kingdom_3_lord"),
      (this_or_next|eq,":leader_troop","trp_kingdom_4_lord"),
      (eq,":leader_troop","trp_kingdom_5_lord"),
      (party_set_slot, ":cur_party", slot_party_type, spt_kingdom_hero_party),
  (try_end),
]),

Then in module_triggers.py change this trigger:

(0, 0,  9, [], [ #was 4*24
  (call_script, "script_ms_fill_ai_officer_troops"),

  ]),

to:

(0, 0,  9, [], [ #was 4*24
                  (call_script, "script_reset_kings_type"),
                  (call_script, "script_ms_fill_ai_officer_troops"),

  ]),

For anyone interested, this kind person solved my problem. Some lords get affected also so i expanded his module_script code.

("reset_kings_type",#unbugs kingdom_lord's slot_party_type     
[
  (try_for_parties, ":cur_party"),
      (party_is_active, ":cur_party"),
      (party_stack_get_troop_id, ":leader_troop", ":cur_party",0),
      (this_or_next|eq,":leader_troop","trp_kingdom_1_lord"),
      (this_or_next|eq,":leader_troop","trp_kingdom_2_lord"),
      (this_or_next|eq,":leader_troop","trp_kingdom_3_lord"),
      (this_or_next|eq,":leader_troop","trp_kingdom_4_lord"),
      (this_or_next|eq,":leader_troop","trp_kingdom_5_lord"),  
  (this_or_next|eq,":leader_troop","trp_knight_1_1"),
  (this_or_next|eq,":leader_troop","trp_knight_1_1"),
  (this_or_next|eq,":leader_troop","trp_knight_1_2"),
  (this_or_next|eq,":leader_troop","trp_knight_1_3"),
  (this_or_next|eq,":leader_troop","trp_knight_1_4"),
  (this_or_next|eq,":leader_troop","trp_knight_1_5"),
  (this_or_next|eq,":leader_troop","trp_knight_1_6"),
  (this_or_next|eq,":leader_troop","trp_knight_1_7"),
  (this_or_next|eq,":leader_troop","trp_knight_1_8"),
  (this_or_next|eq,":leader_troop","trp_knight_1_9"),
  (this_or_next|eq,":leader_troop","trp_knight_1_10"),
  (this_or_next|eq,":leader_troop","trp_knight_1_11"),
  (this_or_next|eq,":leader_troop","trp_knight_1_12"),
  (this_or_next|eq,":leader_troop","trp_knight_1_13"),
  (this_or_next|eq,":leader_troop","trp_knight_1_14"),
  (this_or_next|eq,":leader_troop","trp_knight_1_15"),
  (this_or_next|eq,":leader_troop","trp_knight_1_16"),
  (this_or_next|eq,":leader_troop","trp_knight_1_17"),
  (this_or_next|eq,":leader_troop","trp_knight_1_18"),
  (this_or_next|eq,":leader_troop","trp_knight_1_19"),
  (this_or_next|eq,":leader_troop","trp_knight_1_20"),
  (this_or_next|eq,":leader_troop","trp_knight_2_1"),
  (this_or_next|eq,":leader_troop","trp_knight_2_2"),
  (this_or_next|eq,":leader_troop","trp_knight_2_3"),
  (this_or_next|eq,":leader_troop","trp_knight_2_4"),
  (this_or_next|eq,":leader_troop","trp_knight_2_5"),
  (this_or_next|eq,":leader_troop","trp_knight_2_6"),
  (this_or_next|eq,":leader_troop","trp_knight_2_7"),
  (this_or_next|eq,":leader_troop","trp_knight_2_8"),
  (this_or_next|eq,":leader_troop","trp_knight_2_9"),
  (this_or_next|eq,":leader_troop","trp_knight_2_10"),
  (this_or_next|eq,":leader_troop","trp_knight_2_11"),
  (this_or_next|eq,":leader_troop","trp_knight_2_12"),
  (this_or_next|eq,":leader_troop","trp_knight_2_13"),
  (this_or_next|eq,":leader_troop","trp_knight_2_14"),
  (this_or_next|eq,":leader_troop","trp_knight_2_15"),
  (this_or_next|eq,":leader_troop","trp_knight_2_16"),
  (this_or_next|eq,":leader_troop","trp_knight_2_17"),
  (this_or_next|eq,":leader_troop","trp_knight_2_18"),
  (this_or_next|eq,":leader_troop","trp_knight_2_19"),
  (this_or_next|eq,":leader_troop","trp_knight_2_20"),
  (this_or_next|eq,":leader_troop","trp_knight_3_1"),
  (this_or_next|eq,":leader_troop","trp_knight_3_2"),
  (this_or_next|eq,":leader_troop","trp_knight_3_3"),
  (this_or_next|eq,":leader_troop","trp_knight_3_4"),
  (this_or_next|eq,":leader_troop","trp_knight_3_5"),
  (this_or_next|eq,":leader_troop","trp_knight_3_6"),
  (this_or_next|eq,":leader_troop","trp_knight_3_7"),
  (this_or_next|eq,":leader_troop","trp_knight_3_8"),
  (this_or_next|eq,":leader_troop","trp_knight_3_9"),
  (this_or_next|eq,":leader_troop","trp_knight_3_10"),
  (this_or_next|eq,":leader_troop","trp_knight_3_11"),
  (this_or_next|eq,":leader_troop","trp_knight_3_12"),
  (this_or_next|eq,":leader_troop","trp_knight_3_13"),
  (this_or_next|eq,":leader_troop","trp_knight_3_14"),
  (this_or_next|eq,":leader_troop","trp_knight_3_15"),
  (this_or_next|eq,":leader_troop","trp_knight_3_16"),
  (this_or_next|eq,":leader_troop","trp_knight_3_17"),
  (this_or_next|eq,":leader_troop","trp_knight_3_18"),
  (this_or_next|eq,":leader_troop","trp_knight_3_19"),
  (this_or_next|eq,":leader_troop","trp_knight_3_20"),
  (this_or_next|eq,":leader_troop","trp_knight_4_1"),
  (this_or_next|eq,":leader_troop","trp_knight_4_2"),
  (this_or_next|eq,":leader_troop","trp_knight_4_3"),
  (this_or_next|eq,":leader_troop","trp_knight_4_4"),
  (this_or_next|eq,":leader_troop","trp_knight_4_5"),
  (this_or_next|eq,":leader_troop","trp_knight_4_6"),
  (this_or_next|eq,":leader_troop","trp_knight_4_7"),
  (this_or_next|eq,":leader_troop","trp_knight_4_8"),
  (this_or_next|eq,":leader_troop","trp_knight_4_9"),
  (this_or_next|eq,":leader_troop","trp_knight_4_10"),
  (this_or_next|eq,":leader_troop","trp_knight_4_11"),
  (this_or_next|eq,":leader_troop","trp_knight_4_12"),
  (this_or_next|eq,":leader_troop","trp_knight_4_13"),
  (this_or_next|eq,":leader_troop","trp_knight_4_14"),
  (this_or_next|eq,":leader_troop","trp_knight_4_15"),
  (this_or_next|eq,":leader_troop","trp_knight_4_16"),
  (this_or_next|eq,":leader_troop","trp_knight_4_17"),
  (this_or_next|eq,":leader_troop","trp_knight_4_18"),
  (this_or_next|eq,":leader_troop","trp_knight_4_19"),
  (this_or_next|eq,":leader_troop","trp_knight_4_20"),
  (this_or_next|eq,":leader_troop","trp_knight_5_1"),
  (this_or_next|eq,":leader_troop","trp_knight_5_2"),
  (this_or_next|eq,":leader_troop","trp_knight_5_3"),
  (this_or_next|eq,":leader_troop","trp_knight_5_4"),
  (this_or_next|eq,":leader_troop","trp_knight_5_5"),
  (this_or_next|eq,":leader_troop","trp_knight_5_6"),
  (this_or_next|eq,":leader_troop","trp_knight_5_7"),
  (this_or_next|eq,":leader_troop","trp_knight_5_8"),
  (this_or_next|eq,":leader_troop","trp_knight_5_9"),
  (this_or_next|eq,":leader_troop","trp_knight_5_10"),
  (this_or_next|eq,":leader_troop","trp_knight_5_11"),
  (this_or_next|eq,":leader_troop","trp_knight_5_12"),
  (this_or_next|eq,":leader_troop","trp_knight_5_13"),
  (this_or_next|eq,":leader_troop","trp_knight_5_14"),
  (this_or_next|eq,":leader_troop","trp_knight_5_15"),
  (this_or_next|eq,":leader_troop","trp_knight_5_16"),
  (this_or_next|eq,":leader_troop","trp_knight_5_17"),
  (this_or_next|eq,":leader_troop","trp_knight_5_18"),
  (this_or_next|eq,":leader_troop","trp_knight_5_19"),
  (eq,":leader_troop","trp_knight_5_20"),
  (party_set_slot, ":cur_party", slot_party_type, spt_kingdom_hero_party),
  (try_end),
]),
There is probably a more concise way to write it.
 
Wow I've been waiting for this fix for ages!
I'm so excited to play WFAS again.
However is there any  easy way of implementing that fix? I cant seem to even locate that file.
Would it be possible to get the already modified file with fix for all lords that I could just replace in my game folder? Sorry for dumb question.
 
If you don't want to use the module system, you'll need to edit the compiled txt files. Take backups before making any changes in case of errors.
Find the following line of code in triggers.txt (look from the bottom up as it's near the end):

0.000000 0.000000 9.000000  0  1 1 1 936748722493063846

and change it to:

0.000000 0.000000 9.000000  0  2 1 1 936748722493063945 1 1 936748722493063846

Edit scripts.txt and change its start from:

scriptsfile version 1
776
game_start -1

to:

scriptsfile version 1
777
game_start -1

Then paste this extra script onto the end of scripts.txt:

reset_kings_type -1
14 11 1 1224979098644774912 132 1 1224979098644774912 1652 3 1224979098644774913 1224979098644774912 0 4 0 33 3 1224979098644774913 360287970189639981 360287970189640091 501 3 1224979098644774912 0 13 5 0 33 3 1224979098644774912 648518346341351445 648518346341351463 501 3 1224979098644774912 0 3 5 0 33 3 1224979098644774912 648518346341351463 648518346341351503 501 3 1224979098644774912 0 2 3 0 3 0
 
Thank you so much for this, really appreciate that!

Just one more question about that .txt fix - will it fix every lord or just the kings?

NPC99 said:
Resets spt type slot for all lords, towns & castles.

<3
 
NPC99 said:
Resets spt type slot for all lords, towns & castles.

Okay, I have tested it for the past 2 days, and sadly I have to say it doesn't work.
I made the tweaks (even double checked it now that I havent messed anything) and started fresh and as far as I can see neither towns nor lords reinforce troops at all. I'm like ~60 days in and there are already multiple lord parties sitting at (1) and few towns/keeps at (0) units.
:sad:
 
Back
Top Bottom