-
Notifications
You must be signed in to change notification settings - Fork 16
Next: GetBuiltin
Retrieves the value of a local built-in or a global built-in variable.
AurieStatus GetBuiltin(
[in] std::string_view Name,
[in, optional] CInstance* TargetInstance
[in, optional] int ArrayIndex
[out] RValue& Value
);The case-sensitive name of the built-in variable to access.
Important
Using this function, you can get the index of either a local built-in (such as id, image_index, etc.), or a global built-in (such as room, instance_count, etc.).
A global built-in variable IS NOT the same as a regular global variable, and cannot be treated as such - to look up a global variable, use the variable_global_get built-in function, or the GetInstanceMember function together with the global instance obtained from GetGlobalInstance.
The instance whose built-in variables are being accessed. While this parameter is unused while accessing most global built-in variables, local built-in variables (such as object_index) rely on this instance being valid and may crash the game if an invalid instance is provided.
An optional array index to use when accessing a built-in arrays (like argument). For non-array accesses, specify NULL_INDEX, defined in YYTK's Shared.hpp file.
A buffer into which the value of the built-in variable will be written. The contents of this buffer are guaranteed to remain unchanged if the function fails.
| Value | Description |
|---|---|
AURIE_SUCCESS |
The value of the built-in variable was written into the buffer. |
AURIE_MODULE_INTERNAL_ERROR |
The internal function needed is unavailable. |
AURIE_ACCESS_DENIED |
The Name variable does not have a getter. |
AURIE_OBJECT_NOT_FOUND |
The variable does not exist. |
| Criterium | Value |
|---|---|
| Minimum YYTK Version | 3.0.3 |
| Context | Any if accessing a global, otherwise engine-synchronous |