localplugin
Actors that live in the page only: no row, nothing on the wire.
Putting it in a scene
List it among the scene's plugins, before any plugin that draws what a local actor makes. It takes no settings in world. A local actor is a kind with a prefab in the scene, like any actor, and a client file named for the kind, <kind>.client.ts, next to the page. The actor has the same setup, tick and remove as any actor, but its row exists only in this page: it is not a row of the truth, is never sent on the wire, and no other seat sees it. Local actors are ticked in the order they were set up. One whose tick returns false has its remove called and is dropped. Any other return keeps it.
"plugins": ["loader", "scenemanager", "player", "local", "render2d"],
"prefabs": {
"toast": { "text": "", "seconds": 2 }
}
Each local actor is its own instance of the client file, so a module-level variable in it belongs to that actor alone. A page keeps every module it has imported until it is reloaded, so those variables stay with a removed actor.
Methods
Through plugins.local, from an actor or another plugin.
spawn( name, data? ) : Row
Spawns a local actor, as w.spawn spawns a row, but for this page only. The row's data is a copy of the scene's prefabs[name] with data written over it. The row comes back at once with a negative id, which no row of the truth has. A name with no prefab throws.
The actor is set up in the plugin's next afterTick, and its tick runs from the frame after. A spawn can be made from anywhere: another actor's setup on the first packet, before any plugin has ticked, an actor's tick, or a click between frames. A spawn made during an actor's tick is set up that frame, before the plugins listed after local draw it.
Properties of the plugin
rows : Row[]
The rows of the local actors that have been set up, in the order they were set up. A spawn not yet set up is not in it.
When the client closes
Each client has its own table of local actors, so a local actor a menu makes is not in the game's table. It stops being ticked the moment the menu's client stops framing. Closing a client calls remove on every local actor it set up. An actor asked for and not yet set up is never set up.