Hi Folks,
i´ve started to implement Moose within my missions but get stucked regarding the following problem. I want to create a training-mission where a trigger starts to spawn (and respawn) infinite bandits. This was easy .. i think :-) the following code works fine for me:
if trigger.misc.getUserFlag('1') == 1 then
Spawn_Mig_29 = SPAWN:New("Mig-29"):InitKeepUnitNames(true)
Spawn_Mig_29:InitLimit( 1, 0 ):SpawnScheduled( 60, 0 )
Spawn_Mig_29:InitRepeatOnEngineShutDown()
Spawn_Su_27 = SPAWN:New("Su-27"):InitKeepUnitNames(true)
Spawn_Su_27:InitLimit( 1, 0 ):SpawnScheduled( 60, 0 )
Spawn_Su_27:InitRepeatOnEngineShutDown()
end
But now - i want to be able to deactivate/stop the respawning of the bandits and .. after that ... be able to reactivate the respawning. So i added the following lines - and this doesn´t work so far:
if trigger.misc.getUserFlag('1') == 2 then
Spawn_Mig_29:SpawnScheduledStop()
Spawn_Su_27:SpawnScheduledStop()
end
if trigger.misc.getUserFlag('1') == 3 then
Spawn_Mig_29:SpawnScheduledStart()
Spawn_Su_27:SpawnScheduledStart()
end
For your information. I´ve added radio-messages (switched condition) to the mission, which set the flag '1' to 1, 2 or 3.
Question beside. For testing and debugging i´ve changed the lua-script a several times and added messages ToAll() to see if the triggers 2 an 3 are adressed. I´ve never seen a message. So i deleted the whole content of my lua script and restarted the mission ... nevertheless the bandits spawned, so i think the lua-script file wasn´t read again. So i restarted DCS and changed the name of the lua-file. That worked so far for lua-changes, but the code-lines above won´t work. Anyone got an idea, how to solve my concern ?