Other ‐ Global Messenger Reference - ow-mods/outer-wilds-unity-wiki GitHub Wiki
Global Messenger Callbacks
Outer Wilds has a built-in global event system called Global Messenger, which you can reference quite easily using the static function:
GlobalMessenger.AddListener("EnterConversation", () => {
// run some callback here that will run when you enter a conversation
});
Sometimes an event call will have arguments associated with them that you'll need to add for your callback to work, and you'll want to plug them into your callback method.
GlobalMessenger<string, bool>.AddListener("DialogueConditionChanged", OnDialogueConditionChanged);
private void OnDialogueConditionChanged(string condition, bool state)
{
// callback
}
You can also fire your own events by using GlobalMessenger.FireEvent("SomeString")
but keep in mind that since events are all strings and not references, you should make sure your event has a unique name that won't accidentally be used by other mods.
For more on how events work in C#, check out the official MSDN documentation:
- Events (C# Programming Guide)
- How to subscribe to and unsubscribe from events (C# Programming Guide)
[!CAUTION] Prefer using C# events, OWEvent, or UnityEvent over GlobalMessenger.
It's very easy to have a typo in the message name, or have the wrong number/type of arguments.
These will cause your messages to fail silently and do nothing instead of throwing an error on build.
The following is a list of known GlobalMessenger callbacks, when they're actually called, and the types associated with the callbacks.
(Note: while I believe this information is complete, I may have potentially missed an event, or have misunderstood when an event is called. If you discover an inaccuracy, please bring it to our attention.)
AlarmTotemTriggered
Fired the first subsequent FixedUpdate step that the player is within a Dreamworld Alarm Totem's line of sight and is visible to the Totem.
AttachPlayerToPoint (OWRigidbody)
Fired when a PlayerAttachPoint tries to keep the player in place.
- OWRigidbody: The attached OWRigidbody of whatever is trying to attach the player.
BigBangHelmetCrack
Fired when the player's helmet is cracked at the end of the game.
BreakPlayerForceAlignment
Fired when the player is no longer aligned with a force volume.
BrokenMapSatellite
Fired when the map satellite that orbits the system is hit hard enough to misalign itself or is destroyed, and the map can no longer be used.
CancelShipIgnition
Fired when the player stops trying to lift off while the ship is landed.
ChangeGUIMode
Fired when the GUI Render Mode is changed.
ConcealFromAlarmTotem
Fired the first time in a loop that the player conceals themselves from a given alarm totem for longer than one second.
CometDestroyed
Fired when the Interloper is destroyed near the end of the loop.
CompleteShipIgnition
Fired when the player successfully lifts off in their ship from a landing state.
DamBroken
Fired when the dam on the Stranger has been destroyed and the floodwaters start to rush through the Stranger.
DeathSequenceComplete
Fired when the player dies in a way that ends the current loop.
DebugWarpVessel
Fired when you press a specific key code (E + U) while debug input is enabled.
DetachPlayerFromPoint
Fired when the player is no longer locked in place by a PlayerAttachPoint.
DialogueConditionChanged (string, bool)
Fired when a temporary condition is changed from a value it did not already have.
- string: name of the condition that was changed
- bool: the value of the condition
DialogueConditionsReset
Fired at the beginning of the time loop when all non-persistent dialogue conditions are reset.
EatMarshmallow (float)
Fired when the player eats a marshmallow.
- float: The amount that the marshmallow has been toasted. 0 is raw, and 0.2 is needed to be able to eat it. 0.7 is a perfectly toasted marshmallow, and 1 or higher is a burnt marshmallow.
EnableBigHeadMode
Fired when the player eats an expired marshmallow, or teleports to the Eye of the Universe on the same cycle that they had eaten one.
EndFastForward
Fired when the player stops dozing off at a campfire.
EndHideAndSeek
Fired when the player finishes talking to the last kid during Hide and Seek.
EndTravelerConversation (float)
Fired when the player stops talking to a traveler.
- float: the amount of time in seconds until the traveler will resume playing music.
EndViewingProjector
Fired when the player stops looking at a projector.
EnterConversation
Fired when the player enters dialogue with an NPC or sign.
EnterCloak
Fired when the player enters a cloaking field (such as the Stranger's, or a New Horizons cloaking field) at the end of the first frame the player enters one.
EnterDarkZone
Fired when the player enters a dark area, such as a cave, where all ambient lights and fog should be disabled.
EnterDreamWorld
Fired when the player enters the Dreamworld by any means.
EnterFlashlightPromptTrigger
Fired whenever the player enters a trigger that causes the Flashlight prompt to appear in the center of the screen.
EnterFlightConsole (OWRigidbody)
Fired when the player enters their ship's pilot seat.
- OWRigidbody: Reference to the ship
EnterLandingMode (ReferenceFrame)
Fired when the player enters Landing View.
- ReferenceFrame: The Reference Frame currently being locked on to, which the ship tries to align to.
EnterLandingView
Fired when the player enters the Landing Cam.
EnterNomaiRemoteCamera
Fired when the player enters a Nomai Projection Pool.
EnterMapView
Fired when the map is opened.
EnterProbePromptTrigger
Fired when the "Launch Scout" prompt should appear.
EnterRemoteFlightConsole (OWRigidbody)
Fired when the player starts controlling Mica's model rocket.
- OWRigidbody: Reference to the model rocket
EnterRoastingMode (Campfire)
Fired when the player starts roasting a marshmallow over the campfire
- Campfire: The Campfire component where the player is roasting the marshmallow.
EnterSatelliteCameraMode
Fired when the `SatelliteCam1 input mode is enabled. A ton of different things listen to this, even interactables that have nothing to do with the satellite (like some DLC components).
EnterSignalscopePromptTrigger (bool)
Fired when the Signalscope prompt appears on the screen.
- bool: Show the "zoom" prompt on screen if the player has not already used the zoom feature. Only the HideAndSeek frequency returns false here, true otherwise.
EnterSignalscopeZoom (Signalscope)
Fired when the Signalscope's zoom feature is used.
- Signalscope: Reference to the Signalscope class instance being used.
EnterShip
Fired when the player enters their ship via the hatch.
EnterShipComputer
Fired when the Ship Computer is activated.
EnterShuttle
Fired when the player enters a Nomai shuttle.
EnterTimeLoopCentral (OWRigidbody)
Fired when something enters the Ash Twin Project.
- OWRigidBody: Reference to the object that used the warp platform
EnterZeroGTraining
Fired when the player gets close enough to the Zero G Cave Mining satellite to trigger the repair notification.
EquipTranslator
Fired when the player pulls up the Translator Tool.
EquipSignalscope (Signalscope)
Fired when the player pulls out their Signalscope.
- Signalscope: Reference to the player's Signalscope tool object
ExitConversation
Fired when the player stops talking to an NPC or sign.
ExitDarkZone
Fired when the player exits a dark area, such as a cave, and re-enables ambient lights and fog.
ExitFlashlightPromptTrigger
Fired whenever the player exits a trigger that causes the Flashlight prompt to appear in the center of the screen.
ExitFlightConsole
Fired when the player is no longer in their ship's pilot seat.
ExitLandingMode
Fired when the player stops using Landing Mode. Called before ExitLandingView.
ExitLandingView
Fired when the player is no longer using the Landing Cam.
ExitNomaiRemoteCamera
Fired when the player disables a Nomai Projection Pool either by walking out of it or removing the projection stone.
ExitMapView
Fired when the map is closed.
ExitProbePromptTrigger
Fired when the "Launch Scout" prompt should disappear.
ExitRemoteFlightConsole
Fired when the player is no longer controlling Mica's model rocket.
ExitRoastingMode
Fired when the player stops roasting a marshmallow over a campfire.
ExitSatelliteCameraMode
Fired when the satellitecam input mode is disabled and normal input is re-enabled.
ExitSignalscopePromptTrigger
Fired when the player gets far enough away from the start of Hide and Seek or pulls out their Signalscope.
ExitSignalscopeZoom
Fired when the Signalscope zoom is no longer being used.
ExitShip
Fired when the player exits their ship via the hatch.
ExitShipComputer
Fired when the player leaves the ship computer and regains control.
ExitShuttle
Fired when the player exits a Nomai shuttle.
ExitTimeLoopCentral (OWRigidbody)
Fired when either the player or the Scout leaves the ATP and thus should now be pushed to the outside of Ash Twin's ash.
- OWRigidbody: Reference to either the player or the scout, depending on what triggered the event
ExitZeroGTraining
Fired when the player leaves the Zero G Cave Mining Satellite area.
EyeStateChanged (EyeState)
Fired when the Eye of the Universe changes state, which it does multiple times during the ending sequence.
- EyeState: An enum representing which state the Eye is in
FakePlayerMeditationDeath
Fired when the player tries to meditate near a Stranger campfire while holding an artifact and they wake up in the Dreamworld.
FinishOpenEyes
Fired when the player opens their eyes.
FinishRepairing
Fired when a Repair Volume is fully repaired.
FlashbackStart
Fired when the end of loop flashback begins.
FlickerOffAndOn (float, float)
Fired when the flashlight plays the flickering animation during the end sequence.
- float: Flicker off duration
- float: Flicker on duration
ForceRetriveProbe (SurveyorProbe)
Fired when the Scout is forcefully recalled and is set to not be retrieved silently (a notification and sound plays)
- SurveyorProbe: Reference to the Scout object
ForceRetriveProbeSilent (SurveyorProbe)
Fired when the Scout is forcefully recalled and is set to be retrieved silently (no notification or sound)
- SurveyorProbe: Reference to the Scout object
GamePaused
Fired when the game is paused.
GamePauseUpdated
Fired when the game's pause state is changed, after GamePaused if applicable.
GameUnpaused
Fired when the game is resumed after being paused.
GhostsAwoken
Fired when a set of Ghost Birds have their AI activated.
GhostKillPlayer
Fired when the player's neck is being snapped by a Ghost Bird.
GraphicSettingsUpdated (GraphicSettings)
Fired whenever the Graphics Settings are adjusted and saved, and when the gamma slider shown on initial startup is changed.
- GraphicSettings: The GraphicSettings object which includes all the relevant settings that have changed.
HelmetHUDActivated
Fired when the HUD appears after putting on your helmet.
IdentifySignal
Fired when the player learns a signal with their Signalscope.
IgnoreMarshmallowCollider (Collider)
Fired when a MarshmallowCollider is created, which tells certain other colliders to not bother to collide with it.
- Collider: The collider used by the MarshmallowCollider
IgnoreProbeCollider
Fired when the Scout's anchor collider is enabled, used to tell certain other colliders to not bother to collide with it.
- Collider: The Scout Anchor collider
InitPlayerForceAlignment
Fired when the player first starts to be aligned by a force volume.
LaunchCodesEntered
Fired when the player enters the Launch Codes into the Timber Hearth Landing Pad elevator.
LaunchProbe (SurveyorProbe)
Fired when the player shoots their Scout out of its launcher.
- SurveyorProbe: Reference to the Scout's object
LearnLaunchCodes
Fired when the player learns the Launch Codes from Hornfels at the end of dialogue.
LighthouseCollapseStageOne
Fired when the tower in the Cinder Isles first gets hit by floodwaters and starts to tilt.
LighthouseCollapseStageTwo
Fired when the tower in the Cinder Isles falls completely over near the end of the loop.
NomaiStatueActivated
Fired when the player obtains the Launch Codes, allowing the museum statue to begin the memory uplink sequence.
MemoryUplinkComplete
Fired when the end of loop flashback is finished.
OnModelRocketShipDestroyed
Fired when Mica's model ship is destroyed by launching it into the sun or Hollow's Lantern (this is the same time the player would be granted the Mica's Wrath achievement, unless it happens during the Supernova).
PlayerBlink
Fired whenever the player closes their eyes.
PlayerCameraBreakLock
Fired when the player is no longer locking onto a celestial object.
PlayerCameraEnterWater (float)
Fired when the player's head enters water
- float: The speed at which the player enters the water
PlayerCameraExitWater
Fired when the player's head leaves water.
PlayerCameraLockOn
Fired when the player starts locking onto a celestial object.
PlayerDeath (DeathType)
Fired when the player dies.
- DeathType: An enum representing how the player died
PlayerDreamWarp
Fired when the player enters a different area in the Dreamworld via a DreamWarpVolume.
PlayerEnterBlackHole
Fired when the player enters a black hole that has an exit white hole, and the player is not inside their ship or a Nomai shuttle.
PlayerEnterBrambleDimension
Fired when the player enters a Dark Bramble node and they weren't already in one.
PlayerEnterGiantsDeep
Fired when the player enters the GDInterior
sector.
PlayerEnterQuantumMoon
Fired when the player successfully enters the Quantum Moon.
PlayerEnterUndertowVolume
Fired when the player enters an Undertow Volume (the underwater currents in the whitewaters on the Stranger).
PlayerEscapedTimeLoop
Fired when the loop ends while the time loop is inactive.
PlayerExitBrambleDimension
Fired when the player leaves a Bramble Dimension and returns to regular space (not when leaving a dimension to go to another dimension)
PlayerExitGiantsDeep
Fired when the player exits the GDInterior
sector.
PlayerExitQuantumMoon
Fired when the player leaves the Quantum Moon.
PlayerExitUndertowVolume
Fired when the player is no longer in an Undertow Volume.
PlayerFogWarp
Fired when the player enters a Dark Bramble Fog Warp volume to transition between nodes. This happens regardless of if the player is flying the ship or not.
PlayerGrabbedByGhost
Fired when the player is grabbed by a Ghost Bird, before they are woken up.
PlayerReleasedByGhost
Fired when a Ghost Bird is no longer holding the player.
PlayerRepositioned
Fired when the player is manually moved, but their rotation does not need to change (use WarpPlayer for that).
PlayerResurrection
Fired when the player death reroutes them into the Dreamworld. Does not count when the player uses meditation at a Stranger campfire.
ProbeEnterQuantumMoon
Fired when the player shoots the scout into the Quantum Moon.
ProbeExitQuantumMoon
Fired when the Scout leaves the Quantum Moon.
ProbeLauncherEquipped (ProbeLauncher)
Fired when the player takes out their Scout.
- ProbeLancher: Reference to the Scout tool object
ProbeLauncherUnequipped (ProbeLauncher)
Fired when the player puts their Scout away.
- ProbeLancher: Reference to the Scout tool object
ProbeSnapshot (ProbeCamera)
Fired when the player takes a snapshot.
- ProbeCamera: Reference to the Scout's camera object
Probe Snapshot Removed
Fired when the Scout's HUD is hidden. Yes, this one has spaces in it.
PutOnHelmet
Fired when the player's helmet is put on.
QuantumMoonChangeState (OWRigidbody)
Fired when the Quantum Moon successfully changes states between one of its six locations.
- OWRigidbody: The Quantum Moon's OWRigidbody
RemoveHelmet
Fired whenever the player's helmet is removed.
RemoveSuit
Fired whenever the player's suit is removed.
ResetSimulation
Fired at the beginning of the first loop, when the player links with the statue and the Solar System is reset.
RestartTimeLoop
Fired when a new loop is started.
ResumeSimulation
Fired when a new loop is started, if the Time Loop itself hasn't already been activated.
ShipCockpitDetached (OWRigidbody)
Fired when the player's ship has its cockpit detached from the main ship, either through ejection or damage.
- OWRigidbody: Reference to the cockpit object
ShipDestroyed
Fired when the player's ship is destroyed in a destruction volume.
ShipEnterQuantumMoon
Fired when the player's ship enters the Quantum Moon.
ShipEnterSpeedLimiiter
Fired when the player's ship is starting to have its speed dampened by a speed limiter volume.
ShipEnterWater (float)
Fired when the ship collides with water.
- float: Relative speed of the ship when it enters the water
ShipExitQuantumMoon
Fired when the player's ship exits the Quantum Moon.
ShipExitSpeedLimiter
Fired when the player's ship is no longer having its speed dampened by a speed limiter volume.
ShipHullBreach
Fired when the ship is broken and the "SHIP HULL BREACH DETECTED" notification appears.
ShipLiftoff
Fired when the player's ship leaves the Timber Hearth landing pad.
ShipLogUpdated
Fired when the player receives a ship log entry.
ShipSystemFailure
Fired when a component of the ship breaks.
StartFastForward
Fired when the player starts to doze off at a campfire.
StartHideAndSeek
Fired when the player starts Hide and Seek with Tephra and Galena.
StartOfTimeLoop (int)
Fired when a new loop starts.
- int: The number of loops since the start of the game
StartPeeping (Peephole)
Fired when the player starts to use a Peephole (the windows on the sides of the surface prison in the Dreamworld, or the windows on the sides of the lantern testing chambers in the Hidden Gorge lab).
- Peephole: The Peephole component that the player is using
StartRepairing
Fired when the player starts interacting with a Repair volume.
StartShipIgnition
Fired when the player attempts to start taking off while the ship has landed.
StartSleepingAtCampfire (bool)
Fired when the player begins dozing off at a campfire
- bool: Whether the campfire is a Stranger campfire
StartTravelerConversation
Fired when the player begins talking to specifically a traveler.
StartVesselWarp
Fired when the player warps the Vessel to the Eye of the Universe.
StartViewingProjector
Fired when the player starts looking at a projector.
StopPeeping (Peephole)
Fired when the player stops using a Peephole (the windows on the sides of the surface prison in the Dreamworld, or the windows on the sides of the lantern testing chambers in the Hidden Gorge lab).
- Peephole: The Peephole component that the player is using
StopRepairing
Fired when the player is no longer repairing a broken component (a Repair Volume has lost focus, or the interact button has been released).
StopSleepingAtCampfire
Fired when the player stops dozing off, either manually or automatically.
StopSleepingAtDreamCampfire
Fired when the player stops dozing off at a Stranger campfire and is not transported to the Dreamworld.
SuitUp
Fired when the player's suit is put on.
SunExploded
Fired when the sun goes supernova.
SwitchActiveCamera (OWCamera)
Fired when the camera used for rendering is changed (such as when switching to the map)
- OWCamera: The camera to switch to
TargetReferenceFrame (ReferenceFrame)
Fired when the player locks onto a celestial body.
- ReferenceFrame: The body that is being locked onto
TakeFirstFlashbackSnapshot
Fired at the start of the loop, when the game takes a picture for the end of loop flashback sequence right after the Hatchling opens their eyes.
TimeLoopInteriorDestroyed
Fired when the ATP gets destroyed by the supernova.
TriggerDeathByDreamworldEscape
Fired when the player ends the game by dying and entering the Dreamworld, getting the "You can't wake up" ending.
TriggerDeathByQuantumMoon
Fired when the player ends the game at the sixth location and gets the "Your journey has reached its end" ending.
TriggerDeathByRingworldEscape
Fired when the player ends the game inside the Stranger and gets the "Lone Inhabitant on an abandoned world" ending.
TriggerDeathByVoid
Fired when the player ends the game by surviving the supernova, getting the "You drift until your ship's supplies are depleted" ending.
TriggerDeathOfReality
Fired when the player ends the game by causing a time paradox, getting the "You destroyed the fabric of spacetime" ending.
TriggerFlashback
Fired when the end-of-loop flashback is told to run.
TriggerMapPromptReminder (bool)
Fired when the "Open Map" prompt appears on screen.
- bool: Whether the condition
MAP_PROMPT_ATTENTION
is true (not entirely sure what this means)
TriggerMemoryUplinkAssetDump
Fired at the start of the museum Nomai statue sequence, one second before TriggerMemoryUplink is fired.
TriggerMemoryUplink
Fired at the start of the museum Nomai statue sequence, once all the assets have had time to load.
TriggerObservatoryMap
Fired when the player interacts with the orrery in the observatory on top of the Timber Hearth museum.
TriggerSupernova
Fired when the SecondRemaining in the loop hits 0 and the supernova begins.
TurnOffFlashlight
Fired when the player's flashlight is turned off.
TurnOnFlashlight
Fired when the player's flashlight is turned on.
UnequipTranslator
Fired when the player puts the Translator Tool away.
UnequipSignalscope
Fired when the player puts the Signalscope away.
UntargetReferenceFrame
Fired when a reference frame (used to lock onto planets) is no longer a target.
UntranslatedTextRemainingNotificationPosted (float)
Fired when the player leaves a group of Nomai text after translating some but not all of it.
- float: The duration in seconds the notification will appear on the screen.
WakeUp
Fired when the player wakes up at the start of the loop (this is tied to how the player reacts when starting the loop).
WarpPlayer
Fired when the player is moved to a specific location with a specified rotation as well. (If the rotation does not need to change, use PlayerRepositioned instead.)