I'm making a mission with multiple sentry checkpoints which can alert nearby vehicles to an enemy's presence by firing a flare.
I've got the flare intermittenly working. The problem is, if you surprise the sentry (ex: firing from behind a nearby hill without being seen), he'll forget to fire the flare and simply go to engage you.
I use a synchronized trigger (west detected by east) to activate the script. So, obviously, he shouldn't have to see you to fire the flare (he can hear you).
Here is my script:
_unit = _this select 0
_flaretype = _this select 1
_unit setcombatmode "blue"
? _unit ammo _flaretype == 0 : _unit addmagazine _flaretype
@ unitready _unit
_unit fire ["GrenadesMuzzle", _flaretype]
@ unitready _unit
_unit setcombatmode "yellow"
exit
For some reason, he'll occasionally act like he's about to fire (he begins to aim upwards), then he'll stop, reload, and start firing bullets in your direction (if you're visible, otherwise he just drops to the ground and waits for you).
It's like he thinks "screw it, I can handle this myself" and skips the firing action. Why isn't he waiting until he actually fires the flare before returning to combat mode yellow (engage at will)? Why isn't he stuck on combat mode blue (never fire) until he fires the flare?