Page 1 of 1

Using detection event to attack ...

Posted: Wed Feb 21, 2018 11:01 am
by michaelm75au
I have created a simple scenario that shows how a ship could be ordered to attack with Lua.
This is from an older example I had for testing, but have updated to use UnitX and UnitY.

There is an event that triggers on detection of SideA's LST400. When it triggers and the unit is identified as LST400, the SideB DDG is given instructions to attack the contact with a 'gun' weapon (manual weapon allocation). There is a commented line showing how to auto attack the contact.
In this case, the DDG is not in range or has the correct weapon on the mount. So once the attack order is issued, it reloads the correct weapon and closes with the target. [if it had been in range and weapon ready, it would have just started firing]. Once in range it fires the requested number of shells, and then stops.

Just load the scenario and press start. Time compressing to 2 seconds will speed it up without missing anything.

RE: Using detection event to attack ...

Posted: Wed Feb 21, 2018 6:46 pm
by AlGrant
[8D] It's almost like you knew what I needed for the scenario I was building earlier today!

RE: Using detection event to attack ...

Posted: Wed Feb 21, 2018 9:47 pm
by AlphaSierra
Very cool Thanks Michael