Notification
A Notification is a data structure used by Alter Ego. It represents a private notification of in-game occurrences that is sent to a single Player. Notifications are exclusively created and sent by the Game’s narration handler.
Once a Notification has been created, it is sent to the Player via the Game’s communication handler. However, it will not be sent if:
- The Player is an NPC, or
- The Player has the
unconsciousbehavior attribute (with few exceptions).
A Notification object acts as a set of instructions for how the Notification should be communicated to a Player. Notifications are written to be specific to the perspective of the Player they are being written before. As such, they typically address the Player in second person. They are most often generated by the Game’s notification generator.
Notifications are fully transient. They are only intended to exist temporarily, so they are not saved to the spreadsheet. Notifications have an extremely short life; before a Notification is even added to the message queue, it is discarded, and lost forever.
Notifications have a counterpart that are more generalized, and intended to be seen by multiple Players at once: Narrations.
Attributes
Notifications have few attributes.
Player
- Class attribute: Player
this.player
This is Player the Notification is created for. When the Notification is sent, it is sent to their notification channel.
Message Display Type
- Class attribute: Enum (number)
this.messageDisplayType
This is the message display type to use for the message that will be sent to communicate the Notification. This determines how it will be displayed. This is assigned automatically by the narration handler, and these assignments are almost all hard-coded.
Action
- Class attribute: Action
this.action
This is the Action the Player is being notified of. It is used by the Game’s communication handler to ensure that Actions are only communicated in the same channel once.
Content
- Class attribute: String
this.content
The text content for the Notification. This is always what gets sent as a message.
Mirror in Spectate Channel
- Class attribute: Boolean
this.mirrorInSpectateChannel
This Boolean value indicates whether or not the Notification should be mirrored in the Player’s
spectate channel. This is usually true, but some functions explicitly set it to false.
This usually happens because the Action being communicated has already been mirrored in the Player’s spectate channel
in some other way.
Attachments
- Class attribute: Collection<String, Attachment>
this.attachments
This is a collection of attachments to send with the Notification. Usually this is an empty collection. It is only set when the Notification is mirroring a Narration with attachments, or when a Text Action is performed.
Embeds
This is an array of embeds to send with the Notification. Usually this is an empty array. It is only set when the Notification is mirroring a Narration with embeds, or when a Text Action is performed.
Interactables
- Class attribute: Array<Interactable>
this.interactables
This is an array of Interactables to send with the Notification. For more information, see the article on Interactables.