Changes
From Final Fantasy Inside
Created page with "< FF8 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 functi..."
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 [https://www.mediafire.com/?ucolf65ewq1yoty |this Cheat Engine table] to track them as you play.
Items in grey are unused by field scripts (some of them may be used in battle scripts).
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 0-3| style="background:rgb(224,224,224)" | unused in fields (always "FF-8")
|-
! align="left" style="background:rgb(224,224,224)" | Long| style="background:rgb(224,224,224)" | 4| style="background:rgb(224,224,224)" | Steps (used to generate random encounters)
|-
! align="left" style="background:rgb(224,224,224)" | Long| style="background:rgb(224,224,224)" | 8| style="background:rgb(224,224,224)" | Payslip
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 12-15| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Signed Word
| 16
| SeeD rank points?
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 18-19| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Long
| 20
| Battles won. (Fun fact: this affects the basketball shot in Trabia.)
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 24-25| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Word
| 26
| Battles escaped.
|-
! align="left" | Word
| 28
| Enemies killed by Squall
|-
! align="left" style="background:rgb(224,224,224)" | Word| style="background:rgb(224,224,224)" | 30| style="background:rgb(224,224,224)" | Enemies killed by Zell
|-
! align="left" style="background:rgb(224,224,224)" | Word| style="background:rgb(224,224,224)" | 32| style="background:rgb(224,224,224)" | Enemies killed by Irvine
|-
! align="left" | Word
| 34
| Enemies killed by Quistis
|-
! align="left" style="background:rgb(224,224,224)" | Word| style="background:rgb(224,224,224)" | 36| style="background:rgb(224,224,224)" | Enemies killed by Rinoa
|-
! align="left" style="background:rgb(224,224,224)" | Word| style="background:rgb(224,224,224)" | 38| style="background:rgb(224,224,224)" | Enemies killed by Selphie
|-
! align="left" style="background:rgb(224,224,224)" | Word| style="background:rgb(224,224,224)" | 40| style="background:rgb(224,224,224)" | Enemies killed by Seifer
|-
! align="left" style="background:rgb(224,224,224)" | Word| style="background:rgb(224,224,224)" | 42| style="background:rgb(224,224,224)" | Enemies killed by Edea
|-
! align="left" | Word
| 44
| Squall death count
|-
! align="left" style="background:rgb(224,224,224)" | Word| style="background:rgb(224,224,224)" | 46| style="background:rgb(224,224,224)" | Zell death count
|-
! align="left" style="background:rgb(224,224,224)" | Word| style="background:rgb(224,224,224)" | 48| style="background:rgb(224,224,224)" | Irvine death count
|-
! align="left" | Word
| 50
| Quistis death count
|-
! align="left" style="background:rgb(224,224,224)" | Word| style="background:rgb(224,224,224)" | 52| style="background:rgb(224,224,224)" | Rinoa death count
|-
! align="left" style="background:rgb(224,224,224)" | Word| style="background:rgb(224,224,224)" | 54| style="background:rgb(224,224,224)" | Selphie death count
|-
! align="left" style="background:rgb(224,224,224)" | Word| style="background:rgb(224,224,224)" | 56| style="background:rgb(224,224,224)" | Seifer death count
|-
! align="left" style="background:rgb(224,224,224)" | Word| style="background:rgb(224,224,224)" | 58| style="background:rgb(224,224,224)" | Edea death count
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 60-67| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Long
| 68
| Enemies killed
|-
! align="left" | Long
| 72
| Amount of Gil the party currently has
|-
! align="left" | Long
| 76
| Amount of Gil Laguna's party has
|-
! align="left" | Long
| 80
| Counts the number of frames since the current movie started playing.
|-
! align="left" | Word
| 84
| Last area visited.
|-
! align="left" | Signed Byte
| 86
| Current car rent.
|-
! align="left" | Signed Byte
| 87
| Built-in engine variable. No idea what it does. Scripts always check if it's equal to 0 or 10. Related to music.
|-
! align="left" | Signed Byte
| 88
| Built-in engine variable. Used exclusively on save points. Never written to with field scripts. Related to Siren's Move-Find ability.
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 89-103| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" style="background:rgb(224,224,224)" | Long| style="background:rgb(224,224,224)" | 104| style="background:rgb(224,224,224)" | Seems related to SARALYDISPON/SARALYON/MUSICLOAD/PHSPOWER opcodes
|-
! align="left" style="background:rgb(224,224,224)" | Long| style="background:rgb(224,224,224)" | 108| style="background:rgb(224,224,224)" | Music related
|-
! align="left" style="background:rgb(224,224,224)" | Long| style="background:rgb(224,224,224)" | 112| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 116-147| style="background:rgb(224,224,224)" | Draw points in field
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 148-179| style="background:rgb(224,224,224)" | Draw points in worldmap
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 180-255| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Word
| 256
| Main Story quest progress.
|-
! align="left" | Byte
| 258
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 259-260| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Byte
| 261
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 262-263| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Byte
| 264
|-
! align="left" | Byte
| 265
|-
! align="left" | Byte
| 266
| World map version? (3=Esthar locations unlocked)
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 267| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Byte
| 268
|-
! align="left" | Byte
| 269
|-
! align="left" | Byte
| 270
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 271| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Byte
| 272-299
| SO MANY F***ING CARD GAME VARIABLES
|-
! align="left" | Byte
| 300
| Card Queen re-cards.
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 301-303| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Byte
| 304-305
| Timber Maniacs issues found.
|-
! align="left" style="background:rgb(200,255,200)" | Byte| style="background:rgb(200,255,200)" | 306-319| style="background:rgb(200,255,200)" | Reserved for Hacktuar / FF8Voice
|-
! align="left" | Byte
| 320-332
| Ultimecia Gallery related (pictures viewed?)
|-
! align="left" | Byte
| 333
| Ultimecia Armory chest flags
|-
! align="left" | Byte
| 334
| Ultimecia Castle seals. See [[FF8/Field/Script/Opcodes/159_SEALEDOFF|SEALEDOFF]] for details.
|-
! align="left" | Byte
| 335
| Card related
|-
! align="left" | Byte
| 336
| Deling City bus related
|-
! align="left" | Byte
| 338-340
| Deling Sewer gates opened
|-
! align="left" | Byte
| 341
| Does lots of things.<sub>5</sub>
|-
! align="left" | Byte
| 342
| Deling City bus system
|-
! align="left" | Byte
| 343
| G-Garden door/event flags.
|-
! align="left" | Byte
| 344
| B-Garden / G-Garden event flags (during GvG)
|-
! align="left" | Byte
| 345
| G-Garden door/event flags.
|-
! align="left" | Byte
| 346-349
| FH Instrument (346 Zell, 347 Irvine, 348 Selphie, 349 Quistis)
|-
! align="left" | Word
| 350-356
| Health Bars (Garden mech fight)
|-
! align="left" | Byte
| 358
| Space station talk flags, Centra ruins related (beat odin?).
|-
! align="left" | Byte
| 359
| Centra ruins related (beat odin?).
|-
! align="left" | Long
| 360
| Choice of FH music.
|-
! align="left" | Byte
| 364-368
| Randomly generated code for Centra Ruins.
|-
! align="left" | Byte
| 369-370
| Ultimecia Castle flags
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 371| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Byte
| 372-376
| Ultimecia boss/timer/item flags
|-
! align="left" | Byte
| 377
| Ultimecia organ note controller
|-
! align="left" | Byte
| 378
| Centra Ruins timer (controls blackout messages from Odin)
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 379| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Word
| 380
| Squall health during mech fight.
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 382-383| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Byte
| 384
| Something about Laguna's time periods and GFs.
|-
! align="left" | Byte
| 385
| Laguna dialogue in pub. Only the +2 bit is ever set. Don't change the +1 bit.
|-
! align="left" | Byte
| 387
| Winhill progress?
|-
! align="left" | Byte
| 388
| Timber Maniacs HQ talk flags (main lobby)
|-
! align="left" | Byte
| 389
| Timber Maniacs HQ talk flags (office room)
|-
! align="left" | Byte
| 390
| Edea talk flags at her house
|-
! align="left" | Byte
| 391
| Laguna talk flags (in his office, disc 3)
|-
! align="left" | Byte
| 392
| unknown (used in Edea's house and in the Balamb Garden computer system)
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 393-399| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Long
| 400 and 404
| Related to monsters killed in Winhill, but I don't think it actually does anything. Will investigate.
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 408| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Byte
| 409
| Balamb Garden computer system
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 410-431| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Byte
| 432
| BG Main hall flags
|-
! align="left" | Byte
| 433
| Flags. Switches are assigned all over BG. No idea what any of them control.
|-
! align="left" | Byte
| 434
| Flags. Switches are assigned all over BG. No idea what any of them control.
|-
! align="left" | Byte
| 435
| Flags. Switches are assigned all over BG. No idea what any of them control.
|-
! align="left" | Byte
| 436
| Moomba friendship level in the prison? Some actions cause these flags to be set.
|-
! align="left" | 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.
|-
! align="left" | Byte
| 438
| Cid vs Norg event flags
|-
! align="left" | Byte
| 439
| Cid vs Norg event flags
|-
! align="left" | Byte
| 440
| Event flags. (+1 Quad ambush, +2 quad item giver, +4/+8 Infirmary helped, +16 Nida, +64 Kadowaki Elixir, +128 Training center)
|-
! align="left" | Byte
| 441
| Cid vs Norg event flags
|-
! align="left" | Byte
| 442
| Rinoa Garden tour flags
|-
! align="left" style="background:rgb(200,255,200)" | Word| style="background:rgb(200,255,200)" | 443| style="background:rgb(200,255,200)" | Zell Health in Prison (Hacktuar)
|-
! align="left" | Byte
| 445-447
| Propagator defeated flags
|-
! align="left" | Word
| 448
| Unknown
|-
! align="left" | Byte
| 450-451
| Various magazine/talk flags
|-
! align="left" | Byte
| 452
| Lunatic Pandora areas visited?
|-
! align="left" | Byte
| 453-455
| Moomba teleport variables
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 456-457| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Byte
| 458-459
| Used with MUSICSKIP in some Balamb Garden areas
|-
! align="left" | Byte
| 460
| Random flags (some used for Card Club)
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 461-473| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Byte
| 474
| Random flags (some used for Card Club)
|-
! align="left" | Byte
| 475-478
| CC Group variables
|-
! align="left" | Byte
| 479
| If set to 0, disables all random battles during area loading.
|-
! align="left" | Byte
| 480
| State of students in classroom (what they're doing).
|-
! align="left" | Byte
| 481
| Controls a conversation in the cafeteria.
|-
! align="left" | Signed Word
| 482
| Error ratio of missiles
|-
! align="left" | Byte
| 484
| Missile Base progression?
|-
! align="left" | Byte
| 485
| ToUK Progression (initially 0b111010101, +2 on finish quest. No other pops)
|-
! align="left" | Byte
| 486
| ToUK room? (used to control map jumps in the maze)
|-
! align="left" | Byte
| 487
| Missile base progression (also does something in BG2F classroom)
|-
! align="left" | Byte
| 488
| Alternate Party Flags. Irvine +1/+16, Quistis +2/+32, Rinoa +4/+64, Zell +8/+128.<sub>1</sub>
|-
! align="left" | Byte
| 489
| Random talk flags?
|-
! align="left" | Byte
| 490
| Cafeteria cutscene
|-
! align="left" | Byte
| 491
| ToUK stuff
|-
! align="left" | Byte
| 492
| I think this is a door opener for the missile base if you choose a short time limit.
|-
! align="left" | Byte
| 493
| Missile base timer related?
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 494-527| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Signed Word
| 528
| Sub-story progression (it's a progression variable for individual segments of the game)
|-
! align="left" | Byte
| 530
| X-ATM related (defeated it in battle?)
|-
! align="left" | Byte
| 531
| Functionally unused. Read from at dollet, only manipulated in debug rooms.
|-
! align="left" | Byte
| 532
| Controls footstep sounds at dollet (sand to concrete)
|-
! align="left" | Byte
| 533
|-
! align="left" | Byte
| 534
|-
! align="left" | Byte
| 535
|-
! align="left" | Byte
| 536
|-
! align="left" | Byte
| 537
|-
! align="left" | Byte
| 538
|-
! align="left" | Byte
| 539
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 540-591| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Byte
| 592-593
| Seems to control angles and character facing.
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 594| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Byte
| 595
|-
! align="left" | Byte
| 596
|-
! align="left" | Byte
| 597
|-
! align="left" | Byte
| 598
|-
! align="left" | Byte
| 599
|-
! align="left" | Byte
| 600
|-
! align="left" | Byte
| 601
|-
! align="left" | Byte
| 602
|-
! align="left" | Byte
| 603
|-
! align="left" | Byte
| 604
|-
! align="left" | Byte
| 605
|-
! align="left" | Byte
| 606
|-
! align="left" | Byte
| 607
|-
! align="left" | Byte
| 608
|-
! align="left" | Byte
| 609
|-
! align="left" | Byte
| 610
|-
! align="left" | Byte
| 611
|-
! align="left" | Byte
| 612
|-
! align="left" | Byte
| 613
|-
! align="left" | Byte
| 614
|-
! align="left" | Byte
| 615
|-
! align="left" | Byte
| 616
|-
! align="left" | Byte
| 617
|-
! align="left" | Byte
| 618
|-
! align="left" | Byte
| 619
|-
! align="left" | Byte
| 620
|-
! align="left" | Byte
| 621
|-
! align="left" | Byte
| 622
|-
! align="left" | Byte
| 623
|-
! align="left" | Byte
| 624
|-
! align="left" | Byte
| 625
| Balamb visited flags (+8 Zell's room)
|-
! align="left" | Byte
| 626
|-
! align="left" | Byte
| 627
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 628| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Byte
| 629
|-
! align="left" | Byte
| 630
|-
! align="left" | Byte
| 631
|-
! align="left" | Byte
| 632
|-
! align="left" | Byte
| 633
|-
! align="left" | Word
| 634
|-
! align="left" | Byte
| 636
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 637| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Byte
| 638
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 639| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Byte
| 640
|-
! align="left" | Byte
| 641
|-
! align="left" | Byte
| 642
|-
! align="left" | Byte
| 643
|-
! align="left" | Byte
| 644
|-
! align="left" | Byte
| 645
|-
! align="left" | Byte
| 646
|-
! align="left" | Byte
| 647
|-
! align="left" | Byte
| 648
|-
! align="left" | Byte
| 649
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 650-655| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Word
| 656
|-
! align="left" | Byte
| 658
|-
! align="left" | Byte
| 659
|-
! align="left" | Byte
| 660
|-
! align="left" | Byte
| 661
|-
! align="left" | Byte
| 662
|-
! align="left" | Byte
| 663
|-
! align="left" | Byte
| 664
|-
! align="left" | Byte
| 665
|-
! align="left" | Word
| 666
|-
! align="left" | Byte
| 668
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 669-671| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Word
| 672
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 674| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Byte
| 675
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 676| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Byte
| 677
|-
! align="left" | Byte
| 678
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 679| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Byte
| 680
|-
! align="left" | Byte
| 681
|-
! align="left" | Byte
| 682
|-
! align="left" | Byte
| 683
|-
! align="left" | Byte
| 684
|-
! align="left" | Byte
| 685
|-
! align="left" | Byte
| 686
|-
! align="left" | Byte
| 687
|-
! align="left" | Byte
| 688
|-
! align="left" | Byte
| 689
|-
! align="left" | Byte
| 690
|-
! align="left" | Byte
| 691
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 692-719| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Byte
| 720
| Squall's costume (0=normal, 1=student, 2=SeeD, 3=Bandage on forehead)
|-
! align="left" | Byte
| 721
| Zell's Costume (0=normal, 1=student, 2=SeeD)
|-
! align="left" | Byte
| 722
| Selphie's costume (0=normal, 1=student, 2=SeeD)
|-
! align="left" | Byte
| 723
| Quistis' Costume (0=normal, 1=SeeD)
|-
! align="left" | Word
| 724
| Dollet mission time
|-
! align="left" | Word
| 726
|-
! align="left" | Byte
| 728
| Does lots of things.<sub>3</sub>
|-
! align="left" | Byte
| 729
|-
! align="left" | 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?)
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 731| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Word
| 732
|-
! align="left" | Byte
| 734
| Split Party Flags (+1 Zell, +2 Irvine, +4 Rinoa, +8 Quistis, +16 Selphie).<sub>2</sub>
|-
! align="left" | Byte
| 735
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 736-751| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Byte
| 752
|-
! align="left" style="background:rgb(224,224,224)" | Byte| style="background:rgb(224,224,224)" | 753-1023| style="background:rgb(224,224,224)" | unused in fields
|-
! align="left" | Byte
| Above 1023
| Temporary variables used pretty much everywhere.
|}