Sly 1:LS: Difference between revisions

From SlyMods
Jump to navigation Jump to search
Content added Content deleted
m (Fixed categories)
(Updated hatnote)
Tags: Mobile edit Mobile web edit Visual edit
Line 1: Line 1:
{{hatnote|This article is about the states of Sly 1 levels. For other other game state tracking mechanics, see [[Game state (disambiguation)]].}}
{{hatnote|This article is about the states of Sly 1 levels. For the data structure used to track the game state in Sly 2 and 3, see [[DAG]].}}
'''LS''' ('''L'''evel '''S'''tate) is a data structure in {{Sly 1}}. It is used for storing the current state of each level in the [[GS|Game State]].
'''LS''' ('''L'''evel '''S'''tate) is a data structure in {{Sly 1}}. It is used for storing the current state of each level in the [[GS|Game State]].



Revision as of 03:02, 12 July 2022

LS (Level State) is a data structure in Sly Cooper and the Thievius Raccoonus. It is used for storing the current state of each level in the Game State.

Structure

The structure of LS is as follows:

Level State Flags

The current state of the level is represented using the FLS enum, which has the following possible values:

uSuck

Each individual has a uSuck value used for scaling the difficulty level. There is also a second value related to suck stored at offset 0x10, but the purpose of that variable is currently unknown.

Dialogue Flags

Each level has an array for storing up to 12 dialogue flags. Each of these flags corresponds to a dialog/cutscene where Bentley talks to Sly.

If a dialog flag is set to 0, that dialog will automatically play when Sly enters the relevant trigger volume. If the flag is set to 1, then the trigger volume instead causes the L1 popup blot appears in the lower-left corner, giving the option to replay the dialog.

Scene Variables

Each LS has an array for storing up to 4 scene variables. A scene variable takes up 8 bytes, consisting of an ID and value pair. For instance, in The Swamp’s Dark Center, ID 0x693 corresponds to the state of the left candle on the purple voodoo gate, and a value of 1 corresponds to that candle being broken.

When the game sets a scene variable it uses the first available slot on the LS. When the game reads the scene variables, it calls a function that takes a map ID and an variable ID, which iterates over the array of scene flags for that map’s LS and stops when it finds a match.