Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Sample Lua attack scenario

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> Sample Lua attack scenario Page: [1]
Login
Message << Older Topic   Newer Topic >>
Sample Lua attack scenario - 1/6/2017 10:41:41 PM   
michaelm75au


Posts: 13257
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
I have created a simple scenario that shows how a ship could be ordered to attack with Lua.
Thought showing this off might be more helpful ...

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.

There are a couple of hard-coded values in the script as the unit making the detection is not passed from the Event trigger. It may be something to think about (eg SE_DetectedByX() gives you who made the detection, and you could make conditions or actions more precise, like only do this if the detector is a small surface ship). Embedding this as part of the event editor would get tooooo messy.

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

Attachment (1)

_____________________________

Michael
Post #: 1
RE: Sample Lua attack scenario - 1/7/2017 5:03:35 AM   
Maromak


Posts: 1025
Joined: 12/26/2007
From: Australia
Status: offline
Thanks this is very helpful for us non-coders!

_____________________________

Certa Cito

(in reply to michaelm75au)
Post #: 2
RE: Sample Lua attack scenario - 1/7/2017 2:40:24 PM   
AlGrant


Posts: 908
Joined: 8/18/2015
Status: offline
Thanks Michael

quote:

Thanks this is very helpful for us non-coders!

Agree. I find a working example of a particular Lua command really helpful.

(in reply to michaelm75au)
Post #: 3
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> Sample Lua attack scenario Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.125