Table of Contents

Class Stair

Namespace
LlamaLogic.Architecture
Assembly
LlamaLogic.Architecture.dll

Represents one stair or ladder of a StairsSection

public sealed class Stair
Inheritance
Stair
Inherited Members

Remarks

Each stair is also a lot object: ObjectId is the id of its object in LotObjectsSection.

Before version 7, a stair holds a second position and its bottom level (LegacyX, LegacyZ, BottomLevel) ahead of AnchorX, AnchorZ and TopLevel, and no stages: the game derives one stage from the distance between the two positions and computes TopElevation while loading. Versions 7 through 9 hold exactly one stage and versions 10 and later a 16-bit stage count. Before version 8, Flags is stored as separate Booleans (four, or six from version 6 on).

Constructors

Stair()

Initializes a new instance of the Stair class

public Stair()

Properties

AnchorX

Gets/sets the position of the stair's centerline anchor along the lot's local X axis, in tiles

public float AnchorX { get; set; }

Property Value

float

Remarks

Its fraction is 0 or 0.5 in the lots examined. Which end of the stair it marks has not been established.

AnchorZ

Gets/sets the position of the stair's centerline anchor along the lot's local Z axis, in tiles

public float AnchorZ { get; set; }

Property Value

float

Remarks

Widening a stair in the game by one lane moved it by 0.5.

BottomLevel

Gets/sets the signed level at the bottom of the stair

public sbyte BottomLevel { get; set; }

Property Value

sbyte

Remarks

Before version 7 it is stored as a 32-bit value next to LegacyX and LegacyZ.

FirstStep

Gets/sets the first step of the stair's step range

public ushort FirstStep { get; set; }

Property Value

ushort

Remarks

Present from version 14 on. The game clamps the stages to the range FirstStep through LastStep. It is 0 through 5 in the lots examined.

Flags

Gets/sets the flags of the stair

public ushort Flags { get; set; }

Property Value

ushort

Remarks

Before version 8, bits 0 through 3 (and bits 4 and 5 from version 6 on) are stored as Booleans, and the other bits cannot be stored. The game recomputes bits 4 and 5 while loading when Unknown1 is set, and sets bits 11 and 12 when bit 0 is set and LastStep is 65,535; the meaning of the bits is otherwise unknown. Changing the railing in game set bits 0x0001 and 0x1800 together with RailingKey (in-game test).

Id

Gets/sets the id of the stair, unique among the stairs and ladders of the lot

public ushort Id { get; set; }

Property Value

ushort

LaneCount

Gets/sets the number of lanes of the stair: its width in tiles

public byte LaneCount { get; set; }

Property Value

byte

LastStep

Gets/sets the last step of the stair's step range

public ushort LastStep { get; set; }

Property Value

ushort

Remarks

Present from version 14 on. When it is 65,535, the game computes it while loading as the total step count minus 1 (or the total with bit 3 of Flags set). It was the total step count minus 1 in every in-game test (11 for 12 steps, 19 for 20).

LegacyX

Gets/sets a second position of the stair along the lot's local X axis, in tiles

public float LegacyX { get; set; }

Property Value

float

Remarks

Present before version 7. The game derives the step count of the stair's single stage from its distance to AnchorX and AnchorZ; that it marks the bottom end is a hypothesis.

LegacyZ

Gets/sets a second position of the stair along the lot's local Z axis, in tiles

public float LegacyZ { get; set; }

Property Value

float

Remarks

Present before version 7.

ObjectId

Gets/sets the id of the stair's lot object

public ulong ObjectId { get; set; }

Property Value

ulong

RailingKey

Gets/sets the key of the railing, a CTProductRailing (0x1C1CF1F7) or the null key

public ResourceKey RailingKey { get; set; }

Property Value

ResourceKey

Remarks

It is the null key for every ladder examined. Changing the railing in game set this key and bits 0x0001 and 0x1800 of Flags (in-game test).

SecondRailingKey

Gets/sets the key of the second railing, a CTProductRailing (0x1C1CF1F7) or the null key

public ResourceKey SecondRailingKey { get; set; }

Property Value

ResourceKey

Remarks

Present from version 12 on.

Stages

Gets the stages, ordered from the top

public Collection<StairStage> Stages { get; }

Property Value

Collection<StairStage>

Remarks

Versions 7 through 9 hold exactly one stage; versions before 7 hold none.

StairsKey

Gets/sets the key of the stair, a CTProductStair (0x9A20CD1C) for a stair or a CTProductLadder (0xCC09004D) for a ladder

public ResourceKey StairsKey { get; set; }

Property Value

ResourceKey

TopElevation

Gets/sets the elevation at the top of the stair

public float TopElevation { get; set; }

Property Value

float

Remarks

Present from version 7 on. The game places each stage's start at this elevation minus the steps above it times the step height; this value minus 0.25 per step is the bottom elevation in most lots examined (hypothesis: the step height is 0.25). Raising the walls of the stair's level from 3 m to 5 m changed it from 3 to 5 and the total step count from 12 to 20 (in-game test).

TopLevel

Gets/sets the signed level at the top of the stair

public int TopLevel { get; set; }

Property Value

int

Unknown1

Gets/sets the first unknown value

public bool Unknown1 { get; set; }

Property Value

bool

Remarks

It is true in every stair and ladder examined except four stairs of version 5 and four of version 15.

Unknown2

Gets/sets the second unknown value

public float Unknown2 { get; set; }

Property Value

float

Remarks

Present in versions 5 and 6. The game converts it into the stair's bottom elevation while loading (hypothesis: a legacy bottom elevation).

Unknown3

Gets/sets the third unknown value

public byte Unknown3 { get; set; }

Property Value

byte

Remarks

Present in versions 13 and 14. The game's reader discards it.

Unknown4

Gets/sets the fourth unknown value

public float Unknown4 { get; set; }

Property Value

float

Remarks

Present from version 13 on. It is 0, 0.5 or 1 in the lots examined.

Unknown5

Gets/sets the fifth unknown value

public float Unknown5 { get; set; }

Property Value

float

Remarks

Present from version 13 on. It is 0, 0.5 or 1 in the lots examined.

Unknown6

Gets/sets the sixth unknown value

public float Unknown6 { get; set; }

Property Value

float

Remarks

Present from version 13 on. It is 0 in every lot examined.

Unknown7

Gets/sets the seventh unknown value

public float Unknown7 { get; set; }

Property Value

float

Remarks

Present from version 13 on. It is 0 in every lot examined.

Unknown8

Gets/sets the eighth unknown value

public byte Unknown8 { get; set; }

Property Value

byte

Remarks

Present from version 15 on. It is 0 or 4 in the lots examined.

WallKey

Gets/sets the wall key, a CTProductWallPattern (0xD5F0F921) or the null key

public ResourceKey WallKey { get; set; }

Property Value

ResourceKey

Remarks

It is the null key for every ladder examined.