Skip to content

Interface: IXR_game ​

Global helpers exposed by the engine game namespace.

Source ​

namespace game

Methods ​

active_tutorial_name() ​

ts
active_tutorial_name(this: void): string;

Get the active tutorial identifier.

Parameters ​

ParameterType
thisvoid

Returns ​

string

Active tutorial name.

Since ​

OpenXRay 2022-08-09, a2d264fc, PR #1032

Remarks ​

Call only after has_active_tutorial() returns true; the binding dereferences the active tutorial directly.


get_game_time() ​

ts
get_game_time(this: void): CTime;

Get current in-game calendar time.

Parameters ​

ParameterType
thisvoid

Returns ​

CTime

Current game time value.

Remarks ​

Uses ALife game time when ALife is available, otherwise falls back to the current level game time.


has_active_tutorial() ​

ts
has_active_tutorial(this: void): boolean;

Check whether a tutorial is currently active.

Parameters ​

ParameterType
thisvoid

Returns ​

boolean

Whether any tutorial is active.


jump_to_level() ​

Call Signature ​

ts
jump_to_level(this: void, level_name: string): void;

Move the actor to another level by level name.

Parameters ​
ParameterTypeDescription
thisvoid-
level_namestringTarget level name from the game graph.
Returns ​

void

Since ​

OpenXRay 2017-08-15, 565b39e5

Remarks ​

If the level name is not present in the game graph, the engine logs a script error and leaves the actor in the current level.

Call Signature ​

ts
jump_to_level(
   this: void, 
   position: vector, 
   level_vertex_id: number, 
   game_vertex_id: number): void;

Move the actor to another level graph point.

Parameters ​
ParameterTypeDescription
thisvoid-
positionvectorTarget position.
level_vertex_idnumberTarget level vertex.
game_vertex_idnumberTarget game graph vertex.
Returns ​

void

Since ​

OpenXRay 2017-08-15, 565b39e5

Call Signature ​

ts
jump_to_level(
   this: void, 
   position: vector, 
   level_vertex_id: number, 
   game_vertex_id: number, 
   direction: vector): void;

Move the actor to another level graph point and face a direction.

Parameters ​
ParameterTypeDescription
thisvoid-
positionvectorTarget position.
level_vertex_idnumberTarget level vertex.
game_vertex_idnumberTarget game graph vertex.
directionvectorActor direction after the jump.
Returns ​

void

Since ​

OpenXRay 2017-08-15, 565b39e5


log_stack_trace() ​

ts
log_stack_trace(this: void): void;

Write the current native stack trace to the engine log.

Parameters ​

ParameterType
thisvoid

Returns ​

void

Since ​

OpenXRay 2022-08-09, a2d264fc, PR #1032


reload_language() ​

ts
reload_language(this: void): void;

Reload string table data for the active language.

Parameters ​

ParameterType
thisvoid

Returns ​

void

Since ​

OpenXRay 2022-08-09, a2d264fc, PR #1032


start_tutorial() ​

ts
start_tutorial(this: void, tutorial_id: string): void;

Start an in-game tutorial sequence.

Parameters ​

ParameterTypeDescription
thisvoid-
tutorial_idstringTutorial identifier.

Returns ​

void

Remarks ​

Does nothing while the load screen is active. Starting a second tutorial stores the previous one as the fallback input receiver.


stop_tutorial() ​

ts
stop_tutorial(this: void): void;

Stop the active tutorial sequence.

Parameters ​

ParameterType
thisvoid

Returns ​

void


time() ​

ts
time(this: void): number;

Get current in-game time as seconds.

Parameters ​

ParameterType
thisvoid

Returns ​

number

Game time counter.

Remarks ​

Returns the low 32 bits of the current game time counter.


translate_string() ​

ts
translate_string(this: void, translation_key: string): string;

Resolve a string table key for the current language.

Parameters ​

ParameterTypeDescription
thisvoid-
translation_keystringString table key to translate.

Returns ​

string

Localized text or the fallback string from the string table.

Since ​

OpenXRay 2022-08-09, a2d264fc, PR #1032

Properties ​

CTime ​

ts
CTime: (this: void) => CTime;

Create a new game time value.

Parameters ​

ParameterType
thisvoid

Returns ​

CTime

Empty CTime instance.

Remarks ​

The only place the engine registers CTime; new CTime() compiles to this call.