Repairpad
Module: repairpad.lua
Overview
The Repairpad module is the tiny lifecycle script for a repair-pad object. Its whole observable job is a light cue: when the pad wakes it briefly clears its LightFront vehicle part, then turns it on to indicate the pad is live; on death/deactivate it clears the light again. It does not itself implement the repairing โ that is engine/vehicle behavior โ it just manages the indicator light and event cleanup.
Inheritance
- Inherits from:
none(base/utility module) - Imports:
MrxTutorialManagerโ imported but not referenced anywhere in this file (vestigial).
Instance pattern
This is a stateless manager/utility module with no per-instance tables. It tracks events associated with each repair pad using the tEvents table, keyed by uGuid.
Functions
OnActivate(uGuid, iArg)
Called when the repair pad instance is activated. Registers tEvents[uGuid].uActivate, an Event.ObjectHibernation handler for {uGuid, "awake"}. Unlike most OnActivate implementations in this codebase, the handler is an inline anonymous function defined right at the call site, not a separate named Awake โ there is no Awake function anywhere in this file. That anonymous function turns off the LightFront vehicle part (Vehicle.SetParts(uGuid, "LightFront", false)) and calls SetupActivationEvents(uGuid).
OnDeactivate(uGuid)
Called when the repair pad instance is deactivated. Deletes all associated events and clears the entry in the tEvents table.
OnDeath(uGuid)
Called when the repair padโs underlying object dies. Turns off the front light and calls OnDeactivate.
SetupActivationEvents(uGuid)
Turns on the front light (Vehicle.SetParts(uGuid, "LightFront", true)). Despite the name, it registers no events โ it is just the โlight onโ step called from the awake handler. The return is stored in the stray global bLightStart (written here and in OnActivate, never read).
Events
Event.ObjectHibernation(inOnActivate) โ fires the inline โawakeโ handler described above, keyed undertEvents[uGuid].uActivatesoOnDeactivatecan find and delete it later.- No other
Event.*calls exist in this file. (A previous revision of this page claimed aHideMarkercustom event โ that string does not appear anywhere inrepairpad.lua; it was not present in source.)
Notes for modders
- The visible lever here is the
"LightFront"Vehicle.SetPartspart โ that named part is the padโs indicator light. If your pad model names the light differently, this script wonโt toggle it. OnDeactivateiteratestEvents[uGuid]withpairsandEvent.Deletes every entry, then clears the table โ so any event you add for a givenuGuidshould be stored in that table to get cleaned up automatically.- There is no repair logic, tunable, or timer in this file โ it is purely the light/event-cleanup shell around the engineโs repair-pad behavior.