Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Action

An Action is a data structure used by Alter Ego. It represents an action that changes the game state in some way. If persistent Game Entities can be understood as nouns, Actions can be understood as verbs. They are usually performed by Players in specific Rooms, but this is not always the case.

Actions are fully transient. They are only intended to exist temporarily, so they are not saved to the spreadsheet. Actions have a very short life; they are only persisted briefly in the communication handler’s Action cache, after which they disappear forever.

A single instance of an Action can only be performed once. In order to perform that Action again, a new Action must be created.

It is not possible to create an Action by itself—it is an abstract base class with many derived classes that do different things. Each derived class will be listed below, along with a general overview of its purpose and behavior.

Attributes

All derived Action classes have the following attributes.

ID

  • Class attribute: String this.id

This is a unique ID that is automatically generated when an Action is created. This allows it to be distinguished from all other Actions.

Message

This is a reference to the Discord message which caused this Action to be created. This is usually the command that was issued by a Player or Moderator. However, this is sometimes undefined. This can occur when the Action wasn’t created by a user-issued command. For example, Bot commands always create Actions with an undefined message, and Actions created by other Actions often create those Actions with an undefined message.

This is usually used when an Action cannot proceed because of an error. If the Action was created with a message, Alter Ego will reply to the message to indicate why it couldn’t be executed successfully.

Player

This is the Player performing the Action. However, this is sometimes undefined, as not all Actions are performed by Players. Typically, if an Action was created by another Action, the original Player is passed along to the new Action.

Location

This is the Room that the Action is being performed in. Usually, if a Player is performing the Action, this is that Player’s location. However, this is sometimes undefined, as not all Actions are performed in specific Rooms.

Forced

  • Class attribute: Boolean this.forced

This is a Boolean value which indicates whether or not the Action is being performed forcibly. This usually means that a Player is being forced to perform the Action by a Moderator command, or by a Bot command. This is used by the log handler to indicate that a Player did not perform an Action of their own volition. However, near-universally, any Action which is created by a Moderator command or Bot command is considered to have been forced.

Whisper

This is the Whisper associated with the Action, if there is one. This is used in Narrations. If no Whisper is associated with the Action, this is undefined.

User

This is the user who caused the Action to be created. If the Action was created by a Moderator command, the user is the Moderator who issued the command. Otherwise, the user is the Player performing the Action.

Success Message

  • Class attribute: String this.successMessage

This is a message indicating that the Action was performed successfully. Currently, this is automatically generated when the Action is finished being performed successfully. Currently, this is only used by Moderator commands.

Types of Actions

Activate Action

An Activate Action activates a Fixture. It is performed when the fixture command or use command is used.

Announce Action

An Announce Action is performed when a Player with the Free Movement role speaks in the announcement channel.

Attempt Action

An Attempt Action attempts to solve a Puzzle for a Player. It is performed when the puzzle command or use command is used. It is also performed when:

  • A Dress Action or Take Action is performed on a take-, weight-, or container-type Puzzle, or
  • A Drop Action or Undress Action is performed on a drop-, weight-, or container-type Puzzle.

Craft Action

A Craft Action crafts two Inventory Items together. It is performed when the craft command is used. It can also be performed with interactables.

Cure Action

A Cure Action cures a Player of a given Status Effect. It is performed when the status command is used, and it is performed to specifically cure the “asleep” Status Effect when the wake command is used. It is also performed when:

  • A Status inflicted on a Player with a duration expires and isn’t fatal,
  • A Player is inflicted with a Status Effect that they already have, which is supposed to be replaced with its duplicated Status—the original Status is cured before the duplicated Status is inflicted,
  • A Player is inflicted with a Status that cures one or more Status Effects,
  • A Player performs an Unhide Action—the “hidden” Status is cured,
  • A Player is inflicted with a Status with a next stage—the next stage is cured before it it is inflicted (if it already exists), or
  • A Player performs a Use Action with an Inventory Item that cures one or more Status Effects.

Deactivate Action

A Deactivate Action deactivates a Fixture. It is performed when the fixture command or use command is used. It is also performed when a Fixture’s process timer expires, but only if the Fixture is set to deactivate automatically.

Destroy Inventory Item Action

A Destroy Inventory Item Action destroys an Inventory Item. If the Inventory Item was equipped, it is destroyed completely, and replaced with a null Inventory Item. Otherwise, its quantity is set to 0, and it is removed from its container. Usually, all of the child Inventory Items are recursively destroyed as well.

A Destroy Inventory Item Action is performed when the destroy command is used. It is also performed on a Recipe’s ingredients when they are crafted. It can also be performed with interactables.

Destroy Room Item Action

A Destroy Room Item Action destroys a Room Item. This means that its quantity is set to 0. If its container is another Room Item, it is removed from its container. Usually all of the child Room Items are recursively destroyed as well.

A Destroy Room Item Action is performed when the destroy command is used. It is also performed on a Recipe’s ingredients when they are processed, and when a Room Item’s uses are decreased to 0. It can also be performed with interactables.

Die Action

Note

Not to be confused with Die, an unrelated transient data structure.

A Die Action kills a Player. It is performed when the kill command is used. It is also performed when a fatal Status inflicted on a Player expires.

Dress Action

A Dress Action takes all equippable Room Items from a specified container and equips them to the Player’s Equipment Slots. It is performed when the dress command is used.

Drop Action

A Drop Action removes an Inventory Item from one of the Player’s hands, converts it to a Room Item, and puts it in the specified container. It is performed when the drop command is used. It can also be performed with interactables.

End Action

An End Action ends an Event. It is performed when the event command is used. It is also performed when an Event’s timer expires.

Enter Action

An Enter Action adds a Player to the given Room. Then, if the Player’s move queue is not empty, it performs a new Queue Move Action. An Enter Action is only performed as part of a Move Action.

Equip Action

An Equip Action removes an Inventory Item from one of the Player’s hands and equips it to one of their Equipment Slots. It is performed when the equip command is used. It can also be performed with interactables.

Exit Action

An Exit Action removes a Player from the given Room, and from any Whispers they’re currently in. It is only performed as part of a Move Action.

Find Action

A Find Action takes a type of Game Entity and an optional search query and displays all of the Game Entities that satisfy the given criteria in a table with their row numbers. It is performed when the find command is used. It can also be performed with interactables.

Gesture Action

A Gesture Action does a Gesture for a Player. It can also display a list of Gestures that can be done by the Player performing it. It is performed when the gesture command is used.

Give Action

A Give Action removes an Inventory Item from one of the Player’s hands and adds it to one of the hands of the recipient Player. It is performed when the give command is used.

Help Action

A Help Action displays a list of commands available to the user. If an alias of a command is given, it shows the help menu for that command, with all of its aliases, examples, and usage details. It is performed when the help command is used.

Hide Action

A Hide Action attempts to hide a Player in a given Hiding Spot. It is performed when the hide command is used.

Inflict Action

An Inflict Action inflicts a Player with a given Status Effect. It is performed when the status command is used, and it is performed to specifically inflict the “asleep” Status Effect when the sleep command is used. It is also performed when:

Inspect Action

An Inspect Action parses the Description of the specified Room, Fixture, Room Item, Player, or Inventory Item and sends it to the Player performing it. It is performed when the inspect command is used. It can also be performed with interactables.

Instantiate Inventory Item Action

An Instantiate Inventory Item Action instantiates an Inventory Item with the given Prefab. It can be instantiated to a Player’s Equipment Slot or in an Inventory Slot of one of their other Inventory Items. If the Prefab being instantiated has Inventory Slots of its own, it will be generated with a unique identifier; if it is being instantiated with a quantity greater than 1, each one will be created as a separate Inventory Item with its own identifier.

An Instantiate Inventory Item Action is performed when the instantiate command is used. It is also performed with a Recipe’s products when they are crafted. It can also be performed with interactables.

Instantiate Room Item Action

An Instantiate Room Item Action instantiates a Room Item with the given Prefab in the specified container. If the Prefab being instantiated has Inventory Slots of its own, it will be generated with a unique identifier; if it is being instantiated with a quantity greater than 1, each one will be created as a separate Room Item with its own identifier.

An Instantiate Room Item Action is performed when the instantiate command is used. It is also performed with a Recipe’s products when they are processed, and when a Room Item with a next stage has its uses decreased to 0. It can also be performed with interactables.

Inventory Action

An Inventory Action displays a Player’s inventory. It is performed when the inventory command is used.

Knock Action

A Knock Action sends a Narration in a Player’s location that they are knocking on the given Exit’s door, and sends a Narration in the Room that the Exit leads to that someone is knocking on the corresponding Exit. It is performed when the knock command is used.

Lock Action

A Lock Action locks the given Exit in a Room. It is performed when the exit command is used. A Lock Action does not lock the Exit’s corresponding link—that must be done with a separate Lock Action.

Monolog Action

A Monolog Action displays the given text in a MONOLOG message display in the notification channel and spectate channel of the character performing it. It represents the Player’s inner thoughts. It is performed when the monolog command is used.

Move Action

A Move Action removes a Player from one Room and adds them to another. Internally, it performs an Exit Action and Enter Action in succession. If the Player is moving through an Exit, and that Exit has an associated restricted exit-type Puzzle in which their name is listed as a solution, they will perform a Solve Action on it.

A Move Action is performed when the move Moderator or move Bot command is used. It is also performed when a Queue Move Action is performed by a Player with the Free Movement role without specifying an Exit, and when a Player’s remaining time reaches 0 in their move timer, as long as the Exit they are moving toward is unlocked or passable.

Narrate Action

A Narrate Action sends a Narration to all relevant destinations. First, it sends the Narration to its location, as long as it isn’t occurring in a Hiding Spot. Then, it sends the Narration to its Whisper, if it has one. Finally, it sends the Narration to its respective video monitoring Rooms, as long as its location is video surveilled, it isn’t occurring in a Hiding Spot, and the Action being narrated isn’t a Say Action. If any occupant of these destinations has the see room behavior attribute, they will be sent a Notification communicating the content of the Narration.

A Narrate Action is performed by every function in the Game’s narration handler. It is also performed when:

Queue Move Action

A Queue Move Action finds the user-entered Exit or Room. If it is found, a Start Move Action is performed. However, if the Player has the Free Movement role and they entered the name of a Room, they will instead instantly perform a Move Action.

A Queue Move Action is performed when the move Player command or run Player command is used. It also performed when an Enter Action is performed, if the Player’s move queue is not empty. It can also be performed with interactables.

Recipes Action

A Recipes Action displays a list of all Recipes that can be carried out by a Player. By default, all Recipes that can be done using only the Room Items in the Player’s location will be shown, as long as they have at least one of the Recipe’s ingredients in their inventory. However, if one of their Inventory Items is specified, all Recipes that use its Prefab as an ingredient will be shown. It is performed when the recipes command is used.

Say Action

A Say Action sends the given dialog to all relevant destinations. How this works is detailed here.

The Player’s own dialog is always mirrored in their spectate channel. NPCs, as well as any Players with the no hearing and unconscious behavior attributes, will not receive any Notifications regarding spoken dialog, and it will not be mirrored in their spectate channels. If a Player who can hear spoken dialog has the no sight behavior attribute, or they are being mimicked, they will receive a Notification that takes priority over the ordinary style of mirrored dialog in spectate channels. Otherwise, if the Player has the hear room behavior attribute, or they know the speaker’s voice but can’t identify them by appearance, they will receive a Notification that does not take priority over the usual style of mirrored dialog in spectate channels.

If the dialog was whispered, it is mirrored in the spectate channels of all Players in the Whisper. If any Players in the Room have the acute hearing behavior attribute, they will receive a Notification communicating the content of the whispered dialog.

If the dialog wasn’t whispered, it will be mirrored in the spectate channels of all Players in the Room, and any voice-type Puzzles in the Room will be attempted. Any Players in non-soundproof neighboring Rooms with the acute hearing behavior attribute will receive a Notification communicating the content of the spoken dialog.

Then, if the Room is audio surveilled, the dialog will be narrated in all audio monitoring Rooms, and mirrored in the spectate channels of their occupants. voice-type Puzzles in these Rooms will also be attempted.

Next, if the dialog was shouted—either by the contents being in all uppercase, or by being preceded with heading characters—it will be narrated in any non-soundproof neighboring Rooms, as well as all audio monitoring Rooms if one of the neighboring Rooms is audio surveilled. voice-type Puzzles in these Rooms will be attempted, and the dialog will be mirrored in the spectate channels of all of their occupants.

Finally, if the speaker has the sender behavior attribute, the spoken dialog is narrated in all Rooms with at least one Player with the receiver behavior attribute. If any of these Rooms are audio surveilled, the dialog will also be narrated in all audio monitoring Rooms. voice-type Puzzles in all of these Rooms will be attempted, and the dialog will be mirrored in the spectate channels of all of their occupants.

A Say Action is performed when a Player or latched Moderator sends a message in a Room channel or Whisper channel. It is also performed when the say command is used, or when the whisper Moderator command is used to make an NPC speak in a Whisper.

Solve Action

A Solve Action solves a Puzzle and sets its outcome. It is performed when the puzzle command is used. It is also performed when a Player moves through an Exit that has an associated restricted exit-type Puzzle if their name is listed as a solution, and when a Player’s dialog is spoken (or audible in) a Room with a voice-type Puzzle if the alphanumeric content (case-insensitive) of the dialog contains one of the Puzzle’s solutions.

Start Move Action

A Start Move Action calculates how much time it will take for a Player to move to the given Exit from their current position and starts their move timer, beginning the process of moving them to the destination. It is performed as part of a Queue Move Action.

Stash Action

A Stash Action removes an Inventory Item from one of the Player’s hands and inserts it into an Inventory Slot of one of their other Inventory Items. It is performed when the stash command is used. It can also be performed with interactables.

Steal Action

A Steal Action attempts to remove a random Inventory Item from an Inventory Slot of one a Player’s equipped Inventory Items and add it to one of the stealing Player’s hands. There are three possible outcomes:

  1. The stealing Player fails to steal an Inventory Item, and the victim is notified that they tried.
  2. The stealing Player successfully steals an Inventory Item, but the victim is notified.
  3. The stealing Player successfully steals an Inventory Item without the victim noticing.

The stealing Player’s success is determined by the result of a Die weighted by their dexterity stat, where a higher stat means a higher success rate. However, if the stolen Inventory Item is non-discreet, the victim will always notice. The only exception is if the victim is unconscious—in this case, they will never notice, and Steal Actions will always succeed.

A Steal Action is performed when the steal command is used.

Stop Action

A Stop Action stops a Player’s movement and clears their move queue. It is performed when the stop command is used, and when a Player finishes moving to an Exit that is locked or impassable. It can also be performed with interactables.

Take Action

A Take Action removes a Room Item from its container, converts it to an Inventory Item, and puts it in one of the Player’s hands. It is performed when the take command is used. It can also be performed with interactables.

Text Action

A Text Action sends a text message from the sending Player to a recipient Player. The message is sent as a PLAIN_TEXT Notification to both the recipient and sender along with any Attachments and Embeds that were sent in the original message. This Notification will be sent even to unconscious Players.

A Text Action is performed when the text command is used.

Trigger Action

A Trigger Action triggers an Event. It is performed when the event command is used. It is also performed when the current date and time matches any of the Event’s trigger times.

Uncraft Action

An Uncraft Action uncrafts an Inventory Item into two Inventory Items that can produce it in a Recipe. It is performed when the uncraft command is used. It can also be performed with interactables.

Undress Action

An Undress Action removes all unequippable Inventory Items from the Player’s Equipment Slots and drops them in the specified container. It is performed when the undress command is used.

Unequip Action

An Unequip Action removes an Inventory Item from one of the Player’s Equipment Slots and puts it in one of their hands. It is performed when the unequip command is used. It can also be performed with interactables.

Unhide Action

An Unhide Action removes a Player from their Hiding Spot. It is performed when the unhide alias of the hide command is used.

Unlock Action

An Unlock Action unlocks the given Exit in a Room. It is performed when the exit command is used. An Unlock Action does not lock the Exit’s corresponding link—that must be done with a separate Unlock Action.

Unsolve Action

An Unsolve Action unsolves a Puzzle and clears its outcome. It is performed when the puzzle command is used.

Unstash Action

An Unstash Action removes an Inventory Item from an Inventory Slot of one of the Player’s other Inventory Items and puts it in one of their hands. It is performed when the unstash command is used. It can also be performed with interactables.

Use Action

A Use Action uses an Inventory Item on a Player. It is performed when the use command is used. It can also be performed with interactables.

View Action

A View Action displays the given Game Entity. By default, it displays most of the Game Entity’s data as it would appear on the sheet, but it is also possible to view one of its specific attributes individually. It is performed when the view command is used. It can also be performed with interactables.

Whisper Action

A Whisper Action creates a Whisper between the given Players. It is performed when the whisper command is used.