Ishapar
Regular
Remember the Dark Knight's Invasion in the Native Expansion mod? I was always interested in adding some type of invading party(s) to the game to act as a separate threat from bandits and lords. I didn't find much information on how to do this other than this topic: https://forums.taleworlds.com/index.php?threads/an-invasion-osp-script.231383/
Lumos provided a simple code to have an invading party of Swadian Knights spawn and chase any other party. I'll provide his codes here:
module_party_templates:
module_triggers:
So I tried to paste both codes in my module. I pasted the module_party template first and was able to build a batch file with no problems. Anytime I try to paste the module_triggers code and build the batch, however, I get "WARNING: Global variable never used" for every single variable in the batch. I tried running the mod and...let's just say it is very buggy. I am not sure what to think.
When you add a code to module_triggers, does the placement of the code matter? What else could be causing those warnings? Is there a different way people have done an invading party that can give input on these errors?
Thanks.
Lumos provided a simple code to have an invading party of Swadian Knights spawn and chase any other party. I'll provide his codes here:
module_party_templates:
Python:
Code:
("invaders","Invaders",icon_khergit|carries_goods(2)|pf_show_faction,0,fac_outlaws,bandit_personality,[(trp_swadian_knight,100,320),]),
# I hate the evil swadians...
module_triggers:
Python:
Code:
(8765,0,ti_once,[],[
(set_spawn_radius, 4),
(try_for_range, ":i", 0, 251), # 251 = number of invaders to spawn + 1
(spawn_around_party, "p_town_1", "pt_invaders"),
(val_add, ":i", 1), # i++, so no "unused local var" message
(try_end),
So I tried to paste both codes in my module. I pasted the module_party template first and was able to build a batch file with no problems. Anytime I try to paste the module_triggers code and build the batch, however, I get "WARNING: Global variable never used" for every single variable in the batch. I tried running the mod and...let's just say it is very buggy. I am not sure what to think.
When you add a code to module_triggers, does the placement of the code matter? What else could be causing those warnings? Is there a different way people have done an invading party that can give input on these errors?
Thanks.
Last edited: