Essentially this is what I want to do as pseudocode:
- Code: Select all
For Unit in Units
If Unit.HasWeapon then
If Unit.HasAttackOrder then
If not (Unit.Target.Visible or Unit.Target.OnRadar) then
Unit.Order.Cancel()
End If
End If
End If
End For
So pretty much loop through every active unit, check if it meets the conditions and if it does, cancel the current order.
But I don't understand exactly where I should be doing this. I can't really find any documentation on creating your own methods that do anything to attack orders. I have looked through the code in FA 3619 and found a few routines that look promising, but I've had to admit to myself that I just don't know how to properly isolate them into a mod when there's so much other code I don't need.
Anyone able to point me in the right direction here?