Skip to content

Verify GUI and hook lifecycle on dedicated servers and repeated mission loads #28

Description

@user01010111

There are a couple of lifecycle assumptions that may be worth checking on a dedicated server and when loading more than one mission in the same game process.

RmAscSettings.initGui() runs when the file is sourced and immediately reads g_inGameMenu.pageSettings. It checks whether pageSettings exists, but not whether g_inGameMenu itself is available. If a dedicated server does not initialize that GUI global, the mod may fail while loading.

Several other registrations run whenever a mission starts:

  • The three custom dialogs are registered.
  • Menu integration is initialized.
  • Vehicle detection is initialized.
  • PlayerInputComponent.registerGlobalPlayerActionEvents is wrapped.
  • Menu methods such as updateMenuButtons, setVehicle, and setPlaceable are wrapped.
  • The input action is added to Gui.NAV_ACTIONS.

deleteMap() removes the console commands and clears capacity data, but it does not undo those registrations. If FS25 can start a second mission without restarting the process, the wrappers and navigation action may be installed more than once.

I have not reproduced a crash or duplicate callback in-game, so this should be treated as an investigation rather than a confirmed defect.

Suggested checks:

  1. Start the mod on a dedicated server and load a save.
  2. Confirm that loading does not depend on client GUI globals.
  3. Return to the menu and load another save without restarting the game.
  4. Check for duplicated menu buttons, input actions, callbacks, or log entries.
  5. Repeat the second-mission test as both a single-player host and a multiplayer client.

If either case exposes a problem, likely directions would be to keep GUI setup on clients, make initialization idempotent, and clean up or avoid reinstalling global hooks between missions.

Relevant code:

  • scripts/RmAscSettings.lua: initGui and the source-time initialization
  • scripts/RmAdjustStorageCapacity.lua: onMissionStarted and deleteMap
  • scripts/RmMenuIntegration.lua: init, initWorkshopScreen, and initPlaceableInfoDialog

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions