Sly 1:WS
Data Structure | |
---|---|
Game | Sly Cooper and the Thievius Raccoonus |
Size | 0x44c |
Official Name | Yes |
WS (world state) is a data structure in Sly Cooper and the Thievius Raccoonus. It is responsible for tracking the state of a particular gameworld.
Fields
The WS struct has the following fields:
Offset | Size | Type | Name | Notes |
---|---|---|---|---|
0x0 | 0x438 | LS[9]
|
als
|
Level states array |
0x438 | 4 | int
|
ckey
|
Count of keys collected on world |
0x43c | 4 | int
|
cvault
|
Count of vaults opened on world |
0x440 | 4 | int
|
ctimed
|
Count of MTSs completed on world |
0x444 | 4 | float
|
dt
|
Time spent in world |
0x448 | 4 | int
|
fws
|
World state flags |
Level states array
Each WS
has an array of 9 LS
structs, even if the world has fewer than 9 levels. The LS structs are always aligned in the als
array so the indices are as follows:
als[0]
: Introals[1]
: Hubals[2]
-als[7]
: Platforming/minigamesals[8]
: Boss
World 1 and World 5 have fewer than 9 levels, so some some of the entries levels in their als
arrays are blank/unused.
World state flags (FWS)
The current state of the world is defined by the FWS enum, which has the following possible values:
Name | Value | Description |
---|---|---|
FWS_Visited | 0x1 | World is unlocked and can be selected in The Hideout |
FWS_Lock_0 | 0x2 | Corresponds to a particular LOCKG in the world being unlocked |
FWS_Lock_1 | 0x4 | " |
FWS_Lock_2 | 0x8 | " |
FWS_Lock_3 | 0x10 | " |
GRFWS_Lock_All | 0x1e | All of the locks in the world have been unlocked |
The fws acts as a bitfield and the game ORs the its value with the FWS enum values to check if a particular condition is met.
Note that the the order of locks is not the same for every world because each LOCKG independently decides which bit on the fws
gets set when it gets unlocked.