✅ Verified in-game — deeper pass: re-confirmed all 4 functions, the knStatusCaptured=1/knStatusDestroyed=2 constants, and the no-Event.* claim; ran a corpus grep to identify the external callers of OutpostStatusChange (Outpost + MrxTaskObjectiveCaptureOutpost) and cross-linked them.

MrxOutpostManager

Module: mrxoutpostmanager.lua

Overview

The MrxOutpostManager module is responsible for managing outposts in the game world. It provides functionality to register and unregister outposts, as well as handle status changes such as capture or destruction. This module tracks outpost-specific callbacks and executes them when a status change occurs.

Inheritance

  • Inherits from: none — base/utility module
  • Imports: MrxUtil

Instance pattern

This is a stateless manager/utility module (no per-instance tables). It tracks the following key fields:

  • _tOutposts: A table mapping outpost GUIDs to their callback data.

Functions

RegisterOutpost(uOutpost)

Registers an outpost by adding it to the _tOutposts table if it is not already registered. Initializes the outpost with an empty list of callbacks.

UnregisterOutpost(uOutpost)

Unregisters an outpost by removing its entry from the _tOutposts table if it exists.

RegisterOutpostEvent(uOutpost, fCallback, tCallbackArgs)

Registers a callback function for a specific outpost. Ensures the outpost is registered and then adds the callback along with its arguments to the outpost’s list of callbacks.

OutpostStatusChange(uOutpost, nStatus)

Handles a status change for an outpost by executing all registered callbacks associated with that outpost. Logs a debug message for each callback execution. After executing the callbacks, it unregisters the outpost.

Events

None. This file contains no Event.* calls at all — it registers no listeners itself. OutpostStatusChange(uOutpost, nStatus) is a plain function called directly by the outpost’s own scripts: corpus grep confirms the callers are Outpost and MrxTaskObjectiveCaptureOutpost, which invoke it with knStatusCaptured/knStatusDestroyed when an outpost is taken or leveled. This module is a pure callback registry between those and any interested listener (e.g. a mission tracking outpost state).

Notes for modders

  • Use RegisterOutpostEvent to add callbacks that should be executed when an outpost’s status changes.
  • Ensure that outposts are properly registered and unregistered to avoid memory leaks or incorrect behavior.
  • The nStatus parameter in OutpostStatusChange can be used to determine the new state of the outpost; the module itself defines knStatusCaptured = 1 and knStatusDestroyed = 2 as the two known values.
  • Be aware that unregistering an outpost after executing its callbacks is a default behavior; this may need to be adjusted based on specific mod requirements.
  • OutpostStatusChange calls MrxUtil.CallWithOptionalArgs(tCallback.fCallback, {unpack(tCallback.tCallbackArgs), uOutpost, nStatus}) for each registered callback — the callback receives its own registered args first, followed by uOutpost and nStatus.

Back to top

This site uses Just the Docs, a documentation theme for Jekyll.