-
Notifications
You must be signed in to change notification settings - Fork 13
Legacy: CallBuiltin routine
You are reading the documentation of YYToolkit Legacy (v2.x.x) - for documentation on current-gen YYTK, see the Homepage.
Calls a built-in GML function with custom arguments and instances.
Functionally the same as doing my_function(my_argument)
in GML.
bool CallBuiltin(
YYRValue& Result, // The variable that receives the return value (result) of the called function
const std::string& Name // The name of the function (ex. "room_goto", "array_get")
CInstance* Self, // The instance referred to by the "self" keyword in GML
CInstance* Other, // The instance referred to by the "other" keyword in GML
const std::vector<YYRValue>& Args // The arguments for the function
);
A reference to a YYRValue that gets set to the called function's return value.
In GML, this is the same as:
var Result = my_function(Args)
The name of the built-in function to call. These are the same as the function names used in GameMaker Language, and are case-insensitive.
Thus, room_goto
is the same as RoOm_GoTo
, and both will call the same function.
The instance that is referred to by the self
keyword in GML.
The instance that is referred to by the other
keyword in GML.
The arguments to the function, stored in a vector of YYRValues.
You may instantiate this vector inside the arguments, for example:
CallBuiltin(Result, Name, Self, Other, { 1337.0, "Example String", true });
The function returns true
if the call succeeded. Otherwise, the function returns false.
If both Self
and Other
are nullptr
, the function uses the global instance as both Self
and Other
.