well, i thought this was a bit of a fun challenge to figure this out. It seems i got it working. It would be a bit difficult to explain it al in text only, so i included a mission file to go with it.
Here goes:
First of all, you need to discern 2 different things: if the missile fire is the first, or a second or third missile.
So when the first missile fires, you detect a missile, and you set a "Missile Active" Flag to on, and you also test that flag to be OFF on that very same trigger. If that flag is off, it is the first missile.
---
Then. You need to clone that exact trigger again, but this time, check for that "Missile Active" Flag to be ON. If it is true, then this is not the first missile. Now Set the Missile Active" Flag to on again, even if it is already on.
Now. on this second missile detection, you set another flag to true, name this a "Multi Missile Active" Flag
You need to check this flag as well to be off on the first detection trigger.
---
Every time a flag is set to on, while it is already on, that trigger will restart the count. (you could also build a trigger to manually set it to off, and then immediatley set it to on again after 1 second)
Now build a trigger that sets the "Missile Active" Flag to off after 120s (time since flag).
Build another trigger that sets the ""Multi Missile Active" Flag to off after 180s (time since flag).
---
As for the detection zone, make it small. why? Well, the above works in theory, but needs one more thing. If a missile is launched, and the flag comes on, it wil immediately trigger the second detection rule also, since the only difference in the detection triggers is that "Missile Active" Flag. So we need to build an inhibit flag. A flag that comes on with any missile launch, but then sets a flag for 10 secs and then turns off. that flag needs to be off in order for any of the 2 missile detection triggers to be valid. Those 10 seconds is what the missile needs to leave the small detection zone. So when the inhibit switches off, there is no missile to detect in the zone anymore, and the zones are ready for the next detection.
Lastly, i build in a missile launch simulator. Which means you can use the radio F10 menu to trigger a simulated missile launch. That is why you will find the 'OR' statements in the detection triggers.
also, i set the timers different for easy testing. 30 sec instead of 120, and 60 secs instead of 180. You can easily adjust those off course. Text messages included in the operations.
Hope this helps. 🙂
Missile loops.miz Missile loops with missile simulation.miz
Yeah ok, seems to be working.
trick is how the flag was set from the mission editor.
When using flag on/off, the value is a 1 or 0. when you use an if statement to test the value, you should use a integer or boolean value to test for it, and not the string value.
setting flag random value (max 100) works too.