I deeply appreciate the interest that many of you have expressed for knowing how I did put together my tactical decision aid, but I have to confess that I dread that you will be disappointed. I'm no programmer, and I grabbed pieces of code from here and there to put together this Frankenstein project. I apologize in advance, as you may see improper coding techniques and some inconsistencies in the logic of my entire scenario.
Without further ado, here is what I did.
If you remember from my previous post, the sequence of events was:
- The scenario starts
- A counter is initialized. This counter keeps track of a series recursive ship vs sub simulation runs
- Units are added to the scenario
- The US warship is placed in the center and give a course due south, at flank speed
- A DPRK sub is placed 50 miles from the US ship and given a patrol area delineated by the reference points above
- If the US warship remains undetected and reaches an escape area south of the DPRK patrol's area
- All units are deleted
- The counter mentioned in 1.1 is advanced
- New units are generated
- A US warship is placed in the center and give a course due south, at flank speed
- 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
- If the US warship is detected
- 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.
- All units are deleted
- The counter mentioned in 1.1 is advanced
- New units are generated
- Same as 3.1
- Same as 3.2
The CMANO scenario editor allows the player to glue together special actions within events. Events are triggered by triggers and conditioned by conditions :) . This is because many times, you want an special action (strike hostile nation's port) to happen when something has happened (i.e. a friendly ship was attacked, a trigger) and a condition is met (i.e. you have the means to strike nearby the target, a condition).
The logical hierarchy goes: Events do happen when Triggers are triggered, Conditions are met. The output is actions.
The beauty of all this is that conditions and actions can be Lua scripts. And when you unleash a Lua script, the world moon is at your feet.
So, let's start with the events.
Events
I'm first going to list the events that mark the course of this scenario.
- The scenario starts. In the editor, I created an event named Scenario Start Event
- A counter is initialized. This counter keeps track of a series recursive ship vs sub simulation runs
- Units are added to the scenario
- The US warship is placed in the center and give a course due south, at flank speed
- A DPRK sub is placed 50 miles from the US ship and given a patrol area delineated by the reference points above
- 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.
- All units are deleted
- The counter mentioned in 1.1 is advanced
- New units are generated
- A US warship is placed in the center and give a course due south, at flank speed
- 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
- If the US warship is detected. In the editor I created an event named US Warship Was Detected.
- 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.
- All units are deleted
- The counter mentioned in 1.1 is advanced
- New units are generated
- Same as 3.1
- Same as 3.2
My list of events. |
And let's take a cursory look at the triggers, conditions and events that make up every event.
The Scenario Start Event: One trigger, no conditions, and two actions. |
The US Warship has Escaped from the Area event: one trigger, no conditions, two actions. |
The US Warship Was Detected event: one trigger, no conditions, three actions. |
It is a very good practice to draft an outline of what you want to happen from the very start.
For beginners, it is also helpful to add the word "Event", "Condition" and "Action" while naming events, conditions and actions. This is a thing I practiced only partially (see above). When you are tired, it is very easy to loose track if you are editing a trigger or an action. The potential for shenanigans is an exponential function of the numbers of logical entities you have playing around.
In the next episode, let's get into some Lua.
Cheers,
3 comments:
You're a very brave man for diving into all that!
As a programmer, I can tell you that your notes on drafting an outline and naming things appropriately will help you a ton. Minimizing confusion is key. I'm looking forward to seeing what you can cook up!
-tFS (theFlyingDouble-Immelman)
How are you? It's amateurs night! :p
Thanks for reading,
Gripping stuff. I can't wait for the next instalment. Thank you for doing this for us.
Post a Comment