Lua-defined entity properties and actions (RPC system) #36
Loading…
Add table
Add a link
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?
Summary
Design and implement a system where the server-side Lua addon can define custom entity properties and actions that are advertised to the WebUI client. This makes the viewer extensible — addon authors can expose game-specific data and controls without modifying the WebUI code.
Two concepts
Properties (readable + writable values)
Things with a current value that can be displayed and optionally edited.
Built-in examples: position, angles, health, color, frozen, on fire, asleep, alive
Custom Lua examples: a money printer's stored cash, a door's lock state, an NPC's aggression level
Properties have:
*for all)Boolean properties render as checkboxes (frozen, on fire, etc.). Number/string properties render as editable fields.
Actions (fire-and-forget RPCs)
One-shot operations with no persistent state.
Examples: delete, disintegrate, break, ignite, extinguish, respawn, strip weapons
Actions have:
Actions render as buttons in the properties panel.
Protocol design
Server → Client: advertise schema
On handshake (or as a separate message when schema changes):
Server → Client: custom property values
Sent periodically (or on demand) for entities that have custom Lua-defined properties:
Client → Server: set property / invoke action
Lua API (server-side)
Client-side rendering
The properties panel dynamically renders based on the schema:
Related
Labels
feature,design