Sly 1:GS: Difference between revisions

From SlyMods
Jump to navigation Jump to search
Content added Content deleted
(Created article for data structure)
 
m (→‎World States: Fixed typo)
Line 16: Line 16:
{{main|WS}}
{{main|WS}}


The GS struct stores an array of 5 WS struts, one for each world. The order is as follows:
The GS struct stores an array of 5 WS structs, one for each world. The order is as follows:
* 0: Intro
* 0: Intro
* 1: Underwater
* 1: Underwater

Revision as of 02:17, 12 July 2022

GS (Game State) is a data structure in Sly 1. It stores an array of World States, which in turn each store an array of Level States.

Structure

The GS struct is declared as follows:

Game State Flags

The current game state is represented the FGS enum, which has the following possible values:

World States

The GS struct stores an array of 5 WS structs, one for each world. The order is as follows:

  • 0: Intro
  • 1: Underwater
  • 2: Mesa
  • 3: Voodoo
  • 4: Snow
  • 5: Clockwerk

Unlockable flags

There are three[check] sets of flags after the world states.

Powerup flags

There are 16 bits for the powerup flags, with each bit corresponding to a particular powerup being unlocked.

Cutscene flags

There are 16 bits for the cutscene flags, with each bit corresponding to a particular cutscene being unlocked.

GRFGS

There is a set of flags defined by the GRFGS enum whose purpose is unclear. At least some of the bits appear to be used for game settings.