Skip to main content

Module scripting

Module scripting 

Source

Structs§

ScriptAttachment
One script file attached to an entity. path is project-root-relative, the same convention crate::world::Renderable’s serialized form uses for its own asset paths.
ScriptError
One error from compiling, starting, or running a script — never fatal to the editor, just something to report and move past (see ScriptRuntime::update_entity).
ScriptList
The scripts attached to one entity, executed front-to-back. Doubles as both the ECS component and the serialized form — unlike crate::world::Renderable, a script has no live GPU-backed counterpart that needs a separate runtime representation.
ScriptRuntime
Compiles and caches one [AST] per unique script path (shared across every entity that attaches the same script) and owns each (entity, attachment index)’s running Rhai Scope. Created when the editor’s Play mode starts and dropped when it stops — nothing here is meant to survive a Stop; see the implementation plan’s “Play/Stop snapshot” note for why script state resetting on Stop is load-bearing, not just convenient.