In-world Luau scripting for prims: host, editor, and the vf* command set #38
Labels
No labels
agent
agent:ci
agent:done
agent:failed
agent:needs-input
agent:refined
agent:refining
agent:running
agent:skip
autonomous
driven
local
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jeroen/cartopolis#38
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Prims are static. There is no way to make one respond to a touch, move itself,
or say anything — the sim owns prim state (
crates/simulator/src/state.rs) andnothing can change it except a client edit.
Doing this needs three things settled: an engine whose runaway scripts can be
descheduled rather than killed, a per-region capacity budget so one author
cannot exhaust a region, and an editor — a script with no console is a text box
that swallows its own compile errors.
Approach
crates/simulator/src/scripting.rs— one sandboxed Luau VM per scripted primon a dedicated OS thread, talking to the tick loop over channels. Scheduling is
a per-region fuel bank spent round-robin, with
set_interruptreturningVmState::Yieldso an over-budget slice suspends and resumes (:445stripsrequire/loadstring;:505sets the memory ceiling from the interpreter'smeasured baseline).
max_prims/max_scriptsper region, and aprim_scriptstable —source is not a
PrimDtocolumn, or every snapshot would carry it 20x/s.crates/core/src/script_api.rs:99— the 25-call catalogue, shared so theserver implements and the editor documents one list.
crates/viberfox/src/systems/gui/script_editor.rs:229— the panel, with thereference at
:167rendered from that catalogue.Acceptance criteria
while true do endsuspends and stays resumable; neighbours still run.on_touch;vfSayreaches local chat by distance.Verification
cargo test -p viberfox_simulator(31 unit + 8 integration over loopback TCP),cargo test -p viberfox_core,cargo test -p viberfox,cargo check --workspace --all-targets,cargo fmt --check. All green.Needs a workstation: the editor panel and its reference UI have never been
rendered — this container has no GPU. No
cargo shotspreset covers a panel.Out of scope
vfSetPosdurable horizontally. x/z re-derives from the geo anchor andthe projection is client-side (
prim_geo::place_geo_prims), so horizontalmotion lasts until the map re-anchors. Fixing it changes every prim edit.
— fine now, and the number to revisit for thousands.
PR: https://code.garage44.eu/jeroen/viberfox/compare/main...feat/prim-scripting-luau
Branch:
feat/prim-scripting-luau