Jump to content

Zelda OoT: Event Flag Documentation (Just Before Zelda)


Three_Pendants
 Share

Recommended Posts

While looking around for why you could not Drop the Master Sword I stumbled upon the Event Flag section of RAM which includes (in theory) all event triggers and how they are triggered. Keep in mind however that these are only normal recordings of that section, there's no actual hacking going on there, only observing.

 

Some notes "DxX" Refers to "Digits" rather than bytes because event dealings all seem to largely in part use half-bytes. The number in parentheses is the number that is actually in the digit when it was recorded.

 

And finally, as far as I can tell. The Deku Tree Death event effect triggers which should change the map and NPC's in a meaningful manner, I could not locate. It may be that it's not in that section of RAM from 15F000 to 15F900.

 

Update of May 6th - Now Includes all event triggers from the Forest (stopping at Lon Lon Ranch) to the Field through all Castle Town events to the Castle Courtyard.

 

 

0x015F52C 
Dx1 - (4) Activates when you get caught at or in Hyrule Castle.
 
0x015F534
Dx1 (1) - Activates when you refuse the Deku Tree.
Dx2 (2) - Activates when you take the Ghoma Warp. Also changes Navi's message.
 
DX3 - (1)  Activates when speaking with Mido with Sword and Shield equipped. 
    - (2) When the Deku Tree allows Link Entrance.
    - (4) Dead Deku Tree appearance, activates when you take the Ghoma Warp, also changes Navi's message.
 
 
Dx4 - (4) Activates when speaking with Mido first time, activates Saria's second function.  After speaking with Saria in this the 4 changes to a C and her initial byte turns into a B
 
Dx5 - (1) Activates when Mido storms off after Deku Tree events (prevents him from re-spawning there)
 
Dx7 - (1) Speaking with Talon and him running off after waking him up.
 
Dx8 - (2) Speaking with Ingo at Lon Lon Ranch before speaking Talon.
    - (1) Speaking with Malon for the first time.
    - (4) Speaking with Malon at Hyrule Castle after having spoken with her once to receive Pocket Egg. Also activates the Gate Guard allowing Link access to the rest of the Castle surroundings.
    - (8) Waking Talon in front of Hyrule Castle
0015F53C - 
 
Dx1 - (8) Seen the Master Sword
Dx2 - Prelude of Light/Door of Time flags
Dx3 - ?
Dx4 - ?
Dx5 - ?
Dx6 - ?
Dx7 - (Prelude of Light Cutscene sets this spot to a 2)
 
0x15F540 -
 
Dx1 - (8) Activates when you meet Kaepora Gaebora in Hyrule Field Kokiri Forest Entrance.
 
Dx8 - (1) Activates when you defeat Ghoma but doesn't appear to do anything when nulled after she is dead?
 
 
0x15F548 
 
Dx2 - (1) Intro Cutscene to Inside Deku Tree.
 
Dx3 - (2) Intro Cutscene to Hyrule Castle
    - (8) Intro Cutscene to Temple of Time
 
Dx4 - (1) Intro Cutscene to Hyrule Field.
 
Dx7 - (1) Intro Cutscene to Lon Lon Ranch
 
0x15F54C
 
Dx1 - ?
 
Dx2 - ?
 
Dx3 - (Adds 2 (3?) to half-byte Flag that you've gone forward in time for the first time)
 
Dx4 - (2) Activates when you leave Kokiri Forest for the first time. Prevents playing of the Fairy Ocarina Cutscene.
 
0x15F550 - 
Dx1 - (2) Activates when you get Bullet Bag Upgrade in Shooting Gallery.
 
Dx5 - (2) Activates when you get Bullet Bag Upgrade in Lost Woods.
 
Dx6 - (8) Activates when you get Heart Piece from Treasure Chest Game.
 
Dx7 - (8) Activates when you get Heart Piece from Skull Kids.
 
 
0x15F558
 
Dx1 - (1) Flag for having spoken with Mido 
(When changed to a 2 Mido will repeat his spiel)
(When changed to a 3 Mido will give the abbreviated version) 
 
Dx3 - Flag for having spoken with Saria inside of her house (Before reaching Zelda)
 
Dx4 - Flag for the Saria Cutscene in Kokiri Forest with
 
Becomes a B after speaking with her after speaking with Mido.
 
Dx5 - (4) Flag for speaking with Kokiri Girl by little pond who tells you about the Deku Tree.
 
0x15F55C 
 
 
Dx2 - (1) Flag for speaking with Kokiri Girl who tells you about the Forest Training Center. 
 
Dx3 - (4) Activates when speaking with the Kokiri on the Shop Roof, prevents her from repeating the first portion of her text. 
    - (1) Activates when speaking with Kokiri Boy cutting grass with (his hands?).
 
Dx4 - (4) Activates when speaking with Kokiri Guard who won't let you leave. Prevents the first part of his text.
 
0x15F568
Dx2 - (8) ? Activates when ?first entering? Hyrule Castle
 
Dx3 - (1) ? Activates Only When speaking with Malon for the first time.
 
Dx6 - Activates when you speak with Ingo for the first time as an adult.
 
0x15F56C
 
Dx2 - (8) Activates when you first mount a horse 
 
Dx4 - Activates when you refuse Ingo's request for a race. (And will deactivate once you leave the riding section)
 
Dx7 - (8) Activates when speaking with Fado 
 
0x15F570
 
Dx1 - (2) Activates when speaking with explaining man in Blue in Castle Town Market. 
 
Dx2 - (4) Activates when speaking with laughing man in Red in Castle Town Market. 
    - (1) Activates when speaking with skinny girl in blue in Castle Town Market.
 
Dx3 - (4) Activates when speaking with old woman in Castle Town Market. 
    - (2) Activates when speaking with man who has his arms crossed in Castle Town Market. 
    - (8) Activates when speaking with Professor Shikashi in Castle Town Market. 
 
Dx4 - (1) Activates when speaking with man by Potion Shop in Castle Town Market. 
 
 
0x15F580 - 
 
Dx8 - (2) Returning Richard to Lady in Blue in Castle Town Market Night.
 
 
 
0x15F58C - 
 
Dx4 - (1) Entered the Deku Tree? (I don't see the reasoning for this) 
 
0x15F590 
 
Dx8 - A peculiar flag that when you start the game is activated, but when nulled gives you Deku Sticks on B? When you equip the Kokiri Sword (and likely any sword) This byte is cleared.
 
0x15F598
 
Dx4 - (8) - Entering Lon Lon Ranch(?)
 
Dx5 - (4) ? (Seems to activate when you enter the Hyrule Market Town, may deal something with Malon)
    - (8) ? (Seems to activate when you enter Hyrule Castle, may deal something with Malon)
 
Dx6 - (4) ?
 
Dx7 - (1) (Activated with Saria Cutscene in Kokiri Forest)
 
Dx8 - (1) Activated with Fairy Ocarina Cutscene.
 
 
Hopefully should have a more detailed list in a couple of days, hopefully.
  • Like 4
Link to comment
Share on other sites

Ah, so this is what you were talking about in #zelda the other day. 

 

I have a table of a few of these values, should be located on zsr here, in the Actor Bits table. To convert an address to a debug rom address, simply subtract A5D0, and add 15E660. In it I was able to track down most of the introduction cutscene flags, along with a few odd ones like Ruto.

Link to comment
Share on other sites

That will help a great deal MZX! I'm glad to see there is other recorded documentation on this, not to mention your concise explanations of where some triggers are added in within the scene itself is absurdly helpful!   My thought in using this is then to break on these flags, see where they are being accessed from and secure the route. Possibly so someone can use it for further hacking. (Just need to wait for someone to approve the account to download the aforementioned Bitmapping Flag.

Link to comment
Share on other sites

A slightly poor example (since you have to initiate the conversation with Zelda to start the cutscene. I'll assume you meant something more akin to Impa teaching Zelda's Lullaby and Saria teaching Saria's Song or giving the Forest Medallion) and yes that is based on actor, if I am not mistaken. As I know that everything dealing with the Master Sword is considered "Actor Cutscene" for instance. 

 

Thank you MZXrules.

Link to comment
Share on other sites

Yes. Why the heck did I think walking up to Zelda started it? D: That's what I get for trying to think after work. But yes. The Impa thing. Also, dunno if you've ever heard about the thing where you pour the fish out on top of the steps in sacred forest meadow, and when you start the cutscene where you learn Saria's Song, the fish teleports onto Saria's lap, but would it be possible to find out if that was on purpose? Sorry. I'm just throwing random stuff out. 

Link to comment
Share on other sites

Haha! That is very random. I would imagine though that is beyond the scope of simple event flags and if anything it is involved in the cutscene itself, which... we have a tool for cutscenes now made by JSA I had thought? Maybe that can shed some light into that oddity.

 

However these notes are quite interesting and from what is here it may be clear that a lot of these spots are unused and can be filled if I'm reading it right. Though I am a little bit confused on why the byte that deals with the Stalchildren is located in the Kakariko Village section.

 

Also what do these M4's and M17 portions mean? Does that mean the digit it read when you came across it?

 

This is some great work though and you got basically every Dungeon Switch as well which is quite impressive on its own.

Link to comment
Share on other sites

Wonderful! those pointers you gave me MZXRules filled in all (well, some) the one thing I was desperately worried about was the after events of the Deku Tree. They had to be there somewhere! And I noticed when I took your advice of converting codes, I saw that your Deku Tree offsets started in a fairly strange place. It seems (at least as far as I can figure) events actually start at 15E700 in Debug Rom. And that it appears that major game changing events (like the Deku Tree's death which moves a fair number of NPC's and changes their text and animations is in the section before the dungeons.

 

For instance, in the case of the Deku Tree's Death aftermath.

 

 

15E704 - 
 
Dx4 - (4) Activates when taking the Ghoma Warp
 
 
This will hopefully clear up a lot more as I move forward.
 
And another update to the actual notes, mostly just Castle Town stuff. I'll repost it in full only to assure that consistency is kept.
 

 

 15E704 - 
 
Dx4 - (4) Activates when taking the Ghoma Warp
 
15E918 - 
 
Dx8 - (2) Activates when taking the Ghoma Warp.
 
15F080
 
Dx8 - (1) Seems to appear when you enter Kokiri Shop with 40 or more Rupees.
 
15F084
 
Dx1 - Activates when you first enter Kokiri Shop? (8)
 
 
15F400 - (Optimal Lookout Point)
 
15F08C 
 
Dx4 - (2)?
Dx5 - Seems to Activate when you have 40 or more rupees and walk into the Kokiri Shop ©
 
0x015F534
Dx1 - Activates when you refuse the Deku Tree (1)
Dx2 - Activates when you take the Ghoma Warp (2)
DX3 - Activates when speaking with Mido with Sword and Shield equipped. (1)
- (3) When the Deku Tree allows Link Entrance.
- (8) Dead Deku Tree appearance, activates when you take the Ghoma Warp.
 
 
Dx4 - Activates when speaking with Mido first time, activates Saria's second function. (4) After 
 
speaking with Saria in this the 4 changes to a C and her initial byte turns into a B
 
Dx5 - (1) Activates when Mido storms off after Deku Tree events (prevents him from re-spawning there)
 
 
Dx8 - (2) Speaking with Ingo at Lon Lon Ranch before meeting Malon.
    - (1) Speaking with Malon in Hyrule Castle Town.
 
0015F53C - 
 
Dx1 - (Adds 8 to half-byte Flag that you've seen the Master Sword)
Dx2 - Prelude of Light/Door of Time flags
Dx3 - ?
Dx4 - ?
Dx5 - ?
Dx6 - ?
Dx7 - (Prelude of Light Cutscene sets this spot to a 20)
 
0x15F540 -
 
Dx1 - (8) Activates when you meet Kaepora Gaebora in Hyrule Field Kokiri Forest Entrance.
Dx8 - (1) Activates when you defeat Ghoma but doesn't appear to do anything when nulled after she is 
 
dead?
 
 
0x15F548 
 
Dx2 - (1) Intro Cutscene to Inside Deku Tree.
Dx3 - (2) Intro Cutscene to Hyrule Castle
Dx4 - (1) Intro Cutscene to Hyrule Field.
 
Dx7 - (1) Intro Cutscene to Lon Lon Ranch
0x15F54C
 
Dx1 - ?
Dx2 - ?
Dx3 - (Adds 2 (3?) to half-byte Flag that you've gone forward in time for the first time)
Dx4 - (2) Activates when you leave Kokiri Forest for the first time. Prevents playing of the Fairy 
 
Ocarina Cutscene.
 
0x15F550 - 
Dx1 - (2) Activates when you get Bullet Bag Upgrade in Shooting Gallery.
Dx5 - (2) Activates when you get Bullet Bag Upgrade in Lost Woods.
Dx7 - (8) Activates when you get Heart Piece from Skull Kids.
 
 
0x15F558
 
Dx1 - Flag for having spoken with Mido (1)
(When changed to a 2 Mido will repeat his spiel)
(When changed to a 3 Mido will give the abbreviated version) Two Functions
 
Dx3 - Flag for having spoken with Saria inside of her house (Before reaching Zelda)
 
Dx4 - Flag for the Saria Cutscene in Kokiri Forest with a 1 - Changes to a 3 when you speak to Saria, 
 
and when changed back to 1 she will repeat her initial speech.
 
(When changed to a 0 she will say "Yahoo! Hi Link!")
(When changed to a 2 she will say "Yahoo! Hi Link!" but change her idle stance)
(4 as above)
(5 seems to repeat the normal 3)
Becomes a B after speaking with her after speaking with Mido.
 
Dx5 - Flag for speaking with Kokiri Girl by little pond who tells you about the Deku Tree.(4)
 
0x15F55C 
 
 
Dx2 - Flag for speaking with Kokiri Girl who tells you about the Forest Training Center. (1)
 
Dx3 - Activates when speaking with the Kokiri on the Shop Roof, prevents her from repeating the first 
 
portion of her text. (4)
 
- Activates when speaking with Kokiri Boy cutting grass with (his hands?) and adds a (1) to the value.
 
Dx4 - Activates when speaking with Kokiri Guard who won't let you leave. Prevents the first part of his 
 
text. Adds a (4) to the value.
 
 
0x15F56C
 
Dx7 - Activates when speaking with Fado (8)
 
0x15F570
 
Dx1 - Activates when speaking with explaining man in Blue in Castle Town Market. (2)
Dx2 - Activates when speaking with laughing man in Red in Castle Town Market. (4)
    - Activates when speaking with skinny girl in blue in Castle Town Market. (1)
Dx3 - Activates when speaking with old woman in Castle Town Market. (4)
    - Activates when speaking with man who has his arms crossed in Castle Town Market. (2)
    - Activates when speaking with Professor Shikashi in Castle Town Market. (8)
Dx4 - Activates when speaking with man by Potion Shop in Castle Town Market. (1)
Dx
 
0x15F580 - 
 
Dx8 - (2) Returning Richard to Lady in Blue in Castle Town Market Night.
 
 
 
0x15F58C - 
 
Dx4 - Entered the Deku Tree? (I don't see the reasoning for this) (1)
 
0x15F590 
 
Dx8 - A peculiar flag that when you start the game is activated, but when nulled gives you Deku Sticks 
 
on B? When you equip the Kokiri Sword (and likely any sword) This byte is cleared.
 
0x15F598
 
Dx4 - (8) - Entering Lon Lon Ranch(?)
Dx5 - (4) ?
Dx6 - (4) ?
Dx7 - 1 (Activated with Saria Cutscene in Kokiri Forest)
Dx8 - (1) Activated with Fairy Ocarina Cutscene.

 

Link to comment
Share on other sites

Oh how careless of me! I even knew that (considering my efforts in recording the lists of which included Quest Items). But it's odd. In the Debug File the game has the Kokiri Emerald, but it doesn't activate the "After the Deku Tree" events along with it. But yes, it did appear that there were two flags activated by going through the Ghoma Warp. I'm not sure of what the second one was, and as you mentioned the first is the Kokiri Emerald which due to the behavior of the Debug File threw me off considerably.

Link to comment
Share on other sites

The developers probably just forced the items on in the default file, without bothering to (or not being able to?) set the correct event flags. I don't know which flags are set by default in the file, but it appears like they just stopped playing normally after opening the Deku Tree - considering how the "first entering" cutscene for Inside the Deku Tree played when entering, just like with every(?) other scene in the game - and just gave themselves all items via the inventory debug menu or so.

Link to comment
Share on other sites

  • 2 months later...

The way it is set up is very strange XDaniel. The Kokiri Emerald must be the trigger, but it's not in the normal sense, since the Event Item Check is what is truly making the forest change which is filled in by default in the Debug Rom, maybe there's another value somewhere after defeating Ghoma which I may have missed, but I am pretty sure I tried a "full clear" on the Event Flags and came up with that, I'll have to try that out...

 

Yes, even after fully clearing all of the event flags to my knowledge and leaving the Kokiri Emerald slot intact the game still reacted as if it was after Deku Tree events.

 

I also have the event identifiers from the start to Hyrule Castle Courtyard in the first post.

Link to comment
Share on other sites

I feel dumb. I just realized what was being set when leaving Gohma's warp.

 

So 15E660 is the start of what's saved right? Well, 15E734 is the start of the perm scene flags, which is 1C bytes per scene, 101 scenes in the normal game, or a minimum range of 15E734 - 15F240. I still have yet to figure out if the debug scenes can save perm flags too but that's another deal

 

Now these flags behave a little strange compared to event flags because they aren't read/written to directly. Instead, they are copied into a static working space when a scene loads and are only updated when the scene either changes or the game is saved.

 

A few of your values fall into this range.

 

The one set when leaving Gohma's room, 15E918, is the clear trigger for defeating Gohma. 15F080, 15F084, 15F08C Are actually Kokiri Forest Perm flags.

Link to comment
Share on other sites

Wow, Event Flags are a lot more far reaching than I expected. I thought I would be comfortable in these little event triggers but they expand all the way back to 15E660? That is strange and a bit disheartening. That means that what I've been keeping track of is merely... 10%? Of what's actually going on behind the scenes? But in all fairness a lot of the in between space is empty.

 

However you are 100% correct! Nulling that value allowed me to fight Ghoma as if I had lost to her (with the quick cutscene rather than the drawn out fog and looking up part).

 

What are those permanent flags in Kokiri Forest anyhow? The forest npc's still seemed to be the same (As in just after the Zelda events) 

 

 

 

 

 

Does that mean that 

Link to comment
Share on other sites

Haha! Wow, I must have been tired. I let that thought just slide off into the recesses of my mind...

 

I *think* what I was going to put was "Does that mean that most of the Kokiri Changes are truly determined by the Kokiri Emerald slot" or something to that accord.

  • Like 1
Link to comment
Share on other sites

What about the changes that are put in for Zelda's Lullaby? I know in speedrunning at least, the guy that blocks the forest off at the start actually changes positions slightly after learning the song, so your angle for escaping is slightly changed.

Link to comment
Share on other sites

According to what I could find the data for learning Zelda's Lullaby is...

 

0015F53C - 

 

Dx6 - (2) Meeting Impa in Zelda's Courtyard

 

I'll perform a quick test to see if Kokiri Forest reverts if I have that nulled...

 

No, no they do not, which means there is something deeper going on there, I'll have to investigate since I don't believe that it's just Zelda's Lullaby which causes the change.

Link to comment
Share on other sites

Ah that explains it! I was off, but only just. 

 

The changes in Kokiri Forest come from this byte...

 

0015F53C -

Dx4 - (1) Spoken with Zelda for the first time.

 

Which is very interesting because this implies you can learn Saria's Song before you learn Zelda's Lullaby. I'll have to see if that works...

 

 

EDIT: No, no it does not. This is a curious half-byte. If you save the game after listening to Zelda and go back to to Kokiri Forest the digit will reset to 0 to assure you must get Zelda's Lullaby before meeting with Saria.

Link to comment
Share on other sites

Pendants, is there a reason why skipping the light medallion cutscene doesn't give it to you, but I think when you skip other medallion scenes, it does? When do you "get" the medallion? I've found that if you skip anything between pulling the master sword for the first time and the last line with Shiek, it doesn't give it to you--you have to watch the whole thing. I don't think songs do that either.

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.