WifTutorialCollectibles
Overview
The most stateful tutorial in this category. Walks the player through picking up "SpareParts"-labeled collectibles with two successive hint messages, ten seconds apart, triggered by proximity to any such object, and only fully completes once both messages have been shown.
Inheritance
- Inherits from:
MrxTutorial(src/resident/mrxtutorial.lua) β a real corpus module, already documented under Resident Modules, not an opaque native-only engine class despite this file living insrc/vz/. - Imports:
MrxTutorialManager(used βUpdateCurrentTutorial,HideMessage),MrxFactionManager(declared, never referenced anywhere in this fileβs body).
Instance pattern
A subclass of the corpusβs MrxTutorial task-framework base class β self-based lifecycle overrides, not the Inheritable/uGuid object pattern used in resident/. Unusually, nearly all of its state is module-level (shared across instances, singleton-style) rather than per-self:
msg: the current message key βGetMessage()returns this instead of a fixed string, unlike most other tutorials in this category.nCount: index intomsgtable(starts at 1, advances to 2, then beyond triggers completion).bActivated/bMessageShowing: activation/display-state flags.msgtable: the fixed 2-entry array of message keys ("[Tutorial.Collectibles]","[Tutorial.Collectibles2]").eventHandle: the pending hide/end timer handle.uFilter/uEvent: theObjectFilterand its proximity-event handle β reassigned (not re-declaredlocal) each timeSetupActivationCriteriaruns, to support tearing down and re-registering.
Functions
GetMessage()
Returns the module-level msg variable (mutable), not a fixed string.
SetupActivationCriteria(self)
Tears down any previous uEvent; creates an ObjectFilter matching label "SpareParts"; registers an Event.ObjectProximity (filtered objects within 5 units of the player) that calls ShowMessage.
ShowMessage(self)
On the first proximity hit, activates the tutorial (bActivated = true). If activated and no message is currently showing, sets msg = msgtable[nCount], pushes it via MrxTutorialManager.UpdateCurrentTutorial(self, true), and arms a 10-second timer to HideMessage.
HideMessage(self)
Calls MrxTutorialManager.HideMessage(false, "Collectibles"), then advances nCount. Once nCount exceeds 2 (both messages have been shown), arms a final 10-second timer to the fileβs own EndTutorial (bComplete = true). Otherwise, calls SetupActivationCriteria(self) again to wait for the next proximity hit and show the second message.
SetupCompletionCriteria(self)
Empty β no timer-based completion. Completion is entirely driven by the HideMessage/nCount chain above.
EndTutorial(self, bComplete)
Overridden: clears eventHandle and resets bMessageShowing, then calls MrxTutorial.EndTutorial(self, bComplete).
Events
Event.ObjectProximityβ any"SpareParts"-labeled object within 5 units of the player.Event.TimerRelativeβ reused for both the 10-second per-message hide delay and the final pre-completion delay.
Notes for modders
- Trigger key:
"Collectibles". Self-arms via proximity. - The two hint messages are shown 10 seconds apart on the first two proximity triggers; the tutorial only completes for good after both have displayed at least once.
msg,nCount,bActivated,bMessageShowing, andeventHandleare module-level, not per-uGuidβ consistent with this being a singleton tutorial rather than a per-object one.MrxFactionManageris imported but never used anywhere in this file β likely vestigial.- Minor inconsistency spotted:
ShowMessageassigns to a barebResult(nolocal) in one branch, then declares a separate, properly-scopedlocal bResultlater in the same function. Harmless (the first value is never read again) but worth knowing if tracing this functionβs state.