We are currently experiencing issues with email delivery; this is being resolved as quickly as possible.

stationeers.de Mod workshop · Dominik1199
DE Sign in
  1. Home
  2. IC10 academy
  3. Slots: what sits in the compartments

Chapter 6 · Memory & structure

Slots: what sits in the compartments

With ls and lbs you look inside lockers, chargers and machines.

Lesson 14 of 18 9 min

Many devices have slots: lockers, battery chargers, furnaces, hydroponics. What sits in a slot is not read with l, but with dedicated instructions and dedicated names, the LogicSlotTypes.

ls: read a slot

ls used locker 0 Occupied    # 1 if something is in slot 0
ls count locker 1 Quantity   # stack size in slot 1

Slot numbers count from 0. Which slots a device has is listed in the Stationpedia.

LogicSlotTypeMeaning
Occupiedsomething inside? (0/1)
Quantitystack size
OccupantHashprefab hash of the item
Charge, ChargeRatiocharge of a battery in the slot
Damagedamage
Warning

LogicTypes and LogicSlotTypes are two separate lists. ls … Temperature does not exist, even though the word appears in both – the checker tells you which names are valid where.

lbs: slots across the network

lbs total LOCKER 0 Quantity Sum

Reads slot 0 of all devices of the type and combines them. Here Sum is right: stack sizes really add up. With names there is lbns.

Writing

ss writes into a slot – only a few devices allow it, for example to lock a compartment. Mostly you read.

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.
A device with compartments: every slot has a number starting at 0 and its own values such as Occupied, Quantity or Charge.

Exercise

Task

A locker is attached to d0, a second identical locker sits on the network (prefab StructureStorageLocker). In an endless loop:

  • r0 = 1 if something is in slot 0 of the locker on d0
  • r1 = stack size in slot 1 of the locker on d0
  • r2 = sum of the stack sizes in slot 0 of all lockers

Hints

Hint 1

ls used locker 0 Occupied reads slot 0.

Hint 2

The LogicSlotType for the stack size is Quantity.

Hint 3

Across all lockers: lbs total LOCKER 0 Quantity Sum.

Esc
↑ ↓ selectEnter open/ opens search anywhere