Files
EscapistsReintroduced/docs/evidence/automatic-launcher-2026-10-04/selected/probe.c.txt
T
jakub 6a667d8deb Capture current mission, AI, map and administration development
Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
2026-10-13 22:52:53 +02:00

40 lines
2.1 KiB
Plaintext

// Private fixture: launch the published Escape entry and observe normal startup.
modded class ArmaReforgerScripted
{
protected bool m_ERRLauncherChecked;
protected bool m_ERRLauncherCompleted;
protected int m_ERRLauncherFailures;
void ERR_LauncherCheck(bool ok, string label)
{
if (!ok) m_ERRLauncherFailures++;
PrintFormat("ERR AUTOMATIC LAUNCHER: pass=%1 check=%2", ok, label);
}
override bool OnGameStart()
{
SCR_MissionHeader header = SCR_MissionHeader.Cast(GetMissionHeader());
if (!m_ERRLauncherChecked && header && header.GetHeaderResourceName() == "{C1E20667DCE324ED}Missions/ERR_Everon.conf")
{
m_ERRLauncherChecked = true;
ERR_LauncherCheck(header.m_sName == "Co10 Escape Reintroduced — Automatic terrain", "Escape-owned launcher header has terrain-neutral title");
ERR_LauncherCheck(GetMissionName() == header.m_sName, "native name callback returns the launcher title");
ERR_LauncherCheck(header.m_sDetails.Contains("No terrain connector"), "launcher includes setup description");
PrintFormat("ERR AUTOMATIC LAUNCHER: initialWorld=%1 name=%2", GetWorldFile(), GetMissionName());
}
return super.OnGameStart();
}
override void OnUpdate(BaseWorld world, float timeslice)
{
super.OnUpdate(world, timeslice);
if (m_ERRLauncherCompleted || !m_ERRLauncherChecked) return;
SCR_MissionHeader header = SCR_MissionHeader.Cast(GetMissionHeader());
if (!header || header.GetHeaderResourceName() != "{469880DFE1B48F95}Missions/Nogova_TerrainTest.conf") return;
ERR_GameMode mode = ERR_GameMode.Get();
if (!mode || mode.Phase() == ERR_Phase.PREPARING) return;
m_ERRLauncherCompleted = true;
ERR_LauncherCheck(mode.Phase() == ERR_Phase.PRISON, "Escape reached its prison phase");
ERR_LauncherCheck(GetWorldFile().Contains("Nogova_Test.ent"), "expected terrain is running");
ERR_LauncherCheck(GetMissionName().Contains("Nogova"), "expected runtime mission name");
PrintFormat("ERR AUTOMATIC LAUNCHER COMPLETE: failures=%1; phase=%2; scenario=%3; world=%4; name=%5", m_ERRLauncherFailures, mode.Phase(), header.GetHeaderResourceName(), GetWorldFile(), GetMissionName());
}
}