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:
| LogicSlotType | writable in slots for | example device |
|---|---|---|
On | helmet, tool, appliance | Powered Bench, slots 0 and 1 |
Open | helmet, gas canister, liquid canister | Gas Tank Storage, slot 0 |
Lock | helmet | Suit 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.
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.
ss only writes when the value changes. You can call it every tick without the device switching over and over.
Diagram
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 (
Openin 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