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
bindCategories
Parameters
- key (key): name of a key
- script (text): a script/command you want to execute when you press the key
Info
Binds a command or script to a key. Afterwards you can execute the script by pressing that key.
For example:
bind "L" "say lol"
Afterwards you can say "lol" by pressing the "L"-button on your keyboard.
Note: You can use unbindall to remove ALL key bindings.
Note: You can modify the file "sys/controls.lst" to add your own aliases/scripts to the CS2D controls menu. The format is: "command/script" "description text / reference to translation file key". Binds you set there will be saved automatically.
Note: If you're unsure about the name of a key, use the controls option menu to find out what it is.
Attention: Key bindings created with this command will not be saved and will get lost when you quit CS2D.
Attention: CS2D internally uses the file "sys/controls.cfg" to save the controls which have been set in the controls menu! Do NOT manually add your binds there as this file will be overwritten when you use the options menu!
Lua Hooks
Lua Commands
Categories
Parameters
- key (key): name of a key
- script (text): a script/command you want to execute when you press the key
Info
Binds a command or script to a key. Afterwards you can execute the script by pressing that key.
For example:
Afterwards you can say "lol" by pressing the "L"-button on your keyboard.
For example:
bind "L" "say lol"
Afterwards you can say "lol" by pressing the "L"-button on your keyboard.
Note: You can use unbindall to remove ALL key bindings.
Note: You can modify the file "sys/controls.lst" to add your own aliases/scripts to the CS2D controls menu. The format is: "command/script" "description text / reference to translation file key". Binds you set there will be saved automatically.
Note: If you're unsure about the name of a key, use the controls option menu to find out what it is.
Attention: Key bindings created with this command will not be saved and will get lost when you quit CS2D.
Attention: CS2D internally uses the file "sys/controls.cfg" to save the controls which have been set in the controls menu! Do NOT manually add your binds there as this file will be overwritten when you use the options menu!