ScenEdit: Temporary "Hold Position" (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios



Message


Aivlis -> ScenEdit: Temporary "Hold Position" (12/6/2015 5:39:46 PM)

Hi,

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:
quote:

ScenEdit_SetUnit({name="MyUnit", HoldPosition=1})


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?




Aivlis -> RE: ScenEdit: Temporary "Hold Position" (12/6/2015 7:48:31 PM)

I went for a walk and came back with a solution: use a neutral "Logic" side to the conflict to have a truck drive back and forth across a detection zone, and every time it passes through it, order my SAM to keep moving. If the delay between orders to resume movement is long enough the SAM will remain still and engage any bogies in the designated area.

The downsides are that if it's engaged when the "Keep Moving" order comes in it may twitch for a second before it gets overridden by the "Stop and Fire" event, which fires continuously if a hostile A/C is in range. This could be a problem for certain SAM systems that require illumination for their targets (not tested, just my gut sense).

Does anyone have a different approach? Am I over-complicating things and this could be done with a few lines of code?




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
3.875