Sunday, September 24, 2017

CMANO - Making Tactical Decision Aids - The Lua Gag Reel Episode 2

This is a continuation from my previous post. Let's take a look at the triggers that move my tactical decision aid scenario.




Access to the triggers is performed from the main menu. Editor -> Event Editor -> Triggers. The window that pops out (see screenshot above) allows the edition and creation of new triggers.

I don't know if you remember my previous blog entry, but the outline of my scenario was as shown below. The triggers that put the events in motion are highlighted green.

  1. The scenario starts. In the editor, I created an event named Scenario Start Event. I now added a trigger named Scenario is Loaded Trigger.
    1. A counter is initialized. This counter keeps track of a series recursive ship vs sub simulation runs
    2. Units are added to the scenario
      1. The US warship is placed in the center and give a course due south, at flank speed
      2. A DPRK sub is placed 50 miles from the US ship and given a patrol area delineated by the reference points above
    3. If the US warship remains undetected and reaches an escape area south of the DPRK patrol's area. In the editor I created an event named US Warship has Escaped from the Area. I now added a trigger named US Warship has Escaped the Area.
      1. All units are deleted
      2. The counter mentioned in 1.1 is advanced
      3. New units are generated
        1. A US warship is placed in the center and give a course due south, at flank speed
        2. A DPRK sub is placed 50 miles from the US ship and given a patrol area delineated by the reference points above. The DPRK sub initial position is not the same as the one used in the previous simulation run. This initial position is advanced clockwise from the initial position of the US warship
    4. If the US warship is detected. In the editor I created an event named US Warship Was Detected. I now added a trigger name US Warship is Detected Trigger.
      1. A marker reference point is made at the initial position of the DPRK sub. The marker is labelled "Danger" because this an initial sub position that will generate a headache for the US commander.
      2. All units are deleted
      3. The counter mentioned in 1.1 is advanced
      4. New units are generated
        1. Same as 3.1
        2. Same as 3.2

Now a closer look at the triggers.


The Scenario is Loaded Trigger is a trigger type that takes no parameters other than just the scenario being loaded. Its creation is straightforward and the trigger fires up every time the scenario is loaded.

The US Warship has Escaped the Area is of the "Unit Enters Area" type (by the way, note the different type of triggers available in the tabs on top). I hope you can see the great variety of parameters that a trigger can have. In this case, I did only care that the ship was from the US side and that it was a surface ship. 

In the screenshot above you will notice that in order to check a unit entering an area, the scenario author has to define such area. In this case it is a rectangle delimited by reference points (RP126 through RP129, magenta rectangle in the map). This "escape area" is entirely arbitrary from my part. I wanted to stop the simulation run when the US warship was out of the submarine patrol area (the area within the circle delimited by non-highlighted reference points (they look like an x).

And finally, the US is Detected Trigger, which is of the "Unit is Detected" type. For this trigger, I had to specify that the detector was from the DPRK and that the target side was a surface ship from the USA side.

Whaaaaat? No Lua yet? Lua scripting in the next episode. Stay tuned!

Cheers,

2 comments:

Paolo said...

I might be a nerd, but damn I love this stuff!

xxup said...

This is great stuff, but the suspense is killing me..