-
Notifications
You must be signed in to change notification settings - Fork 0
Other ‐ Global Messenger Reference
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.)
Fired every FixedUpdate step that the player is within a Dreamworld Alarm Totem's line of sight and is visible to the Totem.
Fired when a PlayerAttachPoint tries to keep the player in place.
- OWRigidbody: The attached OWRigidbody of whatever is trying to attach the player.
Fired when the player's helmet is cracked at the end of the game.
Fired when the player is no longer aligned with a force volume.
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.
Fired when the player stops trying to lift off while the ship is landed.
Fired when the GUI Render Mode is changed.
Fired the first time in a loop that the player conceals themselves from a given alarm totem for longer than one second.
Fired when the Interloper is destroyed near the end of the loop.
Fired when the player successfully lifts off in their ship from a landing state.
Fired when the dam on the Stranger has been destroyed and the floodwaters start to rush through the Stranger.
Fired when the player dies in a way that ends the current loop.
Fired when you press a specific key code (E + U) while debug input is enabled.
Fired when the player is no longer locked in place by a PlayerAttachPoint.
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
Fired at the beginning of the time loop when all non-persistent dialogue conditions are reset.
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.
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.
Fired when the player stops dozing off at a campfire.
Fired when the player finishes talking to the last kid during Hide and Seek.
Fired when the player stops talking to a traveler.
- float: the amount of time in seconds until the traveler will resume playing music.
Fired when the player stops looking at a projector.
Fired when the player enters dialogue with an NPC or sign.
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.
Fired when the player enters a dark area, such as a cave, where all ambient lights and fog should be disabled.
Fired when the player enters the Dreamworld by any means.
Fired whenever the player enters a trigger that causes the Flashlight prompt to appear in the center of the screen.
Fired when the player enters their ship's pilot seat.
- OWRigidbody: Reference to the ship
Fired when the player enters Landing View.
- ReferenceFrame: The Reference Frame currently being locked on to, which the ship tries to align to.
Fired when the player enters the Landing Cam.
Fired when the player enters a Nomai Projection Pool.
Fired when the map is opened.
Fired when the "Launch Scout" prompt should appear.
Fired when the player starts controlling Mica's model rocket.
- OWRigidbody: Reference to the model rocket
Fired when the player starts roasting a marshmallow over the campfire
- Campfire: The Campfire component where the player is roasting the marshmallow.
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).
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.
Fired when the Signalscope's zoom feature is used.
- Signalscope: Reference to the Signalscope class instance being used.
Fired when the player enters their ship via the hatch.
Fired when the Ship Computer is activated.
Fired when the player enters a Nomai shuttle.
Fired when something enters the Ash Twin Project.
- OWRigidBody: Reference to the object that used the warp platform
Fired when the player gets close enough to the Zero G Cave Mining satellite to trigger the repair notification.
Fired when the player pulls up the Translator Tool.
Fired when the player pulls out their Signalscope.
- Signalscope: Reference to the player's Signalscope tool object
Fired when the player stops talking to an NPC or sign.
Fired when the player exits a dark area, such as a cave, and re-enables ambient lights and fog.
Fired whenever the player exits a trigger that causes the Flashlight prompt to appear in the center of the screen.
Fired when the player is no longer in their ship's pilot seat.
Fired when the player stops using Landing Mode. Called before ExitLandingView.
Fired when the player is no longer using the Landing Cam.
Fired when the player disables a Nomai Projection Pool either by walking out of it or removing the projection stone.
Fired when the map is closed.
Fired when the "Launch Scout" prompt should disappear.
Fired when the player is no longer controlling Mica's model rocket.
Fired when the player stops roasting a marshmallow over a campfire.
Fired when the satellitecam input mode is disabled and normal input is re-enabled.
Fired when the player gets far enough away from the start of Hide and Seek or pulls out their Signalscope.
Fired when the Signalscope zoom is no longer being used.
Fired when the player exits their ship via the hatch.
Fired when the player leaves the ship computer and regains control.
Fired when the player exits a Nomai shuttle.
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
Fired when the player leaves the Zero G Cave Mining Satellite area.
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
Fired when the player tries to meditate near a Stranger campfire while holding an artifact and they wake up in the Dreamworld.
Fired when the player opens their eyes.
Fired when a Repair Volume is fully repaired.
Fired when the end of loop flashback begins.
Fired when the flashlight plays the flickering animation during the end sequence.
- float: Flicker off duration
- float: Flicker on duration
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
Fired when the Scout is forcefully recalled and is set to be retrieved silently (no notification or sound)
- SurveyorProbe: Reference to the Scout object
Fired when the game is paused.
Fired when the game's pause state is changed, after GamePaused if applicable.
Fired when the game is resumed after being paused.
Fired when a set of Ghost Birds have their AI activated.
Fired when the player's neck is being snapped by a Ghost Bird.
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.
Fired when the HUD appears after putting on your helmet.
Fired when the player learns a signal with their Signalscope.
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
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
Fired when the player first starts to be aligned by a force volume.
Fired when the player enters the Launch Codes into the Timber Hearth Landing Pad elevator.
Fired when the player shoots their Scout out of its launcher.
- SurveyorProbe: Reference to the Scout's object
Fired when the player learns the Launch Codes from Hornfels at the end of dialogue.
Fired when the tower in the Cinder Isles first gets hit by floodwaters and starts to tilt.
Fired when the tower in the Cinder Isles falls completely over near the end of the loop.
Fired when the player obtains the Launch Codes, allowing the museum statue to begin the memory uplink sequence.
Fired when the end of loop flashback is finished.
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).
Fired whenever the player closes their eyes.
Fired when the player is no longer locking onto a celestial object.
Fired when the player's head enters water
- float: The speed at which the player enters the water
Fired when the player's head leaves water.
Fired when the player starts locking onto a celestial object.
Fired when the player dies.
- DeathType: An enum representing how the player died
Fired when the player enters a different area in the Dreamworld via a DreamWarpVolume.
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.
Fired when the player enters a Dark Bramble node and they weren't already in one.
Fired when the player enters the GDInterior
sector.
Fired when the player successfully enters the Quantum Moon.
Fired when the player enters an Undertow Volume (the underwater currents in the whitewaters on the Stranger).
Fired when the loop ends while the time loop is inactive.
Fired when the player leaves a Bramble Dimension and returns to regular space (not when leaving a dimension to go to another dimension)
Fired when the player exits the GDInterior
sector.
Fired when the player leaves the Quantum Moon.
Fired when the player is no longer in an Undertow Volume.
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.
Fired when the player is grabbed by a Ghost Bird, before they are woken up.
Fired when a Ghost Bird is no longer holding the player.
Fired when the player is manually moved, but their rotation does not need to change (use WarpPlayer for that).
Fired when the player death reroutes them into the Dreamworld. Does not count when the player uses meditation at a Stranger campfire.
Fired when the player shoots the scout into the Quantum Moon.
Fired when the Scout leaves the Quantum Moon.
Fired when the player takes out their Scout.
- ProbeLancher: Reference to the Scout tool object
Fired when the player puts their Scout away.
- ProbeLancher: Reference to the Scout tool object
Fired when the player takes a snapshot.
- ProbeCamera: Reference to the Scout's camera object
Fired when the Scout's HUD is hidden. Yes, this one has spaces in it.
Fired when the player's helmet is put on.
Fired when the Quantum Moon successfully changes states between one of its six locations.
- OWRigidbody: The Quantum Moon's OWRigidbody
Fired whenever the player's helmet is removed.
Fired whenever the player's suit is removed.
Fired at the beginning of the first loop, when the player links with the statue and the Solar System is reset.
Fired when a new loop is started.
Fired when a new loop is started, if the Time Loop itself hasn't already been activated.
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
Fired when the player's ship is destroyed in a destruction volume.
Fired when the player's ship enters the Quantum Moon.
Fired when the player's ship is starting to have its speed dampened by a speed limiter volume.
Fired when the ship collides with water.
- float: Relative speed of the ship when it enters the water
Fired when the player's ship exits the Quantum Moon.
Fired when the player's ship is no longer having its speed dampened by a speed limiter volume.
Fired when the ship is broken and the "SHIP HULL BREACH DETECTED" notification appears.
Fired when the player's ship leaves the Timber Hearth landing pad.
Fired when the player receives a ship log entry.
Fired when a component of the ship breaks.
Fired when the player starts to doze off at a campfire.
Fired when the player starts Hide and Seek with Tephra and Galena.
Fired when a new loop starts.
- int: The number of loops since the start of the game
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
Fired when the player starts interacting with a Repair volume.
Fired when the player attempts to start taking off while the ship has landed.
Fired when the player begins dozing off at a campfire
- bool: Whether the campfire is a Stranger campfire
Fired when the player begins talking to specifically a traveler.
Fired when the player warps the Vessel to the Eye of the Universe.
Fired when the player starts looking at a projector.
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
Fired when the player is no longer repairing a broken component (a Repair Volume has lost focus, or the interact button has been released).
Fired when the player stops dozing off, either manually or automatically.
Fired when the player stops dozing off at a Stranger campfire and is not transported to the Dreamworld.
Fired when the player's suit is put on.
Fired when the sun goes supernova.
Fired when the camera used for rendering is changed (such as when switching to the map)
- OWCamera: The camera to switch to
Fired when the player locks onto a celestial body.
- ReferenceFrame: The body that is being locked onto
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.
Fired when the ATP gets destroyed by the supernova.
Fired when the player ends the game by dying and entering the Dreamworld, getting the "You can't wake up" ending.
Fired when the player ends the game at the sixth location and gets the "Your journey has reached its end" ending.
Fired when the player ends the game inside the Stranger and gets the "Lone Inhabitant on an abandoned world" ending.
Fired when the player ends the game by surviving the supernova, getting the "You drift until your ship's supplies are depleted" ending.
Fired when the player ends the game by causing a time paradox, getting the "You destroyed the fabric of spacetime" ending.
Fired when the end-of-loop flashback is told to run.
Fired when the "Open Map" prompt appears on screen.
- bool: Whether the condition
MAP_PROMPT_ATTENTION
is true (not entirely sure what this means)
Fired at the start of the museum Nomai statue sequence, one second before TriggerMemoryUplink is fired.
Fired at the start of the museum Nomai statue sequence, once all the assets have had time to load.
Fired when the player interacts with the orrery in the observatory on top of the Timber Hearth museum.
Fired when the SecondRemaining in the loop hits 0 and the supernova begins.
Fired when the player's flashlight is turned off.
Fired when the player's flashlight is turned on.
Fired when the player puts the Translator Tool away.
Fired when the player puts the Signalscope away.
Fired when a reference frame (used to lock onto planets) is no longer a target.
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.
Fired when the player wakes up at the start of the loop (this is tied to how the player reacts when starting the loop).
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.)