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
Lua Commands
inentityzoneCategories
Parameters
- x
- y
- type
Info
Checks if the tile position (x|y) is inside the area of a certain entity type and returns true if this is the case and false otherwise.
The "area" of an entity depends on the entity type and and in some cases on its properties.
The following entities have special area sizes:
- Info_T / Info_CT: 5x5 tiles (entity in center)
- Info_RescuePoint: 3x3 tiles (entity in center)
- Info_BombSpot: 5x5 tiles (entity in center)
- Info_NoBuildings: Depending on entity settings
- Info_TeamGate: Depending on entity settings
- Info_NoWeather: Depending on entity settings
- Env_Hurt: Depending on entity settings
- Env_Room: Depending on entity settings
All other entities have an area of 1x1 tiles at the entity position.
So for these inentityzone only returns true, if an entity of the specified type is at the exact same tile position.
Note: This command has been implemented for performance reasons. It's much faster to use inentityzone than checking all entities in a Lua script manually.
Note: CS2D internally uses a 2D cache array (built at map load time) for very fast checks if there is any entity area on a tile position.
Categories
Parameters
- x
- y
- type
Info
Checks if the tile position (x|y) is inside the area of a certain entity type and returns true if this is the case and false otherwise.
The "area" of an entity depends on the entity type and and in some cases on its properties.
The following entities have special area sizes:
All other entities have an area of 1x1 tiles at the entity position.
So for these inentityzone only returns true, if an entity of the specified type is at the exact same tile position.
The "area" of an entity depends on the entity type and and in some cases on its properties.
The following entities have special area sizes:
- Info_T / Info_CT: 5x5 tiles (entity in center)
- Info_RescuePoint: 3x3 tiles (entity in center)
- Info_BombSpot: 5x5 tiles (entity in center)
- Info_NoBuildings: Depending on entity settings
- Info_TeamGate: Depending on entity settings
- Info_NoWeather: Depending on entity settings
- Env_Hurt: Depending on entity settings
- Env_Room: Depending on entity settings
All other entities have an area of 1x1 tiles at the entity position.
So for these inentityzone only returns true, if an entity of the specified type is at the exact same tile position.
Note: This command has been implemented for performance reasons. It's much faster to use inentityzone than checking all entities in a Lua script manually.
Note: CS2D internally uses a 2D cache array (built at map load time) for very fast checks if there is any entity area on a tile position.