I am trying to get a squadron to engage a convoy from a distance with the Maxim cannon. However when given a standard 'attack' order retail AI gets in very close to the target and strafes the hull. I would rather have the AI stay back and shoot the target from a safe distance.
My attempt involves the use of the every-time argument. I have read stickies that suggest that the use of this conditional is reserved only when necessary but I can't think of a better way to get the results I want. The logic is 'every-time' the fighter is within a certain distance the speed of the fighter is set to zero via coordinate manipulation. Essentially the fighter cannot move but, I think it should be able to turn and shoot just fine.
but, I can't seem to get the 'every-time' conditional to work. In fact, it never becomes true. If I replace 'every-time' with 'when' the event works as predicted but only one time. The fighter just speeds up again after it has be stopped to 0 speed for that single frame.
(sorry could not figure out how to post images so I just made an attachment of the event in question)
Another work around I thought of involves waypoints where the fighter must constantly run back to a waypoint when it ventures too close, but I think this will make the attack of the fighter very ineffective because the fighter will spend more time running around than shooting. I would prefer if it just sat in one spot and fired the Maxim at far off targets until it is given new orders. Is there a way I can get this effect? Also, why isn't the 'every-time' conditional working in the given event?
Thanks for reading this, I have been at this for a day or so and the issue has completely halted my progress on a mission.
[attachment deleted by admin]