"Baptism of Fire" scenario for testing (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios


Clockmaster77 -> "Baptism of Fire" scenario for testing (1/20/2019 12:49:15 PM)


I have created my first scenario, and I need a little testing. Present both standard and Chains of War version, each with its delta file and an exported .inst personal version of an hypotetical Japanese Chitose Air Base with F-23 Stealth Fighters in 2024.

Here's the scenario description:

Hypothetical Scenario.

The Kuril Islands dispute, is a disagreement between Japan and Russia over sovereignty of the South Kuril Islands, which extends from northern Hokkaido to southern Kamchatka. These islands were annexed by the Soviet Union at the end of World War II. The disputed islands are under Russian administration, but they are claimed by Japan, as its Northern Territories.

The San Francisco Peace Treaty signed between the Allies and Japan in 1951, states that Japan must give up all claims over the Kuril Islands but it also does not recognize the Soviet Union's sovereignty over them.

The tightening of relations between NATO and Russian Federation after the invasion of Crimea (2014), and the following international tensions, led to a stalemate also with Japan.

In the last years of 2010 decade, Russia has installed several S-400 SAM stations over the islands of Urup and Iturup. Moreover, maritime patrols and ELINT satellite activity in the area led NATO intelligence to the certainty of the presence of nuclear submarines in the area, both attack and, unfortunately, ballistic.

This intense Russian activity followed the reviving of the YF-23 Black Widow II stealth fighter project.

At the end of 2019, USA and Japan, shocking the community of hystorical, scientific and military analysts, signs for the next air dominance fighter of Japan Air Self Defence Force: the F-23 Kuroi mibōjin (Black Widow). The needings by the Japan of an effective 5th generation fighter, and the increasing costs and technical difficulties encountered in the development of an indigenous stealth plane, led the authorities of the Japan and the USA to this important agreement.

But the Russians soons collect information about the airbase selected for the deployment of the new fighter in the 2024: Chitose Airbase, near the Kuril Islands and, more important, near Russian borders.

The Russian Authorities consider the presence of advanced Japanese stealth aircrafts near their borders as a direct threat to Russian national security.

The baptism of fire for the reborn F-23 is near: friday February the 2nd 2024, in the early morning, NATO intelligence collect data about intense activity in the airbase of Petropavlosk-Kamchatsky, recently refitted with advanced Su-57 stealth fighter and 8 of the newest variant of the extremely dangerous Tu-160 Blackjack supersonic bomber.

Moreover, is sure the presence in the seas south of the Hokkaido Isle of Russian nuclear attack and ballistic submarines. A surface Japanese Navy Group and two submarines are ready to hunt the intruders, but it will be imperative to conduct an ASW Patrol by the P-3 Orions present in the Chitose Air Base.

Scenario can also be played by Russian as human player. In such case the goal is the complete destruction of the Chitose Air Base.

I already know there are some problems, especially with a "mini" LUA script that I've created for assigning a Borey II nuclear submarine to a nuclear missile strike on the Chitose AB in case of the destruction of the entire Tu-160 Strike Squadron.
Anyway, I'd like to know what do you think about the scenario itself.
Comments and suggestions are very appreciated, especially on events/conditions and LUA scripts, since I really like this feature of Command, but it's the first time I try this scripting language.
Anyway, best editor I've ever seen in strategic game, must say.

Clockmaster77 -> RE: "Baptism of Fire" scenario for testing (1/20/2019 5:59:49 PM)

Actually known problems are:
1) Russian Strike force of Tu-160 mission often doesn't start (probably for the lack of air tanker for its Su-57 Escorts, working on it)
2) When the Borey II SSBN is destroyed the scenario ends (Some advice? Probably error in the event "Japan completely destroy the Russian Air Strike Squadron and the Borey II ballistic submarine: end of the Scenario, Russian Federation defeat" relating to selected triggers)
2) Lacks of air tankers for both sides (Working on it)
3) Lacks of emabarked helicopters in the japanese Surface Naval Group 458 (Working on it)
4) Lacks of scoring (Some advice? I don't even know how to assign scores or even if it possible, my mission ends ever at 0 points.)
5) Bad orientation of the japanese naval and submarine units at start (how to rotate the individual units in the scenario editor?)
6) anomalous courses of the naval units often appears
7) LUA script for the Action "If the Russian Tu-160 Strike Squadron is destroyed, Borey II class Submarine is assigned to mission: Borey II Nuclear Strike on Chitose AB" is probably defective (Some advice?)

Actually I am playing the scenario also from the Russian Federation side, to better test the aforementioned errors.

Thank You all for the advices and suggestions [&o]

Whicker -> RE: "Baptism of Fire" scenario for testing (1/20/2019 7:52:46 PM)

7) this script won't do what you want as is, but it also does not have an event. I assume it would have a trigger of time interval? to check very 5 minutes or something? if so then I think this lua may work, partially tested:

local Orels =0
for i=1,8 do

if ScenEdit_GetUnit({Side='Russian Federation', Name="Orel #"..i,}) == nil then --counts if it does not exist
Orels = Orels + 1

if Orels == 8 then -- all Orels dead, activate sub strike
print(" no more orels")
if ScenEdit_GetUnit({Side='Russian Federation', Name='PLARB-955 A [Borey II]',}) ~= nil then
print("Sub still alive")
ScenEdit_AssignUnitToMission('PLARB-955 A [Borey II]', 'Borey II Nuclear Strike on Chitose AB')
print("Sub is dead - end scenario?")

If you want to test it the easiest way to do that is in the lua console, but for that to work you would need to put:
at the top so it doesn't stop on errors.

Other things:
the soryu mission is an ASuW - Mixed role, which means it wants to go attack the russian base. I'm not sure if you really want it on an ASuW patrol? maybe it should be ASW?

Nothing really happened for me, it said we were at war, I found both subs and killed them in the first hour or so, at which time it ended as your Event ends the scenario if EITHER trigger fires, which I don't think is what you want.

I looked at the russian side and some of the bombers weren't going to be ready for 20 hours which seems like a long time.

The TU-160s won't launch cause you have them on an Air Intercept mission - which isn't going to work, needs to be an a Land Strike I would think.

Whicker -> RE: "Baptism of Fire" scenario for testing (1/20/2019 8:00:30 PM)

As for scoring, that is all up to you to decide what unit is worth what. You can do it with multiple events with unit destroyed triggers and actions that change the score, or use a lua event to do it as I have written about here (recently updated):


#2 and #7 can probably be rolled into one event - to check every 5 minutes if the bombers are all dead and the sub is dead, end the game. The code I posted above can probably do that with a bit more work. I think it just needs the end scenario part where I put the print/comment Sub dead, end scenario?

Clockmaster77 -> RE: "Baptism of Fire" scenario for testing (1/20/2019 8:45:40 PM)


Thank you Whicker for your great help! I will soon implement your excellent advices and correct my errors.
1) As for the Borey II, I have just today put it at a right distance for a nuclear SS-N-32 strike on Chitose AB, more than 500 miles away the base, according to database SS-N-32 minimum range.
2) I have changed Borey II nuclear WPN doctrine as "NOT GRANTED" so, if played by Russian side, player can't start an immediate and unstoppable strike on Chitose AB before the Tu-160 strike group is destroyed, giving the japanese the time to find the sub. Then I am actually implementing the script to change the doctrine of the Borey SSBN if the Tu-160 "Orel" strike group is destroyed (And now i know how to do it correctly thank to Whicker)
3) I have given Japan Naval Group 458 an Helicopter capability (6 SH-60K for each of the 2 flagships).
4) I have added Air Tankers.

I wish to thank all the community for the support:
I do other jobs in my life (employee, 3d graphic freelance and writer) and now I feel I'm learning something special (the LUA game scripting) and I promise i will do it with great enthusiasm.
I have many scenarios ideas in my mind, I love this game, so stay tuned [;)]

Clockmaster77 -> RE: "Baptism of Fire" scenario for testing (1/26/2019 11:50:17 AM)

Hi! I'm refining the scenario scripts.
I'm wondering how can I repeat a script execution at regular intervals (for example Every 5 minutes)?
Thanks for the help

DismalPseudoscience -> RE: "Baptism of Fire" scenario for testing (1/26/2019 1:15:09 PM)

Hi Clockmaster,

To repeat script execution at regular intervals, try creating a "regular time" trigger type. That type of trigger could fire every minute, or every second, etc and trigger the Lua script you want in an event. That will probably do what you're looking for. Only thing to be wary of there is to make sure to uncheck the "Show Event In Log" checkbox on the associated event (once you are done debugging it) or else the player will receive a message about the event in the log every time it fires.

To change / create scoring, you need to do two things:
1) In the scenario editor, under the Editor menu, select "Edit Scoring" and put in the scoring thresholds you want to associate with defeat or victory
2) Create scoring events, with triggers like "Unit Destroyed" (if you want to award points for killing certain units) and the action "Points"

Hope some of that is helpful!

Clockmaster77 -> RE: "Baptism of Fire" scenario for testing (1/26/2019 1:27:30 PM)

Thanks a lot! in this weekend i will continue to create my scenario, hopefully I will post a more advanced test version next week.

Clockmaster77 -> RE: "Baptism of Fire" scenario for testing (1/27/2019 2:34:35 PM)

Here the latest TEST version, with many improvements. I have added all the scores.

A) Borey II SSBN doesn't start nuclear strike on Chitose AB when all Tu-160 codename Orel #1..8 are destroyed. Lua script give an error ((ScenEdit_GetUnit 0 : Can't find Unit 'Orel #2' on Side 'Russian Federation'))

here's the script I'm using:
local Orels =0
for i=1,8 do

if ScenEdit_GetUnit({Side='Russian Federation', Name="Orel #"..i,}) == nil then -- verify the unit orel 1,..8 is destroyed
Orels = Orels + 1

if Orels == 8 then -- all Orels dead, activate sub strike
print("Tu-160 Strike Squadron Orel is destroyed")
if ScenEdit_GetUnit({Side='Russian Federation', Name='PLARB-955 A Borey II',}) ~= nil then -- verify Borey II SSBN exists
print("SSBN is still active")
ScenEdit_SetDoctrine({side="Russian Federation", name="PLARB-955 A Borey II"}, {use_nuclear_weapons= "yes" })
ScenEdit_AssignUnitToMission('PLARB-955 A Borey II', 'Borey II Nuclear Strike on Chitose AB')
print("Sub is dead - end scenario?")


B) I have deactivated the end scenario conditions since at the first triggered enemy unit destroyed the scenario ends. So I prefer for now to let it last for 10 hours, then end and give the player the score and loss/expenditure statistics

C) I can't manage how to fire missiles with the SAMS S-400 (for Russia) or Patriots (For Japan).

1) Put the Borey II (and tha Akula) in far east waters outside Japan, distant enough to launch a nuclear strike on Chitose AB. Japan surface and submarine groups have been deployed nearby to allow the player to find it
2) Tu-160 mission now starts, and correctly
3) Su-57 Squadron now has a CAP mission if side is not human (can't escort the tu-160 since mission range is too high)
4) F-23A has CAP mission if side is not human
5) Scoring events are nearly complete (complete for all mission-important targets)

future plans:
1) resolve lua script problem for Borey II nuclear strike, correct setting of the end-scenario conditions, solve the SAMs "doesn't fire" problem
2) put new modern radars on northern Japan to early detect the Tu-160s (i'm researching which radars will have Japan in near future and where to place them)
3) complete the scoring for non mission-related targets

When these problems are solved i'll publish the scenario here and on Steam Workshop.

Attached the latest test version. Advices are very welcome. Thanks. Enjoy

KnightHawk75 -> RE: "Baptism of Fire" scenario for testing (1/27/2019 11:38:10 PM)

As for problem 'A'
You should get that error when it doesn't exist but your for loop should be continuing the next iterations, unless you're just testing just in the console then it'll stop.

Also maybe try the reverse for detection of the destruction of the orels strike force, instead of checking for == nil and counting to 8, flag when you get one that exists unless you need to know which still exists. Note if trying this in the console makes sure to use Tool_EmulateNoConsole(true) first so that on-error (like a unit not existing) it continues with the script like in-game\trigger\etc.

-- uncomment next line while testing in console
local OrelsAllDead = true;
for i=1,8 do
  if ScenEdit_GetUnit({Side='Russian Federation', Name="Orel #"..i,}) ~= nil then
    --this code will only execute if there is no error, which means object exists.
    --print('Orel ' .. i .. ' still exists!');
    OrelsAllDead = false  -- it only takes one to exist to set the flag.
if OrelsAllDead then
  --rest of code

That said it should work as-is, I'll see if I can see maybe why it's not.

Not sure about problem 'C', are you using something like this and it's failing?
--mode 0 ==autotarget 1==manual mount==mountid on attacker for the weapon you want, weapon==weaponid# on said attacker
--SA400 mount is usually 1856 or 2284; weapon for sa-21b[40N6] 4/4 is 7716 for example, just random examples
--attackerId == string unitname or guid
--contactId == string contactname or guid ..careful using name as it changes as contact gets more identified.
ScenEdit_AttackContact(attackerID, contactId ,{mode='1', mount=1856, weapon=7716, qty=1}) --manually engage with 1 missile of specific type
ScenEdit_AttackContact(attackerID, contactId ,{mode='0'}) --auto engage target

KnightHawk75 -> RE: "Baptism of Fire" scenario for testing (1/28/2019 2:49:55 AM)

re: Problem 'A'
Was not firing because three things in the file(s) given.

1. Event was not active (at least in chains of war version) and repeatable from the start.
2. In the script the name for nuke sub is 'PLARB-955 A Borey II' vs. corrected 'PLARB-955A Borey II' in various places.
3. At the end of the script you didn't mark the mission 'active'.

Attached you will find script you can cut and paste into the action that works how you want I think. Feel free to adjust it as neccessary removing print statements or not disabling the event after it runs successfully the first time, etc.

Steps to test:
-Load scenario in editor
-Choose russia, set the checking event 'Check if to assign borey....' to Repeatable and Active.
(it should be set that way from the start of scenario, or set maybe after you trigger the launch of the bombers..up to you)

..play.. or let it run till all 8 Orel bombers launch.
..delete orels manually, or get them all destroyed.
..wait up to 30 seconds and watch the nukes get launched from the Borey II.
Upon this you can check (if my script is not modified) in the event editor now that the checking event itself is now disabled so it doesn't keep running necessarily after it did it's job.

BTW - S400's, with the radars active (they were inactive by doctrine upon startup) it did get a shot or two off (on their own) at the f-23's. Keep in mind the s400's have to use their own radar to acquire\paint\dlz etc of the enemy for missile launch, they can't use the mainstay's tracking.

KnightHawk75 -> RE: "Baptism of Fire" scenario for testing (1/28/2019 5:18:13 AM)

Other things I noticed.
-Russian su-57 cap fighters seemed bugged on takeoff - they get stuck in some immediate engage offensive loop till changing the mission settings to not investigate contacts outside of patrol; or till I setup a prosecution zone, not sure what causes that.

-Patriot sites are all tided\grouped to airbase, not sure you want to do that, makes setting orientation of the radars screwy among some other things.
Either way though the radars were not on, like the s400's on russia side, may be why you don't get missile launches?
Though Patriot's aren't going to intercept the ss-n-32's (you may not be intending that), too fast, would need multiple thadd, aegis ashore or ship board variants that have anti-ballistic interceptors for those and any shot at even remotely taking out 96 inbound warheads.

Clockmaster77 -> RE: "Baptism of Fire" scenario for testing (2/3/2019 5:54:23 PM)

Many many thanks. I'm refining the script now. Let you know when the scenario will be updated.[:)]

Clockmaster77 -> RE: "Baptism of Fire" scenario for testing (2/10/2019 10:04:56 PM)

Hi! I'm continuing to develop the scenario.

1) Added northern Japanese radar net (J-FPS5 radars on Wakkanai, Abashiri, Nemuro, Tobetsu, Emori, Okushiri, and Ominato) I've found this sites on the internet ( http://jsw.newpacificinstitute.org/?p=4011 ). I've opted for J-FPS5 radar beacause the scenario is set in the future, and in a very dangerous environment. Radars are not data-linked with them and with the patriot stations since I can't manage how to add datalinks from graphic interface, and more over I don't know which datalink i should select. Maybe someone will help me out?
2) Added 1 Podsolnukh radar transmitter and 1 receiver in Kamchatska Peninsula, and another transmitter and receiver in the Sakhalin Island near the sea of Japan, after another brief research on the internet. I don't post the link since about me the news doesn't come from a reliable web journal, and I don't like fake news. Nevertheless I have decided to add the radars in these locations for fictional purposes (because I do fiction) and even because the scenario is setted in the future.
I have grouped transmitter and receiver for both (2 groups), but I fear i must datalink them too (how to and which datalink? please enlighten me... [&o])
3) added two escort F-35 for Japanese Kc-767 and grouped with him, setted Home Base: Chitose AB
4) added two F-35 with internal MK-82 LGB (internal) in SEAD mission against Kuril Islands S-400 stations, Home Base: Chitose AB
. Ungrouped Patriots Groups from Chitose AB
. Ungrouped S-400 Groups from Petropavlosk-Kamchatsky AB

6) I have LIT the RADARS of all the S-400 and of all the Patriots, ignoring EMCOM settings, HOPING NOW THEY WILL HUNT DOWN ENEMY TARGETS [8D]
7) I have simulated the Borey II nuclear attack from editor and the submarine position is right for the attack (the Sub also autonomously targeted two coastal radar, and 2 Bulava failed to work! Fantastic!) Now I must "only" test the excellent KnightHawk75's script after the Tu-160 squadron destruction and hope I will make it work.

8)I have created "fancy" debriefing for Japan and Russia, "fancy" because they use a bit of stereotyped language [:D]
Here another problem;
for example, as for Japan Victory debriefing, i've setted an Event where the subsequent triggers must be contemporarily be TRUE:
Chitose Runways are "alive"
Chitose AB surface Bunkers are "alive"
Chitose AB Avio Gas Bunkers are "alive"
Borey II Submarine is destroyed
Russian Tu-160 Strike Force Orel #1..8 is destroyed

The problem is even the same, is present a bit-LOGIC system in the Command Events? I say, I want

Chitose Runways are "alive" AND
Chitose AB surface Bunkers are "alive" AND
Chitose AB Avio Gas Bunkers are "alive" AND
Borey II Submarine is destroyed AND
Russian Tu-160 Strike Force Orel #1..8 is destroyed

but actually it seems to be present only

Chitose Runways are "alive" OR
Chitose AB surface Bunkers are "alive" OR
Chitose AB Avio Gas Bunkers are "alive" OR
Borey II Submarine is destroyed OR
Russian Tu-160 Strike Force Orel #1..8 is destroyed

in the meaning that it is sufficient that one trigger is TRUE and the debriefing message starts. I don't want that! I'm obliged to use LUA also for such a simple task?[X(]

I will post other scenario news in the next week: I wish to let the script work and to add some patriot stations on northern Japan to make the Tu-160 work a bit more difficult. Today I will not attach new scenario files, please wait until further refining, within the week i wil post new test files.
stay tuned!

Clockmaster77 -> RE: "Baptism of Fire" scenario for testing (2/13/2019 1:53:11 PM)

Bump: Some advices especially on point 8)?

KnightHawk75 -> RE: "Baptism of Fire" scenario for testing (2/13/2019 9:35:35 PM)

I've not opened up the revised version yet (it's in my queue), is the attachments in the above posts updated?

On point 1 - Not sure what you're going for there with the datalink as even if it had them not sure if would make much difference since patriot and j-fps6, all the j-fps5 would do is help track, it would not be used to illuminate since it's not a fire control radar like the mpq-65 on p-pac2\pac3. I guess I'm wondering what the intent of a 'datalink' there is? I mean you can always just plop the j-fps5 sensor onto the patriot battery, but it will not make it fire at longer than ~90 miles anyway and most the missiles involved top out around 60nm anyway from my memory, and since it's not flagged CEC (we cant do that without hacking db) not sure it would help 'drive' either patriot missiles or any others.

On point 2 - the transmitter is all that is needed, the receiver is just a dummy building\fake from what I understand in playing with them thus far.

On point 8 - I get what you want I think. I'll have to eyeball how you're presently going about it, definitely can be done a couple different ways though, either all in code or with applying multiple conditions to events and bunch of little 'if xyz is alive then return true' type 'conditions' .

I will try and make some time later tonight to load this puppy up and see if I can't help you out with issue 8, and perhaps understand issue 1 better.

KnightHawk75 -> RE: "Baptism of Fire" scenario for testing (2/13/2019 11:04:28 PM)

RE: Point 8.

Since didn't have update scenario to eyeball this should probably work for what I think you want.

Create a single "event condition" lua script for your message event. Paste this as the script for it.
_Change_ the related text for unit names to match what you need. Also if testing inside console add the

--A single condition where we create a few local helper functions before testing our conditions.
--Returns true for the condition when 3 specific units still exist, 1 is destroyed, and 8 specific units ALL are destroyed.
--Tool_EmulateNoConsole(true) -- use only when testing in console so that when units don't exist it continues execution.

--helper function returns true when unit exists.
local function CheckIfUnitExists(name)
local u = ScenEdit_GetUnit({name=name});
if (u ~=nil) then
return true;

--helper function to test group of units with seq names 1-8. returns false upon any of the 8 existing.
local function TestOrelsAllDestroyed()
for i=1,8 do
if ScenEdit_GetUnit({Side='Russian Federation', Name="Orel #"..i,}) ~= nil then
--this code will only execute if there is no error.
--print('Orel ' .. i .. ' still exists');
return false; --..there is no point in trying additional units since at least one exists
return true; --if we get this far all units must not exist or else it would have already returned false.

--basic test that runs
if ( CheckIfUnitExists("myunit 1") == true and CheckIfUnitExists("my unit 2") == true and CheckIfUnitExists(" unit name 3") == true and CheckIfIUnitExists("unit 4") == false) and TestOrelsAllDestroyed() == true then
return true; --returns true for the overall 'event condition'
return false; --returns false for the overall 'event condition'

Clockmaster77 -> RE: "Baptism of Fire" scenario for testing (2/14/2019 3:46:37 AM)

Thank you very much. This evening I'll post new test files so you and the community can check my progresses. Goodbye

Clockmaster77 -> RE: "Baptism of Fire" scenario for testing (2/14/2019 6:32:06 PM)

Here's the latest files. Please note the buggy debriefing messages that will pop up also when a single victory condition is true. still I have not managed to let the Borey II start the attack on Chitose AB with the Lua script.
Anyway many progress are present. I'd like to know the community impressions until now.

Clockmaster77 -> RE: "Baptism of Fire" scenario for testing (2/16/2019 9:18:52 AM)

As For point 8) I see in the scenedit poll the entry for AND/OR operators in the event editor, just the thing I need. I voted for it.

Page: [1]

Valid CSS!

Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI