11 natives. Read-only natives only look things up; the rest change something. Parameter types use the language's names (Types).
$utility.entity_ref_guid_equals_string(entity: Entity, guid_string: string) -> bool
Check if an entity_ref's GUID matches a given string.
| Parameter | Type | Meaning |
|---|
entity | Entity | The entity_ref. |
guid_string | string | The GUID as a string. |
Returns bool: True if the GUID and string are equivalent.
$utility.generate_hash32(hash_elements: list) -> int
Generate a hashed 32-bit int given a list of values to hash.
| Parameter | Type | Meaning |
|---|
hash_elements | list | List containing the values to use when generating the hash. |
Returns int: int containing the resultant 32-bit hash.
$utility.generate_unique_id() -> vec4
Generates an id based on this device.
Returns vec4: unique identifier
$utility.get_app_index() -> int
Gets the instance index. Normally 0, unless e.g. -game -game.
Returns int: app client index
$utility.get_asset_guid(asset: Reference) -> var
Get the GUID of a game asset.
| Parameter | Type | Meaning |
|---|
asset | Reference | The asset to get the guid from. |
Returns var: The Guid
$utility.get_filename(file: Reference) -> string
Gets the filename of a file ref (e.g. 'my_file.animation').
| Parameter | Type | Meaning |
|---|
file | Reference | The file ref. |
Returns string: The filename.
$utility.get_host_id(include_app_index: bool) -> vec4
Gets this device's host id. This identifier may change each time Viper restarted.
| Parameter | Type | Meaning |
|---|
include_app_index | bool | If true, each app instance will have a unique id. |
Returns vec4: device host id
$utility.get_packed_value(storage: vec4, index: int, bits: int) -> int
Gets a value from within homogenously packed storage.
| Parameter | Type | Meaning |
|---|
storage | vec4 | The storage to read the value from. |
index | int | Index to read the value at. |
bits | int | Number of bits per entry (1-32). |
Returns int: The value from the packed storage
$utility.get_system_uuid() -> string
Get a unique identifier string for this device. This identifier should only change when the device changes.
Returns string: device UUID
$utility.is_shipping_build() -> bool
Is this build flagged as shipping?
Returns bool: Are we flagged as shipping?
$utility.set_packed_value(storage: vec4, value: int, index: int, bits: int) -> vec4
Sets a value in homogenously packed storage.
| Parameter | Type | Meaning |
|---|
storage | vec4 | The storage to add the value to. |
value | int | The value to set. |
index | int | Index to write the value at. |
bits | int | Number of bits per entry (1-32). |
Returns vec4: Updated packed storage