Making Lords who defect use the troops of their new faction

Users who are viewing this thread

Hey guys, I tried to make Lords who defect or get indicted use the troops of their new faction by going into module_scripts under the line that starts with ("cf_reinforce_party", and changing slot_troop_original_faction to slot_faction_culture, but now when I started a new game none of the Lords have any troops and the message updates in the bottom corner don't appear anymore. When I look in recent messages, I see these error messages repeating over and over:


SCRIPT ERROR ON OPCODE 522: Invalid Faction ID: 539; LINE NO: 18: At script: cf_reinforce_party
SCRIPT ERROR ON OPCODE 522: Invalid Faction ID: 539; LINE NO: 19: At script: cf_reinforce_party
SCRIPT ERROR ON OPCODE 522: Invalid Faction ID: 539; LINE NO: 20: At script: cf_reinforce_party


Any ideas on how to fix this?

Well, I changed slot_faction_culture back to slot_troop_original_faction, and now it works again. Is there any way to make them use their current faction troops without breaking it? I remember being able to do this in an earlier versions by changing that line.
 
I went into module_scripts, and found the line that looks like

  ("cf_reinforce_party",
    [
      (store_script_param_1, ":party_no"),
     
      (store_faction_of_party, ":party_faction", ":party_no"),
      (party_get_slot, ":party_type",":party_no", slot_party_type),

#Rebellion changes begin:
      (try_begin),
        (eq, ":party_type", spt_kingdom_hero_party),
        (party_stack_get_troop_id, ":leader", ":party_no"),
        (troop_get_slot, ":party_faction",  ":leader", slot_troop_original_faction),
      (try_end),
#Rebellion changes end

Where it says slot_troop_original_faction I replaced it with slot_faction_culture, but that caused me to have the errors I described.
 
Remmik said:
Where it says slot_troop_original_faction I replaced it with slot_faction_culture, but that caused me to have the errors I described.

show the code means just that, show your code. You only did 50% that (showing the old one, not the new version).

anyway, why are you trying to use a faction slot on a troop operation? Think about it. Review module_constants.py, as the divisions there clearly indicated which section belong to what. Then see what operation you should use on your NEW code that can accept the constant for a FACTION type, not a TROOP type.

You can post your new code if you have new issues after the changes.
 
You could also try to change the lords’ original_faction value in the indictment/defecting script to their new kingdom, I suppose, but it could mess up other scripts
 
Back
Top Bottom