FF8/Variables

From Final Fantasy Inside
< FF8
Revision as of 03:10, 5 March 2015 by my_wiki>Shard

By Shard.

Game variables can be accessed using the PSHM family of script functions, and can be written to by using the POPM family of functions. Which one you use depends on the size of the variable.

The variables are all stored in save files, with the save block starting at address 0xD10 on uncompressed PC saves. The parameter to access a variable in the game scripts is basically the offset from this point in the variable block. For example, getting main story progress (word 256, which is word 0x100 in hex) just gets the two bytes starting at address 0xD10 + 0x100 = 0xE10. The varmap is continuous in memory while the game is running as well. In the en-US version of the original and SE releases (and likely most other versions), the varblock begins at 0x18fe9b8. You can use this Cheat Engine table to track them as you play.

Because we don't have a way to analyze the battle scripts yet, some of these variables (even the unused ones) may be used during battles.


Var type Var Number Description
Long 80 Counts the number of frames since the current movie started playing.
Word 84 Last area visited. This is related to SETPLACE somehow.4
Word 256 Main Story quest progress.
Byte 266 World map version? (3=Esthar locations unlocked)
Byte 300 Card Queen re-cards.
Byte 301-303 unused in fields
Byte 304-305 Timber Maniacs issues found.
Byte 306-319 unused in fields
Byte 320-332 Ultimecia Gallery related (pictures viewed?)
Byte 333 Ultimecia Armory chest flags
Byte 334 Ultimecia Castle seals. See SEALEDOFF for details.
Byte 335 Card related
Byte 336 Deling City bus related
Byte 338-340 Deling Sewer gates opened
Byte 341 Does lots of things.5
Byte 342 Deling City bus system
Byte 343 G-Garden door/event flags.
Byte 344 B-Garden / G-Garden event flags (during GvG)
Byte 345 G-Garden door/event flags.
Byte 346-349 FH Instrument (346 Zell, 347 Irvine, 348 Selphie, 349 Quistis)
Word 350-356 Health Bars (Garden mech fight)
Byte 358 Space station talk flags, Centra ruins related (beat odin?).
Byte 359 Centra ruins related (beat odin?).
Long 360 Choice of FH music.
Byte 364-368 Randomly generated code for Centra Ruins.
Byte 369-370 Ultimecia Castle flags
Byte 371 unused in fields
Byte 372-376 Ultimecia boss/timer/item flags
Byte 377 Ultimecia organ note controller
Byte 378 Centra Ruins timer (controls blackout messages from Odin)
Byte 379 unused in fields
Word 380 Squall health during mech fight.
Byte 382-383 unused in fields
Byte 384 Something about Laguna's time periods and GFs.
Byte 385 Laguna dialogue in pub. Only the +2 bit is ever set. Don't change the +1 bit.
Byte 387 Winhill progress?
Byte 388 Timber Maniacs HQ talk flags (main lobby)
Byte 389 Timber Maniacs HQ talk flags (office room)
Byte 390 Edea talk flags at her house
Byte 391 Laguna talk flags (in his office, disc 3)
Byte 392 unknown (used in Edea's house and in the Balamb Garden computer system)
Byte 393-399 unused in fields
Long 400 and 404 Related to monsters killed in Winhill, but I don't think it actually does anything. Will investigate.
Byte 408 unused in fields
Byte 409 Balamb Garden computer system
Byte 410-431 unused in fields
Byte 432 BG Main hall flags
Byte 433 Flags. Switches are assigned all over BG. No idea what any of them control.
Byte 434 Flags. Switches are assigned all over BG. No idea what any of them control.
Byte 435 Flags. Switches are assigned all over BG. No idea what any of them control.
Byte 436 Moomba friendship level in the prison? Some actions cause these flags to be set.
Byte 437 In BG on Disc 2, keeps track of who's in your party. In the prison, it's the current floor you're on.
Byte 438 Cid vs Norg event flags
Byte 439 Cid vs Norg event flags
Byte 440 Event flags. (+1 Quad ambush, +2 quad item giver, +4/+8 Infirmary helped, +16 Nida, +64 Kadowaki Elixir, +128 Training center)
Byte 441 Cid vs Norg event flags
Byte 442 Rinoa Garden tour flags
Byte 443-444 unused in fields
Byte 445-447 Propagator defeated flags
Word 448 Unknown
Byte 450-451 Various magazine/talk flags
Byte 452 Lunatic Pandora areas visited?
Byte 453-455 Moomba teleport variables
Byte 456-457 unused in fields
Byte 458-459 Used with MUSICSKIP in some Balamb Garden areas
Byte 460 Random flags (some used for Card Club)
Byte 461-473 unused in fields
Byte 488 Alternate Party Flags. Irvine +1/+16, Quistis +2/+32, Rinoa +4/+64, Zell +8/+128.1
Byte 625 Balamb visited flags (+8 Zell's room)
Byte 720 Squall's costume (0=normal, 1=student, 2=SeeD, 3=Bandage on forehead)
Byte 721 Zell's Costume (0=normal, 1=student, 2=SeeD)
Byte 722 Selphie's costume (0=normal, 1=student, 2=SeeD)
Byte 728 Does lots of things.3
Byte 730 Flags (+1 Joined Garden Festival Committee, +4 Gave Selphie tour of BG, +16 Kadowaki asks for Cid, +32 and +64 Tomb of Unknown Kind hints?, +128 Beat all card people?)
Byte 734 Split Party Flags (+1 Zell, +2 Irvine, +4 Rinoa, +8 Quistis, +16 Selphie).2

Notes

1. When the party splits in disc 2, each party member in the inactive party except Selphie has one of the eight bits changed for this variable. One member has a flag in the 4 most significant bits, and the other has a flag in the 4 least significant bits. It's done this way so that when the characters appear, they animate towards different locations in the field, rather than stacking on top of each other.
2. This byte contains flags for which characters are in Squall's party when the party splits in disc 2.
3. List of everything that 728 holds throughout the game:
  • SeeD field exam "Conduct" score (lose points when you do something wrong at Dollet).
  • Train job attempts (Timber)
  • Tomb of the Unknown King student ID.
  • Who you took to space in disc 3.
4. The field controlling restriction unlocking in Ultimecia's Castle uses this to figure out where to jump the party after they've broken a seal. It's unknown how SETPLACE actually sets this, it's not always related to the field ID or the SETPLACE parameter. This variable is also set at Balamb Garden's front gate manually.
5. List of everything that 341 holds throughout the game:
  • First flashback team
  • Selphie's current action when escaping from Deling's mansion (changes the dialogue)
  • FH Concert Crappiness
  • Something in B-Garden classroom during the paratrooper attack.