Skip to content

Class: CConsole

Engine console interface.

Source

C++ class CConsole

Custom Constructor

CConsole

Remarks

Use get_console() to access the engine-owned console. Scripts do not create console instances.

Extends

Methods

execute()

ts
execute(command: string): void;

Execute console command immediately.

Parameters

ParameterTypeDescription
commandstringConsole command.

Returns

void

Remarks

Executes without adding the command to console history.


execute_deferred()

ts
execute_deferred(command: string): void;

Queue console command for deferred execution.

Parameters

ParameterTypeDescription
commandstringConsole command.

Returns

void

Remarks

Schedules a KERNEL:console event, so the command runs later on the engine event queue.


execute_script()

ts
execute_script(script: string): void;

Execute a config file through the console.

Parameters

ParameterTypeDescription
scriptstringConfig file path.

Returns

void

Remarks

The binding prepends cfg_load to the provided path.


get_bool()

ts
get_bool(key: string): boolean;

Read console variable as boolean.

Parameters

ParameterTypeDescription
keystringConsole variable name.

Returns

boolean

Boolean value.

Remarks

Returns false when the command is missing or is not a boolean-compatible mask/integer command.


get_float()

ts
get_float(key: string): number;

Read console variable as float.

Parameters

ParameterTypeDescription
keystringConsole variable name.

Returns

number

Float value.

Remarks

Returns 0 when the command is missing or is not a float command.


get_integer()

ts
get_integer(key: string): number;

Read console variable as integer.

Parameters

ParameterTypeDescription
keystringConsole variable name.

Returns

number

Integer value.

Remarks

Mask commands are returned as 0 or 1. Missing or incompatible commands return 0.


get_string()

ts
get_string(key: string): Nullable<string>;

Read console variable as string.

Parameters

ParameterTypeDescription
keystringConsole variable name.

Returns

Nullable<string>

String value.

Remarks

Returns null when the command does not exist.


get_token()

ts
get_token(key: string): Nullable<string>;

Read console variable token text.

Parameters

ParameterTypeDescription
keystringConsole variable name.

Returns

Nullable<string>

Token text.

Remarks

Uses the same engine path as get_string, so missing commands return null.


hide()

ts
hide(): void;

Hide the console window.

Returns

void


show()

ts
show(): void;

Show the console window.

Returns

void

Properties

__name

ts
readonly __name: string;

LuaBind instance constructor name.

Inherited from

EngineBinding.__name


__name

ts
readonly static __name: string;

LuaBind class constructor name.

Inherited from

EngineBinding.__name