Commands/Lua
Reference for console commands, Lua hooks and Lua commands in CS2D.
- Console Commands are entered in console, executed with key-binds, cfg-files or with Lua parse
- Lua Hooks execute Lua when events occur - some have a return value which can change the game behavior
- Lua Commands are used to retrieve game data or to perform actions in Lua scripts
CS2D Console Commands
Lua Hooks
Category: basic (14)
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.
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