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?