Engine:Console commands: Difference between revisions

No edit summary
Line 11: Line 11:
* 'Global commands' and 'Global variables' - below are short-hand for commands placed in the 'global' context.
* 'Global commands' and 'Global variables' - below are short-hand for commands placed in the 'global' context.
* 'Default command' - is run by default if its context is addressed by name or is the current context. Examples:
* 'Default command' - is run by default if its context is addressed by name or is the current context. Examples:
** Prints 3. Where the 'lua' context is addressable from 'global', and 'print' is a real Lua command, not an Engine script one. <pre lang="lua">lua print(1 + 3)</pre>  
** Prints 3. Where the 'lua' context is addressable from 'global', and 'print' is a real Lua command, not an Engine script one. <kua>lua print(1 + 3)</kua>  
** Also prints 3 and return to global. Where context is switched to, then the Lua command is run. <pre lang="lua">context lua; print(1 + 3); exit</pre>
** Also prints 3 and return to global. Where context is switched to, then the Lua command is run. <kua>context lua; print(1 + 3); exit</kua>
** Starts the client module. <pre lang="lua">client start</pre>  
** Starts the client module. <kua>client start</kua>  
** Starts the client module and returns to global. <pre lang="lua">context client; start; context global</pre>
** Starts the client module and returns to global. <kua>context client; start; context global</kua>
** Prints 'fred', using the 'global' default 'varedit' command. 'bob' is not a command but an existing variable. <pre lang="lua">var bob fred; bob</pre>  
** Prints 'fred', using the 'global' default 'varedit' command. 'bob' is not a command but an existing variable. <kua>var bob fred; bob</kua>  
** Prints 'james'. Where the default command finds the existing 'bob' variable in the 'global' context, and assigns 'james'. <pre lang="lua">bob james; bob</pre>
** Prints 'james'. Where the default command finds the existing 'bob' variable in the 'global' context, and assigns 'james'. <kua>bob james; bob</kua>
* Command - An engine module command.
* Command - An engine module command.
* Variable - An engine variable, similar to 'CVars' or config vars.
* Variable - An engine variable, similar to 'CVars' or config vars.