Keedo420
Knight at Arms
I came up with this simple little script to solve a dilemma involving the dungeon in my mod. When you first enter the dungeon, the first two troops in your party (or the first two troops in a stack if a stack is first in your party) will spawn near you. However, since there are no enemies in the dungeon until you trigger various encounters, those troops will just stand there unless you issue the "Follow me" command. On top of that, npc path finding in the dungeon is horrible which made getting the troops where you needed them a monumental test of patience. So I came up with this little script to summon your allies to your current location.
In the dungeon mission template (the only one I wanted this option to be available in), I added this trigger:
And in module_scripts, I added this script:
This causes your allies in the scene to be relocated to your current position when you press the M key. I was quite pleased that I actually figured out how to do this myself, since this is the first script I wrote entirely on my own without looking at other scripts for examples. So I thought I would share it in case anyone wanted to do something similar.
In the dungeon mission template (the only one I wanted this option to be available in), I added this trigger:
Code:
(0, 0, 0, [(key_clicked, key_m),(call_script, "script_cf_summon_allies")], []),
And in module_scripts, I added this script:
Code:
#summon allies
("cf_summon_allies",
[(get_player_agent_no,":player_agent"),(agent_is_alive,":player_agent"),(agent_get_position,pos1,":player_agent"),
(try_for_agents, ":ally"),
(neq,":ally",":player_agent"),
(agent_is_alive,":ally"),
(agent_is_ally,":ally"),
(agent_set_position,":ally",pos1),
(try_end),
]),
This causes your allies in the scene to be relocated to your current position when you press the M key. I was quite pleased that I actually figured out how to do this myself, since this is the first script I wrote entirely on my own without looking at other scripts for examples. So I thought I would share it in case anyone wanted to do something similar.