Smart things
For creatorsAdd-on 2.2.2+
A smart thing says what can be done with it: a sign to flip, a bell to ring, a box to carry, a bench to sit on, a shelf to put things on. Players use it with E, a click, a tap or a controller’s ray. The people who live and work in your scene use the very same thing in their day. Vehicles, engines, computers and the things in a home are all smart things underneath, so what you learn here applies everywhere.
How players use one
Section titled “How players use one”- Aim. A smart thing within reach (2.5 m unless you change it) and roughly where the player looks is the target. A prompt says what the use is: E · Flip the sign.
- Use. E, a click or a tap on the thing, or a headset controller’s ray on it.
- Carry. Hands free, a thing you can carry reads E · Pick up the box. Carrying it, a place that takes it reads E · Put the box on the counter. With nothing aimed at, G (or a controller’s squeeze) drops it in front: G · Drop the box.
- Sit. A seat reads E · Sit on the bench. Seated, E · Stand up.
- Busy. A thing someone else is using says so and waits.
The right-click menu (on a page) and a held trigger (in a headset) offer the same use. More for players is on using things.
Make a smart thing
Section titled “Make a smart thing”- Select the object and open Properties ▸ Object ▸ Simulacrum.
- Choose Add Component ▸ Smart Objects ▸ Smart Object. Its settings appear in the Components panel as checkboxes, numbers and lists; a + row adds a setting it does not have yet.
- Set
smartto its kind (sign,bell,lamp),smart.useto what it does (flip,ring) andsmart.use.labelto the prompt (Flip the sign). - For a thing with states, set
smart.states(open,closed). Each use moves it to the next state. - Press Play and walk up to it.
A use changes the thing’s state and its look. In a shared room every player sees it change.
Settings
Section titled “Settings”| Tag | Values | What it does |
|---|---|---|
smart |
a kind | Makes it a smart thing. People and game logic find it by its kind |
smart.use · smart.use.label |
a use · the prompt | What it does, and what the prompt and the right-click menu call it |
smart.states · smart.state |
a,b,… · one of them |
Its states in order, and the one it starts in. None: a thing without states, like a bell |
smart.use.to |
next (default) · a state |
What a use does to its state |
smart.use.label.<state> |
text | The prompt while it is in that state: Open the door closed, Close the door open |
smart.use.who |
both (default) · player · npc |
Who may use it. player keeps it out of people’s days |
smart.reach |
metres (2.5) | How near a player must be |
smart.use.secs |
seconds | How long a person takes to use it |
smart.use.noise |
a kind | A noise its use makes, which people within hearing notice |
smart.aim |
ray |
Only a direct look aims at it, so a big thing across the street doesn’t take E from what is in front of you |
Its look in each state, and where a user stands
Section titled “Its look in each state, and where a user stands”Two kinds of child object finish a smart thing:
- A look (Add Component ▸ Smart Objects ▸ State Look): a child tagged
smart.show = <state>is shown only in that state, like a sign’s green OPEN board and red CLOSED board. - A slot (Add Component ▸ Smart Objects ▸ Use Spot): an Empty tagged
smart.slot = 1is where a person stands to use it, facing the way the Empty faces.
Things to carry
Section titled “Things to carry”Add Component ▸ Items ▸ Carryable sets smart.carry, the grip:
smart.carry |
How it is held |
|---|---|
hand |
In one hand, at the side: something small |
both |
In both arms, in front at the waist: a box |
pistol · rifle · bat |
As that weapon is held |
The thing’s children move with it, so a box keeps its tape. While the player hero carries something, its weapon is put away. A thing
tagged smart.weapon goes into the hero’s weapons instead: see weapons. Items made to be held and worked in the
hand are on hand items.
Places and spots
Section titled “Places and spots”A place is a thing other things are set on: a shelf, a counter, a rack, a desk.
- On the place: Add Component ▸ Smart Objects ▸ Place, and set
smart.holdsto the kinds it takes (box,crate), or*for anything. - Optional: for each spot, add a child Empty with Add Component ▸ Smart Objects ▸ Place Spot (
smart.put = 1). A put thing’s bottom sits on the Empty, turned its way. Without spots, things go on the middle of the place’s top.
Add Component ▸ Smart Objects ▸ Seat (smart.seat = 1) makes a thing somewhere to sit. The sitter’s feet stand smart.seat.depth in front of its
middle (0.40 m), facing the way the seat faces; a child slot overrides that. A seat top about 0.42 m high fits the characters’ bodies. A seat holds
one sitter at a time.
Shared things and whose things
Section titled “Shared things and whose things”- One user at a time. A thing in use is claimed until its user lets it go.
- Many at once.
smart.shared = 1lets any number use it together, like a household’s bed or kitchen. - Someone’s own.
smart.of = <a home>makes it belong to that home: only the people who live there use it. Untagged, it is anyone’s, like a park’s picnic tables. - In a shared room, every player sees a thing used, carried off and set down.
What it does for people
Section titled “What it does for people”People choose things by what they do for them. smart.use.satisfies lists the needs a use eases, with points out of 100:
energy:15, fun:5The needs are energy, hunger, hygiene, fun, social and comfort. A thing that eases nothing is never picked when a person
chooses what to do. How people live their day around your things is on people. A character you script uses,
takes, puts down and sits on things with tasks of its own: the NPC graphs tutorial.
What a person does when they use it
Section titled “What a person does when they use it”A smart thing can bring the steps of its own use with it, so the people who use it need no changes. Select the thing and open
Properties ▸ Object ▸ Simulacrum ▸ Smart Use, which shows for a smart thing. Use Behaviour picks a person graph; New makes
a starter one, in which the person uses the thing and is done, and gives it to the thing. Open it in the node editor as a
Simulacrum Person graph to add steps. Its done state means the use was made, and fail that it was not.
Game logic
Section titled “Game logic”A use, a take or a put fires a behaviour graph’s On Interact, with the thing’s name as the target. With smart.use.by = graph, the
use is handed to the graph, which decides what happens. See game logic.
Kinds the world already knows
Section titled “Kinds the world already knows”Some kinds come with their own behaviour. Their use is handled for you (smart.use.by = module), and their pages show the tags:
| Kind | What it is | Page |
|---|---|---|
a vehicle (car …) |
E gets in | Make a vehicle |
any kind, with smart.use = refuel |
A fuel pump | Make a vehicle |
engine · engine-stand · part-<group> · socket · dyno |
An engine, its stand, its parts, where parts go, a chassis dyno | Engines |
bay |
A break-down bay | Workplaces |
terminal · panel · desk |
A computer, an electrical panel, a desk | Devices and power |
bed, shower, kitchen, tv, timeclock … |
The things a day is lived at | People |
Doors and buttons work as smart things too, and so do the controls of a machine: moving parts.
Things an owner may move
Section titled “Things an owner may move”In a place they own, a player signed in to MegaCity can pick up a smart thing and set it somewhere else. Computers, desks and electrical panels move by default.
| Tag | Where | Values | What it does |
|---|---|---|---|
place.home |
the scene | the place’s address | Whose place this is |
place.movable |
a smart thing | 1 · 0 |
1: it moves. 0: it never moves |
The owner aims at the thing and sees M · Move the desk. Then:
| Key | What it does |
|---|---|
| M | Lift it. It follows your view across the floor, with what stands on it |
| R · Shift+R | Turn it 15° one way or the other |
| T | Snap it to a 25 cm grid |
| E | Set it down. It glows red while it overlaps something, and won’t set down there |
| Esc | Put it back where it was |
The thing stays where it was set the next time the scene opens in that browser.
Limits
Section titled “Limits”- A built-in use needs its feature. A thing tagged
smart.use.by = moduledoes nothing unless one of the kinds in the table above takes it, set up as its page says. - Something a feature uses is used, not picked up. A carryable computer opens when used; its own menu offers to pick it up.
- A moved thing stays moved only for you. Other visitors, and your other devices, still see the original layout.
place.movable = 1works only on a smart thing. It also turns only about the vertical, and nothing in someone’s hands moves.