-
Notifications
You must be signed in to change notification settings - Fork 13
Next: CallBuiltinEx
Calls a GameMaker built-in function with user-specified arguments.
AurieStatus CallBuiltinEx(
[out] RValue& Result,
[in] const char* FunctionName,
[in, optional] CInstance* SelfInstance,
[in, optional] CInstance* OtherInstance
[in] std::vector<RValue> Arguments
);
A reference to a buffer into which the result of the call is written. The buffer referenced by this parameter is guaranteed to remain unchanged if the function fails.
The name of the function to call. This parameter must refer to a built-in function, not a script. Function names are case-sensitive. The function referred to by this parameter is called in the context of the passed in Self and Other instances. If a script name is passed in, the function might crash the game or worse, silently corrupt the stack.
The instance pointed to by the self
keyword in GML. Unless you are calling built-in functions asynchronously from the engine thread (outside of a callback registered by CreateCallback), it is recommended to use the instance used by the current engine event.
The instance pointed to by the other
keyword in GML. Unless you are calling built-in functions asynchronously from the engine thread (outside of a callback registered by CreateCallback), it is recommended to use the instance used by the current engine event.
A vector of RValues, containing all the arguments to pass into the built-in function. The order of these arguments is the same as if calling the function from GML itself.
On a successful call to a built-in function, the function returns AURIE_SUCCESS
and writes the result of the built-in call into the Result
buffer. If the function fails, it returns a matching error code. If the internal function lookup isn't available, the function returns AURIE_MODULE_INTERNAL_ERROR
. If the function referenced by the Name
parameter does not exist, the function returns AURIE_OBJECT_NOT_FOUND
.
Unlike YYTK v2's Legacy CallBuiltin function, CallBuiltinEx does not implicitly use the global instance if both SelfInstance
and OtherInstance
are specified as nullptr
. To use the global instance, use the GetGlobalInstance
function, or the CallBuiltin wrapper over CallBuiltinEx.