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
spawnobjectCategories
Parameters
- type (1-X): object type
- x (0-X): x pos in pixels/tiles (depending on type)
- y (0-X): y pos in pixels/tiles (depending on type)
- rot (0-360): rotation
- mode (0-X): object mode
- team (0-X): object team (0=neutral, 1=T, 2=CT)
- player (0-X): player (creator or for NPCs the type)
Info
Create an object (as server only). Objects are buildings, mines, portals, NPCs etc.
Values depend on the type of the dynamic object.
Object types are:
When creating NPCs (type 30) the player value is used to set the NPC type:
Attention: Huge numbers of objects can slow down the game and lead to lags!
Lua Hooks
Lua Commands
Categories
Parameters
- type (1-X): object type
- x (0-X): x pos in pixels/tiles (depending on type)
- y (0-X): y pos in pixels/tiles (depending on type)
- rot (0-360): rotation
- mode (0-X): object mode
- team (0-X): object team (0=neutral, 1=T, 2=CT)
- player (0-X): player (creator or for NPCs the type)
Info
Create an object (as server only). Objects are buildings, mines, portals, NPCs etc.
Values depend on the type of the dynamic object.
Object types are:
When creating NPCs (type 30) the player value is used to set the NPC type:
Values depend on the type of the dynamic object.
Object types are:
When creating NPCs (type 30) the player value is used to set the NPC type:
Attention: Huge numbers of objects can slow down the game and lead to lags!