Run Code
hf_run_codeRuns a short Starlark script that calls HullForge read and write operations, returning the last expression's value. Use it for loops, filtering, and computed logic in Unreal Engine 5.
Instructions
Run a short Starlark script (Python syntax, no import, no while, no files or network) that calls HullForge, and get back only its result: the last expression's value. Use it over hf_batch when the work needs logic: loop over what a read returned, compute positions, build names, filter a large result to the few fields you need. Functions: read(tool, args) and write(tool, args) call an operation exactly as hf_read/hf_write would and return its result (a failure stops the script with the tool's message; pass check=False to get {"error": ...} back instead), search(query) returns matching operations with their arguments, log(...) records a line, json.encode/json.decode, map and filter. Tool calls that fail validation or the stage lock are refused as usual; destroying tools are refused (use hf_destroy), and so can a tool that needs the user's approval (call it on its own). At most 200 tool calls; the script's own time is capped (tool calls do not count) and its memory is capped. Afterwards it compiles every Blueprint and C++ file the script touched, like hf_batch. Example: a = read("hf_list_actors", {"class_filter": "StaticMeshActor"})["actors"]; [x["name"] for x in a if x["location"]["z"] < 0]
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>"
},
"name": "hf_run_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The Starlark script. Its last expression is the result. | |
| save | No | hf_save_all after the script succeeds. | |
| compile | No | Compile the Blueprints and C++ files the script touched and report errors. | |
| seconds | No | The script's own time limit, not counting tool calls. | |
| checkpoint | No | Optional. Set a checkpoint with this label first. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||