PALACEGRID / CREATOR WIKI Open designer

CREATOR REFERENCE

Make your world
do things.

A home for 3D world events, commands and examples.

OBJECT CLICK SCRIPTS

Object click scripts, date helpers and custom clock formats are available in the hosted designer, Solo preview and published rooms. AVAILABLE means supported by the hosted service. Entries marked DRAFT, including trigger entry events, remain proposals and cannot run.

Available now

SCRIPTS & DISPLAYS

Try the scripting playground ↗: click the welcome sign to change its text, push the movable prop and click it to reset its position, or click the counter to add one. Shift-click the counter to restore its saved initial value. Everyone in the room sees the same text, counter and physics results.

In the designer, place a Display from the catalogue, or select any furniture or uploaded model and enable Display. Choose text, clock or counter. Physics works independently, so a screen can also move.

To return a moving object, open the room’s Menu and use the reset control. It first selects the nearest movable object; choose another using Reset target. Reset works anywhere in that room, including while seated, with a shared five-second cooldown per object. Live motion and counter clicks never change the saved design.

The kick control appears while standing within reach of a sphere ahead. Move close and use the button or Space.

One room, several Palace entrances. A room belongs to its account owners. When they connect it to several Palaces, everyone joins one live room and sees the same visitors, public speech, displays, physics and script effects. Publishing updates that room for every entrance. Each entrance retains its Palace address and native room number; copying the room creates a new room with independent owners, connections and live state. Older installations stay independent until their owner explicitly connects them through the room library.

Native public speech is attributed to the joined player, with Palace user numbers scoped to their own entrance. Only the speaker’s embed forwards a public message. Private Palace messages are never broadcast into the 3D room. Additional owners must accept an invitation while signed in with its intended verified email; a public visitor or a copied template does not grant editing permission.

One object, optional capabilities

A ball, chair, uploaded model or screen is an ordinary placed object with its own placement ID. Model controls appearance. Physics adds movement with a box or sphere collider, mass, gravity, bounce and friction. Display adds a text panel. Scripts responds to clicks on these same objects.

The model’s name does not define what it can do. Enable Physics on any model to move and reset it; choose Sphere to make it kickable. A sphere around an arbitrary model encloses its largest dimension and must fit inside the room at its starting position. Existing ball presets keep their fitted collider and tuned feel.

Display modes: Text shows up to 80 characters; Clock shows live time in 24-hour, 12-hour AM/PM or a custom date/time format with a named time zone; Counter shows an optional caption and a shared value from 0 to 999999. Existing clocks keep their 24-hour UTC default. Counters start from the saved initial value when a room session is created; live values are not persistent scores.

The single-sided panel sits on the front of the object and follows its movement and rotation. Text is plain text; HTML and images are not supported. Physics suspends the model’s ordinary built-in actions, such as sitting. Disable Physics to restore them.

The scripting API uses object for the attached object. Trigger zones, automatic goals and references to other objects remain planned; the draft on.enter entry is not implemented.

Package a model with colour choices

AVAILABLE

One GLB can hold one model and several named appearances, such as a chair in Green, Pink, Rose, Tan and White. These are material variants. Colour images must match the model’s existing texture layout. Normal, roughness and other surface maps work together with a colour texture; they are not separate colour choices.

Prepare the GLB in Blender

  1. Import the original model. Make a separate copy of its material for each colour and give each copy a clear name.
  2. For each material, connect the matching colour image to Base Color. Keep the model’s texture coordinates and its other surface maps.
  3. Enable the glTF Variants interface in the glTF 2.0 add-on preferences. Open the glTF Variants tab in the 3D View sidebar.
  4. Add a named variant with +. Put that colour’s material in the model’s existing material slot, then choose Assign to Variant. Repeat for each colour. Use Assign as Original for the default appearance.
  5. Choose File → Export → glTF 2.0 and glTF Binary (.glb). Export the model with its materials, embedded textures and material variants.

See the official Blender glTF exporter guide. To request a prepared model from its creator, ask: Please export one GLB with all colours embedded as named KHR_materials_variants.

Choose a colour in Palacegrid

Upload the GLB through My models, add it to your room and select the placed object. Under Colour, choose a swatch or Original. Each copy can have its own colour. Position, size and Actions stay with the object. Use Solo preview to check the result, then save and publish through the usual room controls.

Palacegrid supports up to eight embedded variants per uploaded model, within the existing model and texture budgets. If Colour is missing, check that the exported GLB contains material variants. The editor selects embedded variants; it does not yet package separate image files into a GLB. Normal uploads automatically correct unnecessary transparency on fully opaque materials while preserving actual transparency.

Technical details: object.modelVariant authoring setting.

Click script workflow

AVAILABLE

Open Pieces → Scripts on any furniture or uploaded model in the designer. Choose a starter or write a click handler, apply it, then use Solo preview. For working examples, choose New room → Scripting playground. Walk within 2.5 metres and click the object. Scripts can change text, set or add to a counter, or reset the object’s Physics. An attached script replaces its ordinary click action, including Shift-click counter reset.

Starters are Click → welcome message, Click → add one point, Click → reset position and Click → date and time. Applying an unchanged starter can add its missing Display or Physics capability within room limits. An existing incompatible Display mode needs an explicit change; an edited starter does not add capabilities automatically.

Check script validates without attaching. Apply attaches validated source. Valid pending changes also apply when changing selection, saving or opening Solo preview. Invalid changes stay in the local draft and block those actions. Discard edits restores the attached source; Remove script removes the handler and keeps Display and Physics settings. Copying objects and arrangements retains scripts. Solo preview tests a private draft; save and publish through the designer to update a connected room.

The language

AVAILABLE

A script contains exactly one on.click(({ object }) => { ... }); handler. Inside it, use initialized let and const variables, assignment to let and if / else if / else with braced bodies. Standalone blocks are unsupported. Separate declarations, assignments and command calls with semicolons; a semicolon immediately before a closing brace and the final handler semicolon are optional. Variables are block scoped and reset for every click. Values are strings, finite numbers and booleans. Names are case sensitive.

Operators: + - * / %, unary ! + -, strict === !==, < <= > >= and boolean && ||. Conditions must be boolean; arithmetic does not coerce types. Addition joins two strings or adds two numbers. Use parentheses and ordinary single/double quoted strings; comments are supported.

The date helpers read the event’s captured room time and return primitives. For example, object.display.set(date.format(date.now(), "hh:mm:ss A", "America/New_York")); writes the accepted click time to a text Display. It is a snapshot; choose Display mode Clock for continuous live time.

Each event can use at most eight distinct date-format pattern/time-zone pairs, including cache hits. A compiled script retains at most eight reusable formatters and releases them with its binding; it stores no formatted results or persistent script variables.

Numbers use decimal notation, optionally a decimal point and exponent; hex, binary and octal literals are unsupported. Strings accept escapes \n \r \t \b \f \v \0 \\ \" \', two-digit \xHH and four-digit \uHHHH. A string cannot contain an unescaped newline. Line comments // and block comments /* ... */ are supported. Same-type comparisons accept two numbers or two strings; boolean operators require booleans and short-circuit.

Only the documented commands and helpers are callable. Loops, extra functions, imports, browser/Node globals, prototype access, arrays, arbitrary properties, network access, timers, template strings, persistent variables and reads of object/display state are unsupported. Scripts cannot reach other objects or visitors. The general JavaScript Date constructor is not exposed. Syntax errors include a line and column.

Saving evaluates using event time 0, checks capabilities used in every branch and validates effects in the executed branch. Time-dependent branches still validate at the actual click time. Parser and interpreter errors include line and column; capability and room-state errors may be plain messages. Effects validate together before applying any change. Only successful scripted clicks consume the shared click cooldown.

Live clock formats

AVAILABLE

Live clock formats and the date helpers below share the same bounded formatting rules. Existing clocks keep HH:mm:ss in UTC until their presentation is changed.

In Pieces → Display → Clock, choose 24-hour, 12-hour or Custom. Use a named time zone such as UTC, America/New_York or Europe/London. Daylight saving follows that zone. All visitors use shared room time with the same saved presentation.

Tokens: YYYY year, MM month, DD day, ddd English weekday, HH 00–23 hours, hh 01–12 hours, mm minutes, ss seconds and A AM/PM. Wrap literal letters in brackets: [Today] ddd YYYY-MM-DD hh:mm A. Patterns and possible output are limited to 80 characters.

The same tokens work in date.format, limited to eight distinct pattern/time-zone pairs per script event. Custom patterns are data, not JavaScript; they cannot access a browser or run extra callbacks. Clocks check at most once per changed second and redraw only when the visible result changes.

Small, bounded additions

Each room allows 64 placed objects, 16 moving physics objects and 8 displays. These limits keep simulation, messages and graphics work bounded. Model complexity and device performance still affect frame rate.

Each display uses one small unlit panel and a fixed 512 × 256 texture. Text and counters redraw only when their contents change; clocks check each changed second and redraw only changed visible text. Clocks use the shared room time without extra clock messages. Hidden views pause rendering and display resources are released when removed.

At most 16 objects can have scripts. Each script is limited to 4096 characters, 1024 tokens and 32 nested parser levels; each click to 256 interpreter instructions and 8 effects. A shared 250-millisecond cooldown applies per scripted object. Strings, including intermediate strings, are at most 80 UTF-16 characters. Effects validate together before changing shared state; a failure applies none.

Physics uses a fixed 60 Hz simulation with a bounded catch-up window. Shared state snapshots run at 20 Hz. Scripts add no polling loop or timer. Closing a room disposes script state. Display values reset to authored defaults in a new room session.

Room transport & errors

The transport entries describe WebSocket messages for client integrators. They are not commands to paste into an object script. Join the room first and use its welcome feature flags: objectResetSupported, ballResetSupported, displaySupported and scriptSupported. Clients send intent; the server resolves identity, capabilities and current positions.

Messages are limited to 2048 bytes. Each connection has a burst allowance of 180 messages, refilling at 120 per second; exceeding it closes the connection with code 1008. Invalid commands receive { type: "error", message } at most once every 500 milliseconds; 12 invalid commands cumulatively close the connection with code 1008. Solo preview shares command validation but does not use these outer WebSocket limits.

API INDEX

Events & commands