Using detection event to attack ...

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
User avatar
michaelm75au
Posts: 12463
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

Using detection event to attack ...

Post 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.
Attachments
SandboxLu..actinfo.zip
(271.09 KiB) Downloaded 45 times
Michael
User avatar
AlGrant
Posts: 912
Joined: Tue Aug 18, 2015 4:38 am

RE: Using detection event to attack ...

Post by AlGrant »

[8D] It's almost like you knew what I needed for the scenario I was building earlier today!
GOD'S EYE DISABLED.
AlphaSierra
Posts: 132
Joined: Mon Feb 13, 2017 9:35 am

RE: Using detection event to attack ...

Post by AlphaSierra »

Very cool Thanks Michael
I wish to have no connection with any ship that does not sail fast; for I intend to go in harm's way. -John Paul Jones
Post Reply

Return to “Lua Legion”