Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GlobalScriptingEvents

Global scripting event callbacks

Hierarchy

  • GlobalScriptingEvents

Index

Properties

onChatMessage

onChatMessage: MulticastDelegate<(sender: Player, message: string) => void>

Called when a player sends a chat message

param

Player that sent the message

param

The chat message

onCustomAction

onCustomAction: MulticastDelegate<(player: Player, identifier: string) => void>

Called when a player has called a custom action from the global context menu (defined through GameWorld.addCustomAction)

param

Player that called the action

param

The identifier of the executed action

onDiceRolled

onDiceRolled: MulticastDelegate<(player: Player, dice: Dice[]) => void>

Called when a player has rolled dice, once the dice have come to rest. Called directly before the dice roll message is sent, so you can use GameWorld.setShowDiceRollMessages to determine whether the regular message should be sent.

param

Player that rolled the dice

param

Array of Dice objects that were rolled

onLineDrawn

onLineDrawn: MulticastDelegate<(player: Player, object: GameObject, line: DrawingLine) => void>

Called when a player has finished drawing a line. A line is finished when the player releases the mouse button or moves the mouse to another object. A line is also finished when it exceeds 1000 points, in that case a new line is started immediately at the point where the old line finished, usually without the player noticing.

param

Player that drew the line

param

The object on which the line was drawn. undefined when the line was drawn directly on the table.

param

Information about the line

onLineErased

onLineErased: MulticastDelegate<(player: Player, object: GameObject, line: DrawingLine) => void>

Called when a player has erased a line.

param

Player that erased the line

param

The object on which the erased line was drawn. undefined when the line was drawn directly on the table.

param

Information about the erased line

onObjectCreated

onObjectCreated: MulticastDelegate<(object: GameObject) => void>

Called when an object is created (from the object library, loading a game, copy & paste, dragging from a container or stack...)

param

The new object

onObjectDestroyed

onObjectDestroyed: MulticastDelegate<(object: GameObject) => void>

Called when an object is destroyed

param

The destroyed object

onPackageAdded

onPackageAdded: MulticastDelegate<(package: Package) => void>

Called when a new allowed package was added to the session. Not called after loading for packages that are part of a loaded save state.

param

The newly added package

onPlayerJoined

onPlayerJoined: MulticastDelegate<(player: Player) => void>

Called when a player joins the game

param

The new player

onPlayerLeft

onPlayerLeft: MulticastDelegate<(player: Player) => void>

Called when a player leaves the game

param

The new player

onPlayerSwitchedSlots

onPlayerSwitchedSlots: MulticastDelegate<(player: Player, index: number) => void>

Called when a player has switched slots

param

Player that switched slots (already at new slot)

param

Previous player slot

onScriptButtonPressed

onScriptButtonPressed: MulticastDelegate<(player: Player, index: number, ctrl: boolean, alt: boolean) => void>

Called when a player presses a script action button. Per default, the script buttons are mapped to the numpad. Players can re-assign them in the interface settings.

param

Player that pressed the button

param

Index of the action (1-10)

param

Whether the ctrl key was held when the player pressed the button

param

Whether the alt key was held when the player pressed the button

onScriptButtonReleased

onScriptButtonReleased: MulticastDelegate<(player: Player, index: number) => void>

Called when a player releases a script action button.

param

Player that pressed the button

param

Index of the action (1-10)

onShake

onShake: MulticastDelegate<(player: Player, objects: GameObject[]) => void>

Called when a player has shaken the mouse (or motion controller) while holding objects.

param

Shaking player

param

Array of held objects

onTeamChatMessage

onTeamChatMessage: MulticastDelegate<(sender: Player, team: number, message: string) => void>

Called when a player sends a team chat message

param

Player that sent the message

param

The index of the team where the message was sent (1-8)

param

The chat message

onTick

onTick: MulticastDelegate<(milliseconds: number) => void>

Called every tick.

param

Duration of the previous tick

onWhisper

onWhisper: MulticastDelegate<(sender: Player, recipient: Player, message: string) => void>

Called when a player whispers (sends a direct message) to another player

param

Player that sent the message

param

Player that received the message

param

The message