Skip to content

#script

Hawkmax edited this page Oct 3, 2025 · 2 revisions

Description

The #script command simply binds a function that is going to call a scriptor script.

Syntax

mem: { "key": "#script:<path>" }
key: no implementation

Param(s)

path: Defines the path (without extension) of the script that should be called by the function.

Example

Before Apply

// some_script.scriptor located in 'datafiles/scripts/sub' folder
var text = args[0]
ilog(text)


// somewhere in gml code
var script_struct = {
     some_script: "#script:sub/some_script"
};

script_struct = rich_json_apply(script_struct)

After Late Apply

script_struct.some_script("Hello World!");

// console log would be:
345: I Hello World!

Author’s Recommendation: next read #find

Clone this wiki locally