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
sv_hostportCategories
Parameters
- port (0-65535): port, 0 = auto detect
Info
Sets the UDP port which is used for hosting the server. Default port is 36963 (recommended).
In auto detect mode (port 0) CS2D will try to find and use a free UDP port.
Note: Port changes do not take effect immediately. A map change is required (map, sv_map, changemap, changelevel) to make this change take effect. Already connected players will lose their connection during the map change when the port is changed. They will have to manually reconnect.
Note: This setting only takes effect when hosting a server. As client localport / clientport defines the used UDP port!
Attention: sv_hostport will not work if the command line parameter -port is used
Attention: If you want to run multiple instances of CS2D servers on the same physical machine you have to manually define different ports. Otherwise CS2D will either fail to run the server(s) or it will try to automatically use a random port as a fallback. If you have problems with running CS2D with a specific port you should check if other programs are already using that port or if it is blocked by a firewall.
Lua Hooks
Lua Commands
Categories
Parameters
- port (0-65535): port, 0 = auto detect
Info
Sets the UDP port which is used for hosting the server. Default port is 36963 (recommended).
In auto detect mode (port 0) CS2D will try to find and use a free UDP port.
In auto detect mode (port 0) CS2D will try to find and use a free UDP port.
Note: Port changes do not take effect immediately. A map change is required (map, sv_map, changemap, changelevel) to make this change take effect. Already connected players will lose their connection during the map change when the port is changed. They will have to manually reconnect.
Note: This setting only takes effect when hosting a server. As client localport / clientport defines the used UDP port!
Attention: sv_hostport will not work if the command line parameter -port is used
Attention: If you want to run multiple instances of CS2D servers on the same physical machine you have to manually define different ports. Otherwise CS2D will either fail to run the server(s) or it will try to automatically use a random port as a fallback. If you have problems with running CS2D with a specific port you should check if other programs are already using that port or if it is blocked by a firewall.