Commands/Lua

Reference for console commands, Lua hooks and Lua commands in CS2D.

CS2D Command CS2D Console Commands

Lua Hook Lua Hooks

Category: basic (14)

Lua Hook trigger

Categories

Parameters

  • trigger: trigger name (always one individual name, lists will be split into mutltiple hooks)
  • source: triggered by 0=map/1=script

Info

On trigger actions (once per action). trigger is a string containing the name of the entities which will be affected. This hook will be executed once for each individual trigger action. So in case a comma-separated list is provided (either in the trigger field of an entity or as parameter for the trigger command), this hook will be executed once for each element of this list.
source is either 0 if this trigger is executed by an entity on the map or 1 if it is executed with the trigger script command.

Note: Comma-separated lists containing N triggers will lead to N executions (one for each list entry) of this hook!

Attention: This hook is executed ONCE per trigger action and not per entity. The hook triggerentity is executed once for each entity which is affected by this trigger action.

Attention: This hook will also be executed if not a single entity is affected by the trigger action.

Return Values

  • 0: proceed normally
  • 1: don't trigger

Lua Command Lua Commands