Engine:CCMD context

Revision as of 06:53, 15 October 2023 by Bear (talk | contribs) (→‎Details)
Console commands

Switches contexts or prints the current context.

context client

Arguments

  • name (optional) - The name of the context to switch to. If no name, then prints the name of the current context.

Details

The 'context' command allows changing between named contexts. Each context may have its own commands and variables and rules, and purpose.

For a context to be available, it has to be associated with the one you are in. These associations are created by the various engine modules and can never be directly added or removed by console commands, or any type of script or AddOn.

Examples

Default values

  • Try to change to a non-existent context.
> context bob
Unknown: bob
  • Called with no name. The current context is printed.
> context
global
  • Same as the first example, but now bob exists.
> var bob
'bob' is 'fred'
  • Try to set existing 'bob' to 'james', value changes.
> var bob james
> var bob
'bob' is 'james'

Notes