stationeers.de Mod workshop · Dominik1199
DE Sign in
  1. Home
  2. IC10 academy
  3. Day 93

Day 93 of 365 · Advanced · Month 4: Network in detail

Writing to slots: ss and sbs

With ss and sbs you switch what sits in a slot: the valve of a gas canister, the appliances on a bench. Only On, Open and Lock are writable.

Lesson 13 min Week 14

What you learn today

  • Which slots are writable
  • ss for one device
  • sbs for all of a type

So far you have only read slots. A few devices also let you write into a slot: then you switch not the device but whatever sits inside. The helmet in the suit storage, the valve of a gas canister, the appliances on a bench.

Which slots are writable

Whether a slot is writable depends on the kind of slot, not on its content. In the game code there are exactly three LogicSlotTypes for it:

LogicSlotTypewritable in slots forexample device
Onhelmet, tool, appliancePowered Bench, slots 0 and 1
Openhelmet, gas canister, liquid canisterGas Tank Storage, slot 0
LockhelmetSuit Storage, slot 0

A locker has slots of no particular kind. If you write into one, the chip reports IncorrectLogicSlotType. If a device cannot write slots at all, the error is called DeviceNotSlotWriteable.

If nothing sits in the slot, writing simply does nothing, and there is no error either.

ss: one device

ss writes into a slot of one device. Like s it needs a pin, a register with a ReferenceId or db. It knows no names:

alias canisters d0
ss canisters 0 Open 1       # open the valve of the canister in slot 0

That is why this lesson uses a pin for once.

sbs: all of a type

sbs writes the same slot on all devices of a type on the network:

sbs BENCH 0 On 0            # appliance 1 on all benches off
sbs BENCH 1 On 0            # appliance 2 on all benches off

There is no sbns with a name. If you only want to hit certain devices, use ss with a pin or a ReferenceId.

Warning

sbs really hits every device of this type on the data network, including the bench in the lab next door. If one of them cannot write the slot, the instruction aborts with an error.

Tip

ss only writes when the value changes. You can call it every tick without the device switching over and over.

Diagram

A locker with numbered slots Locker (d0) Slot 0 Iron ore Occ 1 Qty 5 Slot 1 Copper ore Occ 1 Qty 12 Slot 2 empty Occ 0 Qty 0 Slot 3 empty Occ 0 Qty 0 ls r0 d0 0 Occupied r0 = 1 ls r1 d0 1 Quantity r1 = 12 Slots count from 0. Values in a slot are called LogicSlotTypes.
ss writes to a slot of one device, sbs to the same slot of all devices of a type. Whether a slot is writable depends on its kind.

Exercise

Task

A Gas Tank Storage (StructureGasTankStorage) with a gas canister in slot 0 is attached to d0. Two Powered Benches (StructureBench) with two appliances each stand on the network.

  • lever “Notluft” on: open the valve of the canister (Open in slot 0), otherwise close it
  • lever “Werkstatt” on: the appliances in slots 0 and 1 of all benches on, otherwise off
  • if the levers are missing: valve closed, appliances off

Hints

Hint 1

Read the levers with lbn … Open Average and turn NaN into 0 with sgtz.

Hint 2

Valve: ss canisters 0 Open emergency.

Hint 3

Benches: sbs BENCH 0 On workshop and the same for slot 1.

Quiz

4 questions. You pass from 60 % – the server does the grading.

Complete the day

  • Passed the simulator exercise
  • Passed the quiz with at least 60 %

Without an account progress is saved in this browser only.

Report a mistake in this lesson

Please sign in to report. Sign in

Esc
↑ ↓ selectEnter open/ opens search anywhere