I'm struggling to solve one particular issue: how to make a unit that can't fire on the move stop and fire, and then continue on with whatever mision it was on. The particular use case is stopping a SAM unit that can't fire on the move if it's convoy is approached by hostile A/C. More concretely, I'm trying to redo the Hunting Day, 2008 scenario without the teleport system, so the escorting SAM behave more rationally.
I can easily manage to stop a unit using LUA by attaching a zone to it and using the "Unit Enters Area" trigger and the following LUA bit:
However, the problem lies in removing that HoldPosition flag.
The "Unit Enters Area" stops the SAM alright (even if it's not detected when it enters, but I can compromise on that), but the negated version of the same trigger doesn't cut it (both because a dead Bogey can't "leave" and because the logic is "when a unit is NOT within this area do X" so as long as not all hostile aircraft approach the SAM it won't fire.)
How do you veterans do this kind of stuff?
< Message edited by Aivlis -- 12/6/2015 6:43:16 PM >