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
spawnnpcCategories
Parameters
- type (1-X): npc type
- x (0-X): x pos in tiles
- y (0-X): y pos in tiles
- rot (0-360): rotation
Info
Create an NPC (as server only).
NPC types:
1 - zombie
2 - headcrab
3 - snark
4 - vortigaunt
5 - soldier
Note: NPCs are actually objects as well - with type 30. the type of the NPC is saved in the player attribute of the object. So you could also use spawnobject with proper parameters to create NPCs.
Attention: Huge numbers of NPCs can slow down the game and lead to lags!
Lua Hooks
Lua Commands
Categories
Parameters
- type (1-X): npc type
- x (0-X): x pos in tiles
- y (0-X): y pos in tiles
- rot (0-360): rotation
Info
Create an NPC (as server only).
NPC types:
1 - zombie
2 - headcrab
3 - snark
4 - vortigaunt
5 - soldier
NPC types:
1 - zombie
2 - headcrab
3 - snark
4 - vortigaunt
5 - soldier
Note: NPCs are actually objects as well - with type 30. the type of the NPC is saved in the player attribute of the object. So you could also use spawnobject with proper parameters to create NPCs.
Attention: Huge numbers of NPCs can slow down the game and lead to lags!