1. Expose g_bAutomaticMode as gosScript variable so ConLobby can check
it at init time. o_load_file.state is set to 3 (disabled/hidden) if
automaticmode != 1 in options.ini. Button is fully visible and active
only when the feature is intentionally enabled.
Rebuild required: MW4.exe (Release + Profile).
2. Remove cur_team_val conditional for team/skin slot assignment.
Previously, only one of o_team[k] or o_skins[k] was set depending on
cur_team_val at click time, but MAIL_SET_ROOKIE_MISSION propagates the
new game type asynchronously -- cur_team_val would not reflect the
file's GameType until the next frame, requiring a second click.
Fix: always set both o_team[k] and o_skins[k] unconditionally. The
mission launch code uses whichever is relevant for the active mode;
the other is harmlessly ignored. No rebuild (script-only).
Script calls callback(CTCL_GetAutoSlotInt, k, 0/1/2/3) where 0-3 are
integer literals. The script engine passes literals as (void*)N directly
(not as pointers), so INTPARM(1) = *((int*)data[1]) dereferences NULL
when field=0, producing the 'Attempt to read from NULL' STOP.
Fix: VALUEPARM(1) = (int)data[1] reads the value without dereferencing.
k (data[0]) remains INTPARM because it is a script variable (passed as
a pointer to the variable's storage, not a literal).
Also add exists(@ConLobbyMission@) guard before MAIL_SET_ROOKIE_MISSION
for defensive safety if the sub-script is not running.
Rebuild required: MW4.exe (Release + Profile).
options.ini [automaticmode] section:
automaticmode=1
automaticfile=c:\path\to\config.ini
Right-click was considered then dropped in favor of a dedicated button
at 467,510 (below Pick Cond., left of Reprint).
C++ (MW4Shell.cpp):
- SAutoFileSlot struct + g_aAutoSlots[16], g_bAutomaticMode, g_szAutomaticFile globals
- [automaticmode] ini read at StartUp
- CTCL_LoadAutoFile: checks file exists, reads [mission] page into existing
g_nRookieXxx globals + [slot0]..[slot15] pages into g_aAutoSlots[]; returns 1 if loaded
- CTCL_GetAutoSlotName(out_str, k): pilot name for slot k
- CTCL_GetAutoSlotMech(out_str, k): mech display name for slot k
- CTCL_GetAutoSlotInt(k, field): Type/Team/Skin/Decal for slot k (fields 0-3)
- Register/unregister all 4 callbacks in StartUp/ShutDown
Script (ConLobby.script):
- o_load_file button at 467, 510
- Handler: CTCL_LoadAutoFile -> if loaded, sends MAIL_SET_ROOKIE_MISSION to
ConLobbyMission (game options), clears all slots, then applies per-slot data
in a loop (pilot names, mech by display-name lookup in allowed_mechs[], team,
skin, decal). USE_ALLOWED_MECHS/non-ALLOWED_MECHS both handled via #if.
File not consumed (stays on disk); external app overwrites for next load.
Rebuild required: MW4.exe (Release + Profile).
MW4Shell.cpp:
- CTCL_DefaultHostSetup (non-coop): replaced hardcoded
Environment.NetworkMaxPlayers=16 with
params->m_maxPlayers + (CTCL_GetTeslaCountAll() - CTCL_GetTeslaCount())
so DirectPlay reserves one extra slot per installed cameraship.
CTCL_GetTeslaCountAll() - CTCL_GetTeslaCount() = camera-only seat count.
- SetNetworkMissionParamater / PLAYER_LIMIT_PARAMETER: applied the same
camera-slot formula when the host changes the player limit at runtime.
Also restored the gos_NetServerCommands(gos_Commend_UpdateMaxPlayers)
call (was accidentally dropped) and the missing break that caused
fall-through into JOIN_IN_PROGRESS_PARAMETER.
- COOP branch: no change (capped at 9+bots; camera seats not needed there).
ConLobby.script:
- Raised the launch-guard cap from nTempPlayerCount > 16 to > 17,
allowing the 17th connection (the cameraship) to not trigger the
'Too many player/bots' error.
Complete disaster-recovery snapshot: engine/game source, game data assets,
VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive.
Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false,
no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.