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
Category: all (86)
- addbind
- addhook
- ai_aim
- ai_attack
- ai_build
- ai_buy
- ai_debug
- ai_drop
- ai_findtarget
- ai_freeline
- ai_goto
- ai_iattack
- ai_move
- ai_radio
- ai_reload
- ai_respawn
- ai_rotate
- ai_say
- ai_sayteam
- ai_selectweapon
- ai_spray
- ai_use
- checksumfile
- checksumstring
- closehostage
- closeitems
- closeobjects
- closeplayers
- entity
- entitylist
- fow_in
- freehook
- freeimage
- freetimer
- funcs
- game
- hascloseplayers
- hostage
- image
- imagealpha
- imageblend
- imagecolor
- imageframe
- imagehitzone
- imageparam
- imagepos
- imagescale
- inentityzone
- item
- itemtype
- map
- menu
- msg
- msg2
- object
- objectat
- objecttype
- parse
- player
- playerammo
- playerweapons
- projectile
- projectilelist
- randomentity
- randomhostage
- removeallbinds
- removebind
- reqcld
- reqhttp
- setentityaistate
- sethookstate
- stats
- steamstats
- tile
- tileproperty
- timer
- tween_alpha
- tween_animate
- tween_color
- tween_frame
- tween_move
- tween_rotate
- tween_rotateconstantly
- tween_scale
- vars
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.