Resources and Assets

jolt_asset_load

Loads and validates an authored compound collision asset from JSON.

Loading is synchronous and allocates no physics resources. It returns a plain GML struct and does not require a running world. Authoring format versions 1 through 5 are supported.

Syntax#

Syntax
jolt_asset_load(filename);
ArgumentTypeDescription
filenameStringNon-empty path to authoring JSON within GameMaker's file sandbox, for example Included Files. The file must contain 1 to 1,048,576 bytes.

Returns#

Struct | undefined

Success returns a validated struct with configuration_id and a boxes (v1) or shapes (v2/v3) array. Read, parse or validation failures return undefined; read jolt_get_error() immediately.

Lifetime#

The result is a plain GML struct with no native handle or destroy method. Its data can create multiple bodies; it is neither a rendering model nor a .jcol shape resource.

Example#

Add your exported asset to Included Files as props/crate.jolt.json. The example assumes that file exists; body creation also requires a running world.

GML
// Include your exported authoring JSON in the game's Included Files.
var asset = jolt_asset_load("props/crate.jolt.json");
if (is_undefined(asset)) {
    var error = jolt_get_error();
    show_debug_message(error.message);
}

The example retains the asset data for later body creation and reports diagnostics on failure.

Verified operation contracts#

These contracts distinguish units, return values, errors and lifetime according to the current implementation. Check results: false, 0 and undefined can mean different things for different methods.

Symbol / ownerSignatureOperation contract
jolt_asset_loadjolt_asset_load(filename)GameMaker Included Files/sandbox path; JSON 1..1048576 bytes, no NUL, validated schema. Returns a data asset or undefined + jolt_get_error. Creates no bodies or helpers.