This file contains describes all of the mod-accessible global functions, variables, and constants.
The contents can include:
GML-style, single-line (// text
)
or multi-line (/* text */
).
These can look like so:
ev_create# ev_destroy = 1
These can look like so:
room_speed current_time* view_xview[player]*
If something has a [index]
after it, that's an array.
If something has a *
after it, that's read-only.
These can look like so:
trace(...values) sqrt(x):# array_create(size, [value]): struct_get(ctx, varname:string): :alarm_set(index, value)
Function definitions may be preceded by one of the following:
-
:
: a function accesses something fromself
.
You'll see this on most instance-related functions. -
::
: a function accesses something fromself
andother
.
Currently this is only used forevent_perform
, which may needother
for collision events. -
:::
: a function accesses something fromself
and maybeother
.
This is a silly workaround for weapon functions accidentally relying onother
and will likely be replaced with a${tag}
in the future. -
${tag}
: special function tags.
These are mostly for special-case functions.
If you are parsing api.gml
, you can presume these to be
(\$\{\w+}|:+)?
and be done with it.
Function definitions may be followed by one or more of the following:
:
: the function returns something.
A function without this marker might still have a return value - this was only necessary in older GM versions where you could not reference built-in functions by doing something likevar f = instance_exists;
-
:type
: the function returns a specific type.
Very few functions have their return types marked at the moment as this information is only useful for external editors. -
#
: the function is "pure" and can be evaluated during compilation if called with constant arguments. -
$
: US English spelling -
£
: UK English spelling