SmartObject
Stations players use, meaning the level's dice tables, smithies, alchemy tables, drying racks and smokehouses, and interactive prefabs placed by scripts. SmartObject.stations lists stations per dimension. SmartObject.remove uses a level edit to hide one in a dimension, take it off lists there and block new sessions, while active sessions can finish. Removing it from the global dimension removes it from all. Like other level edits, this is not saved, and SmartObject.restore reverses it. SmartObject.spawn places a bench, bed, dice table, or crafting, drying or smoking station, which each client in the dimension builds whole from the game's prefab, including furniture, solids and interaction entities. smartObject.toJSON() gives the definition for placing it again.
smartObject.spawn()
SmartObject.spawn(definition, dimension)Places one of the game's interactive prefabs for all players in a dimension. Each client builds the whole prefab there, including later arrivals. It is not saved, so place it again at startup using smartObject.toJSON(), and it is removed when the resource that created it stops. Dice tables and crafting stations placed this way appear in Dice.tables(), Crafting.stations() and SmartObject.stations() with placed: true, and behave like level stations. It is not yet confirmed whether a seat taken at a placed bench is shared between players, and NPCs do not use placed objects. Throws a TypeError for an unknown blueprint, a non-finite position or rotation, a position over 16384 from the origin, or a name over 64 bytes.
smartObject.all()
SmartObject.all(dimension)Smart objects placed with SmartObject.spawn, in all dimensions or one.
smartObject.getById()
SmartObject.getById(id)A placed smart object by network entity id, or null.
smartObject.blueprints()
SmartObject.blueprints()All that SmartObject.spawn can place, sorted by name, each { name, kind, seats }: the game's prefab path under Prefabs/; its use, 'seat', 'bed', 'dice', 'alchemy', 'smithing', 'drying' or 'smoking'; and how many characters can use it together.
smartObject.stations()
SmartObject.stations(dimension)Stations players in a dimension can use, each { id, kind, position, placed, smartObject }. `id` is the GUID as sixteen lower-case hex digits. `kind` is 'dice', 'alchemy', 'smithing', 'drying' or 'smoking'. For the level's own, `placed` is false and `smartObject` is null. Stations a level edit removed from that dimension or the global one are left out.
smartObject.remove()
SmartObject.remove(id, dimension)Removes a level station from a dimension with a level edit. Clients there stop showing it, lists skip it and new sessions are blocked, while active ones can finish. Nearby furniture is level scenery, so use LevelEdit.apply for that. The removal is not saved, and an id that is not a level station throws.
smartObject.restore()
SmartObject.restore(id, dimension)Puts back a level station that a level edit removed from a dimension. Returns false if that dimension has no such removal.
smartObject.removed()
SmartObject.removed(dimension)Level stations removed by level edits from scripts or world exports, each { id, kind, position, dimension }. A removal from the global dimension applies to all.
smartObject.position
positionThe prefab origin it was placed at.
smartObject.stationKey
stationKeyThe EntityGuid of its station part, such as a dice table's DiceInteractor, an AlchemyTable, a Smithery, or a drying rack's or smokehouse's trigger. It is sixteen lower-case hex digits in the level files' order, as in Dice.tables() and SmartObject.stations(), the same on all clients. Empty for a seat or bed.
smartObject.seats
seatsEntityGuids of its seats or sleeping places, the same on all clients, in the level files' order, like the table seats in Dice.tables().
smartObject.destroy()
destroy()Removes the placed smart object for all players.
smartObject.blueprint
blueprint: stringIts source blueprint, as from SmartObject.blueprints().
smartObject.kind
kind: stringIts use: 'seat', 'bed', 'dice', 'alchemy', 'smithing', 'drying' or 'smoking'.
smartObject.name
name: stringThe name given, or an empty string.