Interface: IXR_game
Global helpers exposed by the engine game namespace.
Source
namespace game
Methods
active_tutorial_name()
active_tutorial_name(this: void): string;Get the active tutorial identifier.
Parameters
| Parameter | Type |
|---|---|
this | void |
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()
get_game_time(this: void): CTime;Get current in-game calendar time.
Parameters
| Parameter | Type |
|---|---|
this | void |
Returns
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()
has_active_tutorial(this: void): boolean;Check whether a tutorial is currently active.
Parameters
| Parameter | Type |
|---|---|
this | void |
Returns
boolean
Whether any tutorial is active.
jump_to_level()
Call Signature
jump_to_level(this: void, level_name: string): void;Move the actor to another level by level name.
Parameters
| Parameter | Type | Description |
|---|---|---|
this | void | - |
level_name | string | Target 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
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
| Parameter | Type | Description |
|---|---|---|
this | void | - |
position | vector | Target position. |
level_vertex_id | number | Target level vertex. |
game_vertex_id | number | Target game graph vertex. |
Returns
void
Since
OpenXRay 2017-08-15, 565b39e5
Call Signature
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
| Parameter | Type | Description |
|---|---|---|
this | void | - |
position | vector | Target position. |
level_vertex_id | number | Target level vertex. |
game_vertex_id | number | Target game graph vertex. |
direction | vector | Actor direction after the jump. |
Returns
void
Since
OpenXRay 2017-08-15, 565b39e5
log_stack_trace()
log_stack_trace(this: void): void;Write the current native stack trace to the engine log.
Parameters
| Parameter | Type |
|---|---|
this | void |
Returns
void
Since
OpenXRay 2022-08-09, a2d264fc, PR #1032
reload_language()
reload_language(this: void): void;Reload string table data for the active language.
Parameters
| Parameter | Type |
|---|---|
this | void |
Returns
void
Since
OpenXRay 2022-08-09, a2d264fc, PR #1032
start_tutorial()
start_tutorial(this: void, tutorial_id: string): void;Start an in-game tutorial sequence.
Parameters
| Parameter | Type | Description |
|---|---|---|
this | void | - |
tutorial_id | string | Tutorial 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()
stop_tutorial(this: void): void;Stop the active tutorial sequence.
Parameters
| Parameter | Type |
|---|---|
this | void |
Returns
void
time()
time(this: void): number;Get current in-game time as seconds.
Parameters
| Parameter | Type |
|---|---|
this | void |
Returns
number
Game time counter.
Remarks
Returns the low 32 bits of the current game time counter.
translate_string()
translate_string(this: void, translation_key: string): string;Resolve a string table key for the current language.
Parameters
| Parameter | Type | Description |
|---|---|---|
this | void | - |
translation_key | string | String 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
CTime: (this: void) => CTime;Create a new game time value.
Parameters
| Parameter | Type |
|---|---|
this | void |
Returns
Empty CTime instance.
Remarks
This is the same constructor exported as CTime.