Skip to content
You're reading the docs for Railroader 0.6 (the MoW Update), currently available on the Experimental branch.

json

import json

Sandboxed JSON file loading for asset pack scripts. Available in any script that belongs to a specific pack — Data.rl, Main.rl, and a Script component loaded via scriptAsset — but not in a Script component’s inline scriptInline source, which has no owning pack to resolve paths against. Paths are relative to that pack’s root and cannot escape it.

FunctionDescription
json.load(path)Load and parse a JSON file from the asset pack, relative to the pack root. Throws if the path is absolute or outside the pack