-
Notifications
You must be signed in to change notification settings - Fork 16
Next: GetBuiltinVariableIndex
Retrieves the index for an instance built-in or global built-in variable.
AurieStatus GetBuiltinVariableIndex(
[in] std::string_view Name,
[out] size_t& Index
);The name of the built-in to look up.
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.
A reference to a buffer, into which the index of the variable is written. This buffer is guaranteed to remain unchanged if the function fails. To access built-in variables via this index, use the GetBuiltinVariableInformation function.
Note
Accessing built-ins via an index is not faster than using GetBuiltin, due to YYTK's caching system.
| Value | Description |
|---|---|
AURIE_SUCCESS |
The built-in was found, and its index was written into the buffer. |
AURIE_MODULE_INTERNAL_ERROR |
The internal function needed is unavailable. |
AURIE_OBJECT_NOT_FOUND |
The function Name does not exist. |
| Criterium | Value |
|---|---|
| Minimum YYTK Version | 3.0.3 |
| Context | Any |