New scenario for testing: Operation MI- The Battle of Midway (2025)
Moderator: MOD_Command
New scenario for testing: Operation MI- The Battle of Midway (2025)
Time: Dec 1, 2025 00:000:00
Scenario duration: 3 days
Sides:
Axis (China units) -->Defending Midway
Allies (US units)-->Attacking Midway
Scenario Designer Note: This is a fictional scenario inspired by the historic World War Two Battle of Midway. The scenario pits modern (and hypothetical) Chinese against US forces and hopefully results in an engaging and challenging scenario.
Background:
The Battle of Midway, fought between Allied and Axis fleets in the Pacific Ocean, began on December 1 2025. The Allies had not lost a naval battle in years, and had nearly destroyed the Axis fleet just six months earlier in a surprise attack on Pearl Harbor, Hawaii.
In the 6 months after the devastating strike on Pearl Harbor, the Allies have continued to advance throughout the Pacific. However the Axis has regrouped and is now a growing threat. The Allied and Axis fleets faced off in the Battle of the Coral Sea approximately 1 month ago during which carriers from both sides were sunk. This battle convinced the Allies of the need to destroy the remaining Axis fleet.
Midway Island is a fairly isolated atoll, so named because it is midway between North America and Asia in the North Pacific. Midway is the focus of Operation MI, the Allied plan to smash the Axis resistance to their dominance of the Indo-Pacific. A large Allied carrier strike force followed by an amphibious invasion force is heading towards Midway. The Allies correctly predict that the Axis would consider Midway vital and the invasion would draw out Axis forces, including the carriers. The Allies then plan to defeat the Axis fleet in a decisive battle.
Any feedback is welcomed. I've utilized a lot of LUA (and I'm not even close to a LUA expert) so if there are LUA errors let me know. I'm also particularly interested in others comments on force balance and axis strike and recon missions.
Thanks.
Scenario duration: 3 days
Sides:
Axis (China units) -->Defending Midway
Allies (US units)-->Attacking Midway
Scenario Designer Note: This is a fictional scenario inspired by the historic World War Two Battle of Midway. The scenario pits modern (and hypothetical) Chinese against US forces and hopefully results in an engaging and challenging scenario.
Background:
The Battle of Midway, fought between Allied and Axis fleets in the Pacific Ocean, began on December 1 2025. The Allies had not lost a naval battle in years, and had nearly destroyed the Axis fleet just six months earlier in a surprise attack on Pearl Harbor, Hawaii.
In the 6 months after the devastating strike on Pearl Harbor, the Allies have continued to advance throughout the Pacific. However the Axis has regrouped and is now a growing threat. The Allied and Axis fleets faced off in the Battle of the Coral Sea approximately 1 month ago during which carriers from both sides were sunk. This battle convinced the Allies of the need to destroy the remaining Axis fleet.
Midway Island is a fairly isolated atoll, so named because it is midway between North America and Asia in the North Pacific. Midway is the focus of Operation MI, the Allied plan to smash the Axis resistance to their dominance of the Indo-Pacific. A large Allied carrier strike force followed by an amphibious invasion force is heading towards Midway. The Allies correctly predict that the Axis would consider Midway vital and the invasion would draw out Axis forces, including the carriers. The Allies then plan to defeat the Axis fleet in a decisive battle.
Any feedback is welcomed. I've utilized a lot of LUA (and I'm not even close to a LUA expert) so if there are LUA errors let me know. I'm also particularly interested in others comments on force balance and axis strike and recon missions.
Thanks.
- Attachments
-
- Operation..0251.0.zip
- (611.13 KiB) Downloaded 108 times
RE: New scenario for testing: Operation MI- The Battle of Midway (2025)
Just opened it, looks impressive. Also try to learn from you're lua in the special actions and events.
with regards
with regards
RE: New scenario for testing: Operation MI- The Battle of Midway (2025)
Me newby, but is in the event of points-allies: allies CG Tico destroyed, the class missing at the trigger?
RE: New scenario for testing: Operation MI- The Battle of Midway (2025)
Update Operation MI- The Battle of Midway (2025) 1.01
-removed unused remnant triggers, actions, events from earlier version
-added load out special actions for all MQ-25A
thanks to post by Parel8003
-removed unused remnant triggers, actions, events from earlier version
-added load out special actions for all MQ-25A
thanks to post by Parel8003
- Attachments
-
- Operation..251.01.zip
- (620.31 KiB) Downloaded 20 times
RE: New scenario for testing: Operation MI- The Battle of Midway (2025)
Update Operation MI- The Battle of Midway (2025) 1.02
-updated carrier magazines
-updated carrier magazines
- Attachments
-
- Operation..251.02.zip
- (619.16 KiB) Downloaded 24 times
RE: New scenario for testing: Operation MI- The Battle of Midway (2025)
Update Operation MI- The Battle of Midway (2025) 1.03
-additional carrier magazine updates
-additional carrier magazine updates
- Attachments
-
- Operation ..25) 1.03.zip
- (618.88 KiB) Downloaded 42 times
-
KnightHawk75
- Posts: 1850
- Joined: Thu Nov 15, 2018 7:24 pm
RE: New scenario for testing: Operation MI- The Battle of Midway (2025)
v1.03
Upload loadup:
Lua script execution error: [string "scenario start- update magazines"]:21: attempt to call a nil value (global 'ScenEdit_ClearMagazine'
)
Check LuaAction: "Scenario start-update magazines-axis" The CV Type 002 line should likely be ScenEdit_ClearAllMagazines.
Still looking around, but I like attempts at making it dynamic (some loadout choice pkg, hit X enemy could loses Y,dmg=% of lost comms,etc). Good stuff, suggest clearing the log before release too, easy to forget.
edit:
activate-recon UAV Ford - Event has no associated Action, this may be getting assigned\re-assigned later but having it empty initially causes a gui lock (can't close screen) without putting something in there (I put the action "activate-recon UAV Ford" in there).
"activate-strike ASBM alpha" event has two time triggers, one random, one specific. The specific one is set for 10-10-2025 ~two weeks before the scene (which the Scene Description says is dec 1,2025 btw not September).
edit2:
In the set-reference point script actions, while it may not ultimately matter (ie probably work as they are) the following vars should all be prefaced with "local", otherwise you're setting these globally each time and I'm pretty sure that's not what is intended.
Course you could also just wrap all that into one global function at startup to reuse.
Upload loadup:
Lua script execution error: [string "scenario start- update magazines"]:21: attempt to call a nil value (global 'ScenEdit_ClearMagazine'
)
Check LuaAction: "Scenario start-update magazines-axis" The CV Type 002 line should likely be ScenEdit_ClearAllMagazines.
Still looking around, but I like attempts at making it dynamic (some loadout choice pkg, hit X enemy could loses Y,dmg=% of lost comms,etc). Good stuff, suggest clearing the log before release too, easy to forget.
edit:
activate-recon UAV Ford - Event has no associated Action, this may be getting assigned\re-assigned later but having it empty initially causes a gui lock (can't close screen) without putting something in there (I put the action "activate-recon UAV Ford" in there).
"activate-strike ASBM alpha" event has two time triggers, one random, one specific. The specific one is set for 10-10-2025 ~two weeks before the scene (which the Scene Description says is dec 1,2025 btw not September).
edit2:
In the set-reference point script actions, while it may not ultimately matter (ie probably work as they are) the following vars should all be prefaced with "local", otherwise you're setting these globally each time and I'm pretty sure that's not what is intended.
Code: Select all
minVarlat=-15
maxVarlat=15
varlat=math.random(minVarlat, maxVarlat)/10
minVarlon=-10
maxVarlon=10
varlon=math.random(minVarlon, maxVarlon)/10Course you could also just wrap all that into one global function at startup to reuse.
Code: Select all
-- included in a startup script that runs before anything else--
function gGetLatLonVariation(min1,max1,min2,max2)
math.randomseed(os.clock() + os.time());
local varlat = math.random(min1, max1)/10;
local varlon = math.random(min2, max2)/10;
return varlat,varlon;
end
--
--replacement line in set reference point scripts. avoiding duplicate code.
local varlat,varlon = gGetLatLonVariation(-15,15,-10,10)
--print(varlat ..' , '.. varlon);-
KnightHawk75
- Posts: 1850
- Joined: Thu Nov 15, 2018 7:24 pm
RE: New scenario for testing: Operation MI- The Battle of Midway (2025)
v1.03
SA: Sabotage attack on Hawaii OTH radar SA.
The action is marked repeatable I'm assuming that's maybe intentional (or just for dev-testing) since it's 50/50 on being successful for -100 points.
That said it will never actually be successful because...This will never run because myunit will always be nil (unless you have some global 'myunit var' which you shouldn't and don't), as you didn't assign it anything first (ie getunit() ), also the success message will be displayed even though it failed.
Corrected script:SA: Cyber attack on Axis satellite communications network:
minor: add 'local a;' as the top line, (or local a = .... in line 1) otherwise you're using\creating a global var.
Also consider using a global function created at startup to reduce all the duplicate code or even just a local function at the top of the SA.
SA: Sabotage attack on Hawaii OTH radar SA.
The action is marked repeatable I'm assuming that's maybe intentional (or just for dev-testing) since it's 50/50 on being successful for -100 points.
That said it will never actually be successful because...
Code: Select all
if a==1 then
--success
ScenEdit_SpecialMessage('Allies','Mission success: the Special Forces team has destroyed the Hawaii OTH radar')
if myunit ~= nil then
ScenEdit_DeleteUnit({side="Axis", guid='2QQSQX-0HM2T33SUEIOB'})
end
Corrected script:
Code: Select all
local a=ScenEdit_GetScore("Allies") -- a corrected to local var.
ScenEdit_SetScore('Allies',(a-100),'-100 Points')
a=math.random(1,2)
if a==1 then
--success
local myunit = ScenEdit_GetUnit({guid='2QQSQX-0HM2T33SUEIOB'}) --get the unit first into a local var.
if myunit ~= nil then -- now check it.
ScenEdit_DeleteUnit({guid=myunit.guid}); --remove unit then message after it succeeds.
ScenEdit_SpecialMessage('Allies','Mission success: the Special Forces team has destroyed the Hawaii OTH radar')
end
else then
--failure
ScenEdit_SpecialMessage('Allies','Mission failure: the Special Forces team have been killed and/or captured and were not able to destroy the Hawaii OTH radar');
end
minor: add 'local a;' as the top line, (or local a = .... in line 1) otherwise you're using\creating a global var.
Also consider using a global function created at startup to reduce all the duplicate code or even just a local function at the top of the SA.
Code: Select all
--in global startup script--
--preface function with local for one only available in the SA itself.
function gSetUnitOutOfComms(unitguid,value) -- parameters string unitguid, bool value.
if ((unitguid ~='') and unitguid ~= nil) and ((value ~= nil) and type(value) == 'boolean') then
local myunit = ScenEdit_GetUnit({guid = unitguid});
if myunit ~= nil then
print('original value: ' .. tostring(myunit.outOfComms)); --check current value
if myunit.outOfComms ~= value then --only flip it if it needs flipping.
ScenEdit_SetUnit( {guid=myunit.guid, OUTOFCOMMS=value} ); --engage out-of-comms
print('new value: ' .. tostring(myunit.outOfComms)); --check updated value
end
end
else
print('gSetUnitOutOfComms() error missing guid parameter or boolean value');
end
end
-- end of function
--How to use in the SA and\or other scripts to call\use above function
gSetUnitOutOfComms('2QQSQX-UNITGUIDHERE1',true); --this way all those if then's just become 1 line per unit.
gSetUnitOutOfComms('2QQSQX-UNITGUIDHERE2',true); --as you can see this saves a ton of lines.
--etc..
gSetUnitOutOfComms('2QQSQX-UNITGUIDHEREX',false);
RE: New scenario for testing: Operation MI- The Battle of Midway (2025)
Thanks KnightHawk for you input.
I made the LUA corrections you suggested. I haven't added the global functions yet as the current LUA for this while cumbersome does work. But your script is much better and I will change this at a later date.
As for the "activate-strike ASBM alpha", I intended there to be 2 triggers. My intention is that the either trigger would run the event. Is it not best to have 2 triggers for the same event? Regardless I separated them into 2 events. The time trigger DF-26 is supposed to be set later than the scenario time so that it doesn't run unless that trigger is changed. The trigger is changed to an appropriate time by the action SetTrigger-time trigger DF-26 which is triggered when an H-6J is launched (event=coordinate-strike ASBM alpha with H-6J strike). This resets the time trigger DF-26 to "coordinate" with the H-6J strike. This is my attempt to use LUA as a time trigger. I'm not sure it's working correctly with the DF-26.
But I also use this method of time trigger for the J-15 and J-16 strikes to change their loadouts back to AAW after the strike. I'm pretty sure it works for these.
I changed the scenario time to match the time in the scenario title & description.
The special actions are supposed to be one time only but I'm keeping them repeatable for now for testing purposes.
I cleared the logs. Is there a LUA script I can use to clear them every time at when the scenario is loaded?
I made the LUA corrections you suggested. I haven't added the global functions yet as the current LUA for this while cumbersome does work. But your script is much better and I will change this at a later date.
As for the "activate-strike ASBM alpha", I intended there to be 2 triggers. My intention is that the either trigger would run the event. Is it not best to have 2 triggers for the same event? Regardless I separated them into 2 events. The time trigger DF-26 is supposed to be set later than the scenario time so that it doesn't run unless that trigger is changed. The trigger is changed to an appropriate time by the action SetTrigger-time trigger DF-26 which is triggered when an H-6J is launched (event=coordinate-strike ASBM alpha with H-6J strike). This resets the time trigger DF-26 to "coordinate" with the H-6J strike. This is my attempt to use LUA as a time trigger. I'm not sure it's working correctly with the DF-26.
But I also use this method of time trigger for the J-15 and J-16 strikes to change their loadouts back to AAW after the strike. I'm pretty sure it works for these.
I changed the scenario time to match the time in the scenario title & description.
The special actions are supposed to be one time only but I'm keeping them repeatable for now for testing purposes.
I cleared the logs. Is there a LUA script I can use to clear them every time at when the scenario is loaded?
RE: New scenario for testing: Operation MI- The Battle of Midway (2025)
Update Operation MI- The Battle of Midway (2025) 1.04
-above described updates. Thanks to KnightHawk75
-above described updates. Thanks to KnightHawk75
- Attachments
-
- Operation..251.04.zip
- (978.68 KiB) Downloaded 95 times
-
KnightHawk75
- Posts: 1850
- Joined: Thu Nov 15, 2018 7:24 pm
RE: New scenario for testing: Operation MI- The Battle of Midway (2025)
You can have two triggers on same event, it just seemed usual given the time used in one of them which is why I asked, but what you said makes sense since it's getting updated later. As for a function to I can use to clear the logs, don't think there is one, just via gui.
Thanks for the updates.
Thanks for the updates.
RE: New scenario for testing: Operation MI- The Battle of Midway (2025)
This scenario won't open Error You have (explicitly or implicitly) attempted to load a database that does not exist on the DB folder.
What database did you use to create the scenario and where do I locate said database? Thanks.
What database did you use to create the scenario and where do I locate said database? Thanks.
- BeirutDude
- Posts: 2811
- Joined: Sat Apr 27, 2013 9:44 am
- Location: Jacksonville, FL, USA
RE: New scenario for testing: Operation MI- The Battle of Midway (2025)
Also probably also created with the Build 11 BETA. [8D]
"Some people spend an entire lifetime wondering if they made a difference. The Marines don't have that problem."
PRESIDENT RONALD REAGAN, 1985
I was Navy, but Assigned TAD to the 24th MAU Hq in Beirut. By far the finest period of my service!
PRESIDENT RONALD REAGAN, 1985
I was Navy, but Assigned TAD to the 24th MAU Hq in Beirut. By far the finest period of my service!
RE: New scenario for testing: Operation MI- The Battle of Midway (2025)
Yes, it’s with the newest beta build. I always update to these and didn’t think about the fact that it could be an issue. So I guess this scenario will only work for those who also update to the this beta.
ORIGINAL: BeirutDude
Also probably also created with the Build 11 BETA. [8D]
- BeirutDude
- Posts: 2811
- Joined: Sat Apr 27, 2013 9:44 am
- Location: Jacksonville, FL, USA
RE: New scenario for testing: Operation MI- The Battle of Midway (2025)
Yes, it’s with the newest beta build. I always update to these and didn’t think about the fact that it could be an issue. So I guess this scenario will only work for those who also update to the this beta.
I didn't think about it either. I usually build them with the latest "Official" database and Build, but the one I'm working on right now I had to use the Beta due to an issue with Cargo that was resolved in the Beta. Thus I didn't think about it myself.
"Some people spend an entire lifetime wondering if they made a difference. The Marines don't have that problem."
PRESIDENT RONALD REAGAN, 1985
I was Navy, but Assigned TAD to the 24th MAU Hq in Beirut. By far the finest period of my service!
PRESIDENT RONALD REAGAN, 1985
I was Navy, but Assigned TAD to the 24th MAU Hq in Beirut. By far the finest period of my service!
-
KnightHawk75
- Posts: 1850
- Joined: Thu Nov 15, 2018 7:24 pm
RE: New scenario for testing: Operation MI- The Battle of Midway (2025)
I think beta 1147.9 and up have auth for db487.
I never think about it either cause I'm always trying out the new goodies and forget to swap it back (lower) when building testcases and stuff unless I'm conscious of it or think a db issue is involved.
I never think about it either cause I'm always trying out the new goodies and forget to swap it back (lower) when building testcases and stuff unless I'm conscious of it or think a db issue is involved.
RE: New scenario for testing: Operation MI- The Battle of Midway (2025)
Thankyou. Where exactly do I find the beta build?
-
KnightHawk75
- Posts: 1850
- Joined: Thu Nov 15, 2018 7:24 pm
RE: New scenario for testing: Operation MI- The Battle of Midway (2025)
On the main\default section of the CMO forums, the most recent beta built is usually\always pinned at the top in the first couple listed.
https://www.matrixgames.com/forums/tm.asp?m=4889956
https://www.matrixgames.com/forums/tm.asp?m=4889956
RE: New scenario for testing: Operation MI- The Battle of Midway (2025)
I have the 2 following error in the exception.log:
1/28/2021 7:27:39 PM -- B1147.16 -- [string "fighter sweeps and recon-SetReferencePoints"]:8: <name> expected near '('
Exception: [string "fighter sweeps and recon-SetReferencePoints"]:8: <name> expected near '('
Stack Trace: at NLua.Lua.ThrowExceptionFromError(Int32 oldTop)
at NLua.Lua.DoString(String chunk, String chunkName)
at Command_Core.Lua.LuaSandBox.RunScript(String str, Boolean RunInteractively, String script)
at .ˆ.(Scenario , SimEvent )
Call Stack & Error details:
Error at 101316,
1/28/2021 7:27:39 PM -- B1147.16 -- [string "Scenario start-initial comms setttings"]:65: attempt to index a nil value (local 'myunit')
Exception: [string "Scenario start-initial comms setttings"]:65: attempt to index a nil value (local 'myunit')
Stack Trace: at NLua.Lua.ThrowExceptionFromError(Int32 oldTop)
at NLua.Lua.DoString(String chunk, String chunkName)
at Command_Core.Lua.LuaSandBox.RunScript(String str, Boolean RunInteractively, String script)
at .ˆ.(Scenario , SimEvent )
Call Stack & Error details:
Error at 101316,
1/28/2021 7:27:39 PM -- B1147.16 -- [string "fighter sweeps and recon-SetReferencePoints"]:8: <name> expected near '('
Exception: [string "fighter sweeps and recon-SetReferencePoints"]:8: <name> expected near '('
Stack Trace: at NLua.Lua.ThrowExceptionFromError(Int32 oldTop)
at NLua.Lua.DoString(String chunk, String chunkName)
at Command_Core.Lua.LuaSandBox.RunScript(String str, Boolean RunInteractively, String script)
at .ˆ.(Scenario , SimEvent )
Call Stack & Error details:
Error at 101316,
1/28/2021 7:27:39 PM -- B1147.16 -- [string "Scenario start-initial comms setttings"]:65: attempt to index a nil value (local 'myunit')
Exception: [string "Scenario start-initial comms setttings"]:65: attempt to index a nil value (local 'myunit')
Stack Trace: at NLua.Lua.ThrowExceptionFromError(Int32 oldTop)
at NLua.Lua.DoString(String chunk, String chunkName)
at Command_Core.Lua.LuaSandBox.RunScript(String str, Boolean RunInteractively, String script)
at .ˆ.(Scenario , SimEvent )
Call Stack & Error details:
Error at 101316,
