Helper scripts:
Code: Select all
-- Returns DTG in format: DDHHMMZ MON YY (e.g., 151745Z APR 28)
function DTG(TimeVar)
if TimeVar == nil then TimeVar = ScenEdit_CurrentTime() end
return string.upper(os.date("!%d%H%MZ %b %y", TimeVar))
end
-- ACP-126 Message Formatting Function
function ACP126(rec_station, snd_station, precedence, from, to, classification, body)
local dtg = DTG()
local _, gr = body:gsub("%S+", "") -- Word count
return string.upper(string.format([[
<P><FONT face=Consolas>
%s <BR>
DE %s <BR>
%s %s <BR>
fm %s <BR>
to %s <BR>
wd gr%d <BR>
bt <BR>
%s <BR>
%s <BR>
bt <BR>
nnnn </P>]],
rec_station,
snd_station,
precedence,
dtg,
from,
to,
gr,
classification,
body
))
end
Sample message script:
Code: Select all
--[[
Lua Script: CTG 447.2 (Sentinel Reach) In-Chop Notification (Narrative Aligned)
This script generates and displays an ACP-126 style message to the NATO player
announcing that Task Group Sentinel Reach (CTG 447.2) is now under
CTF 447 operational control and player awareness.
Composition and tasking align with the latest narrative developments.
USVs are omitted from this message as they will be introduced separately.
ASSUMPTIONS:
1. A global function _G.DTG() is available (used by _G.ACP126).
2. A global function _G.ACP126(rec_station, snd_station, precedence, from_line, to_line, classification_line, body_content) is available.
3. ScenEdit_SpecialMessage() is an available C:MO Lua function.
4. This script is triggered at the appropriate time (e.g., January 14th, Noon Zulu Time).
5. The ships and helicopters for CTG 447.2 are assumed to be already spawned
or exist in the scenario with the correct names.
]]
--------------------------------------------------------------------------------
-- MAIN SCRIPT LOGIC: Display CTG 447.2 In-Chop Message
--------------------------------------------------------------------------------
-- Define the side to receive the message (Player's side)
local natoPlayerSideName = "NATO" -- Ensure this matches your player's side name
-- 1. Define parameters for the _G.ACP126 wrapper
-- These are for the ACP126 message header lines.
local acp_rec_station = "ALL NATO TASK FORCES ATLANTIC // CTG 447.2"
local acp_snd_station = "CTF 447 HQ WATCH NR " .. math.random(500, 599) -- From CTF 447 HQ
local acp_precedence = "O" -- IMMEDIATE
-- These parameters will form the 'fm', 'to', and 'classification' lines in the ACP126 header
local acp_from_line = "COMCTF 447"
local acp_to_line = "CTG 447.2 (SENTINEL REACH) <BR> INFO STRIKFORNATO // MARCOM // JFC NORFOLK // USTRANSCOM"
local acp_classification = "SECRET" -- Overall classification for the ACP126 header part
-- 2. Construct the detailed message body.
-- This includes its own DTG, FROM, TO, SUBJ, and CLASSIFICATION for the content.
local message_dtg_for_body = (_G.DTG and _G.DTG()) or "DTG_UNAVAILABLE" -- Use global DTG
local actual_message_body = string.format([[
DTG: %s<BR>
<BR>
FROM: COMCTF 447<BR>
TO: CTG 447.2 (SENTINEL REACH)<BR>
INFO: STRIKFORNATO // MARCOM // JFC NORFOLK // USTRANSCOM // COMLANTFLT<BR>
SUBJ: TASK GROUP ACTIVATION AND IMMEDIATE TASKING - CTG 447.2 (SENTINEL REACH)<BR>
<BR>
CLASSIFICATION: SECRET<BR>
<BR>
1. (S) EFFECTIVE IMMEDIATELY, TASK GROUP (TG) PREVIOUSLY CONDUCTING JOINT ASW EXERCISE IN VACAPES OPAREA IS DESIGNATED CTG 447.2, CALLSIGN "SENTINEL REACH", AND IS ASSIGNED TO CTF 447.<BR>
<BR>
2. (S) CURRENT STATUS: CTG 447.2 IS CURRENTLY LOCATED IN THE VIRGINIA CAPES OPERATING AREA (VACAPES OPAREA).<BR>
<BR>
3. (S) COMPOSITION - CTG 447.2 (SENTINEL REACH):<BR>
FLAGSHIP:<BR>
- <B>USS OSCAR AUSTIN (DDG-79)</B> – ARLEIGH BURKE FLIGHT IIA DESTROYER<BR>
* EMBARKED: 2X MH-60R SEAHAWK (HSM-60 #1, #2) (ASW/ASUW SUITE)<BR>
ESCORT UNITS:<BR>
- <B>USCGC HAMILTON (WMSL-753)</B> – LEGEND-CLASS NATIONAL SECURITY CUTTER<BR>
* EMBARKED: 1X MH-60R SEAHAWK (HSM-60 #4) (ASW/ASUW SUITE)<BR>
* KEY SYSTEMS: TOWED ARRAY SONAR, MK54 TORPEDOES, SONOBUOYS<BR>
- <B>USCGC STONE (WMSL-758)</B> – LEGEND-CLASS NATIONAL SECURITY CUTTER<BR>
* EMBARKED: 1X MH-60R SEAHAWK (HSM-60 #3) (ASW/ASUW SUITE)<BR>
* KEY SYSTEMS: TOWED ARRAY SONAR, MK54 TORPEDOES, SONOBUOYS<BR>
- <B>HMCS ST. JOHN'S (FFH-340)</B> – HALIFAX-CLASS FRIGATE<BR>
* EMBARKED: 1X CH-148 CYCLONE (NO. 423 #2) (FULL ASW SUITE)<BR>
<BR>
4. (S) IMMEDIATE TASKING:<BR>
A. CTG 447.2 IS TO TERMINATE CURRENT EXERCISE SERIALS FORTHWITH.<BR>
B. MAKE BEST SPEED NORTHBOUND TO ESTABLISH RENDEZVOUS WITH TF-83.1 (IRON PIKE).<BR>
C. UPON RENDEZVOUS, PROVIDE DIRECT CLOSE ESCORT AND AREA ASW PROTECTION FOR TF-83.1 DURING ITS TRANSATLANTIC TRANSIT TO EUROPE.<BR>
D. DETAILED RENDEZVOUS COORDINATES AND IRON PIKE ROUTE INFORMATION PROMULGATED VIA SECURE CHANNELS.<BR>
<BR>
5. (S) REMARKS:<BR>
THE SAFE AND TIMELY ARRIVAL OF TF-83.1 IS OF PARAMOUNT STRATEGIC IMPORTANCE, <B>ESPECIALLY GIVEN THE UNPROVOKED RUSSIAN INVASION OF THE BALTIC STATES AND THE ESCALATING THREAT IN THE NORTH ATLANTIC.</B> ALL ASSETS OF CTG 447.2 ARE TO MAINTAIN MAXIMUM VIGILANCE AND READINESS. THE THREAT FROM RFN SUBMARINE FORCES, INCLUDING SUBMARINE-LAUNCHED ANTI-SURFACE MISSILES, IS ASSESSED AS HIGH.<BR>
<BR>
ACKNOWLEDGE RECEIPT.<BR>
<BR>
//SIGNED//VADM E. ROSTOVA//COMCTF 447//<BR>
]], message_dtg_for_body) -- Insert the body's DTG here
-- 3. Generate the fully formatted message using the global _G.ACP126 function
local formatted_chop_message
if _G.ACP126 then
formatted_chop_message = _G.ACP126(
acp_rec_station,
acp_snd_station,
acp_precedence,
acp_from_line,
acp_to_line,
acp_classification,
actual_message_body
)
else
-- Fallback if the global ACP126 function is somehow not available
formatted_chop_message = "CRITICAL ERROR: Global ACP126 function not found! Cannot format CTG 447.2 in-chop message."
end
-- 4. Display the message to the NATO player
if ScenEdit_SpecialMessage then
if formatted_chop_message and string.find(formatted_chop_message, "CRITICAL ERROR") == nil then
ScenEdit_SpecialMessage(natoPlayerSideName, formatted_chop_message)
else
-- Attempt to send a basic error message if formatting failed
ScenEdit_SpecialMessage(natoPlayerSideName, "ERROR: Failed to generate CTG 447.2 (Sentinel Reach) in-chop message. ACP126 formatting function might be missing.")
end
end
-- Script execution completes.