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

Day 240 of 365 · Pro · Month 9: Logistics and greenhouse

SortingClass

Instead of checking every ore hash on its own, the chip sorts by SortingClass: ores, ices, resources. It catches a few special cases with hash exceptions.

Lesson 20 min Week 35

What you learn today

  • Classes like Ores and Ices
  • Classes instead of single hashes
  • Special cases

Yesterday the sorter recognised iron ore. But there is copper, gold, silver, lead, nickel, silicon, cobalt, uranium – one line for each? The game has a better answer: every item belongs to a sorting class.

The classes

SortingClass can be read from any slot just like OccupantHash. The values live in the namespace SortingClass.:

NameNumberExamples
SortingClass.Default0everything without a class of its own, e.g. empty cans
SortingClass.Kits1kits
SortingClass.Tools2tools
SortingClass.Resources3ingots, sheets, cable coils
SortingClass.Food4food
SortingClass.Clothing5suits, helmets
SortingClass.Appliances6appliances to set up
SortingClass.Atmospherics7gas canisters
SortingClass.Storage8containers
SortingClass.Ores9ores
SortingClass.Ices10ice of all kinds

Classes instead of single hashes

One line replaces a long list:

lbns class SORTER HASH("Weiche1") 0 SortingClass Average
seq target class ORES

If a new ore comes along tomorrow, the chip sorts it correctly without a change.

Special cases

The classes are not always what you expect. According to the game data Ores also contains:

  • Charcoal – it is carbon, no ore for the arc furnace.
  • Dirty ore from the deep miner – it has to go into the centrifuge first.
  • Reagent mix, i.e. slag – also a case for the centrifuge.

Conversely biomass is no ore but Resources, although it fits into the ore slot. The chip catches the exceptions with hash comparisons:

sne tmp kind DIRTY
and target target tmp

Two diverters, three destinations

A sorter has two outputs. For ores, ice and the rest two stand in a row: diverter 1 sends real ores to the smelter, everything else on to diverter 2. Diverter 2 sends ice to the ice crusher, the rest into storage.

Tip

When a chip controls two diverters, a missing diverter must not paralyse the other. That is why, with an empty or missing slot at diverter 1, the chip simply jumps on to diverter 2 instead of back to the start.

Exercise

Task

Two sorters in logic mode: “Weiche1” sends items of class Ores to output 2 – except dirty ore, reagent mix and charcoal –, everything else to output 1. “Weiche2” sends items of class Ices to output 2, the rest to output 1. Decisions only with an occupied input slot; an empty or missing diverter 1 must not hold up diverter 2.

Hints

Hint 1

Diverter 1: with an empty slot beqz tmp diverter2, not start.

Hint 2

seq target class ORES, then three exceptions with sne and and.

Hint 3

Diverter 2: seq target class ICES.

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