-
October 25, 2022, 04:46 AM
#1
Libertus
Scripting - Listening to Incident Trigger - Help
Hey everyone!
I'm looking to script a function that On FactionTurnStart it will check is a certain incident is triggered. And if so it should spawn some units belonging to rom_slaves on the Incidents' target.
I tried to used the SPAWN_FORCE in Cdir with no results. I also tried REBELLION with no results. That's why I turned to scritping.
The idea was to do the following:
local function handle_events()
if incident(incident_key) istriggered then
local incident_region = I don't know how to get this. Should be the incident's target.
local army_x = regioncityx + 2
local army_y = regioncityy + 2 (Yeah I know its dangerous I'd rather just tell the game a distance from the city to spawn the army)
game_interface:create_force("rom_slave", "unitshere", incident_tegion, 437, 222, notsurewhattoputhere, true);
end
(...) more incident trigger checks here
end
scripting.AddEventCallBack("FactionTurnStart", handle_events);
Is this even at all possible?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules