Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Intelligent SAM Operator (LUA)

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 >> Intelligent SAM Operator (LUA) Page: [1]
Message << Older Topic   Newer Topic >>
Intelligent SAM Operator (LUA) - 11/14/2019 9:55:21 AM   


Posts: 54
Joined: 7/5/2018
Status: offline
Intelligent SAM Operator (LUA)

The attached example scenario uses LUA scripting to provide some basic AI for non-player SAM operators so they only use active radar when a contact is within missile range for example. The scripts can be extended to implement more complex rules such as using the individual contact details to determine what actions to take.

I’m not going to explain the implementation in detail in this post and leave the reader to look through the 3 events that control the action as you’ll need to extend the LUA for your own scenarios.

Example Scenario

In the test scenario we send a BLUE tanker into the RED air defence zone and watch an SA-12 SAM site operator react to the intrusion.

- Load the scenario in the Scenario Editor so you can see what’s going on behind the scenes.

- Enter as BLUE and pause the sim.

- Select the KC-135 tanker (Blue Hawk #1) and plot a course towards the SA-12 unit so that the tanker stops around 30 miles away from the SAM. Create a second leg that sends the tanker back to the original starting point.

- Switch to RED and select the SA-12 unit. Note that the radar is currently set as passive in the EMCON doctrine and the Sensors window shows the radar is inactive.

- Open the Editor->Event Editor-> Events window and note that there are 3 events but only 1 is currently active (“Activate Air Defence”).

- Note that there is an exclusion zone around the SA-12 site (“SA-12 Zone”). The Reference Points for this zone are also used in the LUA area check code and the Unit Enters Area event trigger.

- Unpause the SIM.

As the KC-135 enters the “SA-12 Zone” exclusion zone it is marked as Unfriendly by the zone rules. Shortly after the tanker enters the zone (up to 1min) you will see 3 separate Events firing in the message log window:

- “Activate Air Defence”: event fired by a unit entering the SA-12 zone using an event “unit enters area” trigger.

- “SA-12 Area Check”: timed regular event (1min) enabled by the “Activate Air Defence” event action which runs a LUA script.

- “SA-12 Range Check”: timed regular event (30sec) enabled by the “Activate Air Defence” event action which runs a LUA script.

At this point there are no other responses to the intruding tanker but behind the scenes the LUA AI SAM operator is checking whether any contacts are still in the exclusion zone (“SA-12 Area Check”) and whether any contacts are within the SA-12 missile engagement range (“SA-12 Range Check”). You will see these two events being regularly fired in the message log window (these messages can be disabled by editing the events and unticking the IsShown box).

Shortly after the tanker moves within 45nm of the SA-12 unit the “SA-12 Range Check” event action will switch the SA-12 radar to active mode. You will see the radar ring appear around the site and can confirm the active status for the Grill Pan FCR in the Sensors window.

Once the tanker turns around and leaves the SA-12 missile engagement range the “SA-12 Range Check” event action will switch the SA-12 radar back to passive mode.

Once the tanker leaves the SA-12 exclusion zone you will see the two timed “check” events are made inactive and are no longer fired.

This process repeats for any intrusions into the exclusion zone and the SA-12 MEZ. If at least one contact is inside the exclusion zone the checks will remain active. If at least one contact is inside the SA-12 MEZ then the Grill Pan FCR will be active. A contact can leave, be lost or destroyed and the outcome is the same in all cases.


The Event Action LUA scripts for the Area and Range checks are the key components which can be extended to provide more complex logic based on the contact type and other attributes. For example:

- Bring up extra search radars when a contact is detected in the exclusion zone.

- If a contact is classified as a missile then assume it is an ARM and shutdown the FCR radars in order to prevent the SAM site being destroyed.

- Activate OECM units as well as radars (the test scenario has a Krasuha ELINT truck that can be used for this purpose).

- Change the SAM doctrine to TIGHT or FREE from HOLD based on the contact range to spring a close-range trap.

- Designate a contact as HOSTILE once inside the SAM engagement range.

- Activate an AAW intercept mission depending on the range, type and number of contacts, e.g. don’t launch if a missile-only attack is detected approaching the base, leave them to the SAMs.

If you want to cheat then you can access the data for the real unit associated with the contact although for realism you should only use the known contact data

Attachment (1)

< Message edited by Zathred -- 11/23/2019 6:55:13 PM >
Post #: 1
RE: Intelligent SAM Operator (LUA) - 11/14/2019 10:48:46 AM   


Posts: 157
Joined: 4/13/2014
Status: offline
That is very useful. Would come in very handy in a couple scenarios I have been playing.


USS Dwight D. Eisenhower (CVN-69) 1990-1994.

(in reply to Zathred)
Post #: 2
RE: Intelligent SAM Operator (LUA) - 11/14/2019 10:01:58 PM   


Posts: 198
Joined: 11/15/2018
Status: offline
Simply put, good stuff, thanks.

(in reply to 1nutworld)
Post #: 3
RE: Intelligent SAM Operator (LUA) - 12/2/2019 3:29:16 PM   

Posts: 1136
Joined: 4/14/2007
From: Washington D.C.
Status: offline

(in reply to Zathred)
Post #: 4
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> Intelligent SAM Operator (LUA) 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