Jump to content

Zelda OoT: How to switch item checks on Actors (Actor Trading Checks Complete!)


Three_Pendants
 Share

Recommended Posts

For a very, very long time this question has stumped me. "What decides how NPC's react to items?" Theories ran through my head that half of it was in Link's Actor or code.zasm and the other half in the receiving actor or that there was only a check in the Actor and that the data was dealt with differently, but I can finally say what the answer is. The NPC has both the Item Reaction and Item Check within their own files and in a heavily unexpected format...

 

Every Icon in the game has an adjoining action that must go with it. For instance though Zelda's Letter is item 23, the action associated with it is 2B. Clearly then, to my mind, the check must be made against whether 2B is being used within the vicinity of the actor, but that was not the case. My research focused at first around the Poe Salesman, but I thought I would have better understanding if I looked at the Death Mountain Gate Guard. 

 

After weeks of frustration and little to show for my efforts it was made clear that I was not looking for a 2B value. I didn't know what I was looking for, then when looking through the guard's file I stumbled upon a 24010001 located near his text. When changed this occurred...

 

 

Posted Image

 

The gate guard never ever says this, to my knowledge. He does not respond this way to any mask and makes no response to other items. So this was clearly a beta bit. In any case I knew I was on the right track, but did not know what the track was. At first I had thought this was only some internal check that failed because I still couldn't get him to react to any other item and so I ignored it, only to realize later that this 0001 was an Internal or Secondary Item Identifier. In this case 002B was being read as 0001. i had a theory that this was the case before this, but found very little to back up the theory.

 

Then I checked in other actor situations like Talon and Grog (guy in Lost Woods) and indeed, they were checking against a 0003 and a 0007 respectively. 

 

With this knowledge I realized that event items must fall under their own index as far as the game is concerned.

0001 Zelda's Letter 
0002 Weird Egg
0003 Cucco 
---------
0007 Cojiro
 
Knowing that Grog had the smallest actor (ovl_en_Hs) of those who receive items I searched his file for plain 0007 and found 3 results. One was false, the other was his internal check, but the third was the external check! I had finally cracked the code on giving NPC items!
 
240100XX was the internal identifier (It must be a remnant of older coding as it serves no purpose in the final game)
240700XX was the external identifier. When these two match the NPC will react to the item and portray their proper event. Expect ROM locations soon!
 
Posted Image
 
 
 
 
  • Like 5
Link to comment
Share on other sites

Here's the first part of allowing any normal item receiver to receive a different item...
 
YET TO FIND - 
 
It seems that King Zora and Biggoron use a different format, so finding their Item Correlations will take a little bit more effort to locate. 
 
 
 
-----------------------------------------------------
013F ovl_En_Hs (Carpenter's Son)
 
ROM: 0xE255BD - (24010007) - Responding to Cojiro
ROM: 0xE256B8 - (24070007) - Showing him Cojiro
 
 
---------------------------------------------------
014A ovl_En_Mk (Lakeside Professor)
 
ROM: 0xE63184 - (2401000D) - Responding to Eyeball Frog
ROM: 0xE6331D - (2407000D) - Showing him Eyeball Frog
 
----------------------------------------------------
01B8 ovl_En_Gb (Poe Salesman)
 
 
ROM: 0xDE6484 - (2407001B) - His reaction to Poe
ROM: 0xDE6514 - (2407001B) - Showing Poe
 
ROM: 0xDE6490 - (2407001C) - Reaction to Big Poe 
 
NOTE: Still missing the Big Poe Showing entry itself, this is a quizzical matter that I have not figured out yet.
 
 
-------------------------------------------------
013C ovl_En_Niw_Lady (Anju)
 
ROM: 0xE70920 - (24010006) - Anju's Reaction to Pocket Cucco
ROM: 0xE70A10 - (24070006) - Showing Anju the Pocket Cucco after awakening Talon.
 
 
----------------------------------------------------
003D ovl_En_Ossan (Shopkeepers)
 
ROM: 0xE7C070 - (2407FFFF) - False Positive? 
ROM: 0xE7C13C - (2407FFFF) - False Positive?
 
------------------------------------------------
0084 ovl_En_Ta (Talon)
 
ROM: 0xECA4F4 - (24010003) - Talon's Reaction to Cucco
ROM: 0xECA570 - (24070003) - Showing Cucco to him before awakening (Child)
 
ROM: 0xECA614 - (24010006) - Talon's Reaction to Pocket Cucco
ROM: 0xECA690 - (24070006) - Showing Pocket Cucco to him before awakening
 
-------------------------------------------------
0132 ovl_En_Toryo (Carpenter Boss)
 
ROM: 0xED6494 - (2401000A) - Carpenter's Reaction to Poacher's Saw 
ROM: 0xED674C - (2407000A) - Showing him Poacher's Saw
 
-------------------------------------------------
0126 ovl_Obj_Bean (Magic Bean Spots)
 
ROM: 0xF3E9D0 - (24010004) - Spot's Reaction to Magic Beans
ROM: 0xF3EA0C - (24070004) - Preparing to plant Magic Beans
 
-----------------------------------------------------
0164 ovl_En_Kz (King Zora)
 
ROM: 0xE52C80 - (2401000C) - King Zora's Reaction to Prescription
ROM: 0xE53180 - (2407000C) - Showing him the Prescription
 
ROM: 0xE52C10 - (2401001D) - King Zora's Reaction to Ruto's Letter 
 
NOTE: As with the Poe Salesman I could find no sign of a matching 001D which corresponded to the Show of Ruto's Letter.
 
 
And here is the list so far, for reference...
 
0001 Zelda's Letter 
0002 Weird Egg
0003 Cucco 
0004 Magic Beans
0005 Pocket Egg
0006 Pocket Cucco
0007 Cojiro
0008 Odd Mushroom
0009 Medicine
000A Poacher's Saw
000B Broken Goron's Knife
000C Prescription
000D Eyeball Frog
000E Eyedrops
000F Claim Check

--------------

001B Poe

001C Big Poe

001D Ruto's Letter

Edited by Three_Pendants
  • Like 2
Link to comment
Share on other sites

Hmm, interesting question... I haven't yet looked at mask buyers other than a cursory glance through the Graveyard Boy's data and aside from finding the price he buys the mask for and the item he gives you (sold out) I wasn't able to find anything of note...

 

Now after giving the file a quick look through it does not appear to work the same way, but there might not be two checks that mask buyers have to pass through, meaning that a 240100XX command would suffice alone.

Link to comment
Share on other sites

Well yes, but ADDIU AT, R0  (2401XXXX) is used everywhere for a lot of things, Just as ADDIU A3, R0 (2407XXXX)  can at times mean spawn an actor, it can also mean other things. but in general 2401 is an extremely common command where 2407 is a fair amount rarer and usually has a noticeable feature attached to it (Spawning or checks so far).

Link to comment
Share on other sites

Well yes, but ADDIU AT, R0  (2401XXXX) is used everywhere for a lot of things, Just as ADDIU A3, R0 (2407XXXX)  can at times mean spawn an actor, it can also mean other things. but in general 2401 is an extremely common command where 2407 is a fair amount rarer and usually has a noticeable feature attached to it (Spawning or checks so far).

O contraire... 2407 is highly used in projectiles and extras that actors spawn/generate, it is more common than 2406, and 2401 is usually temporary values, but this all depends on the function being used. 2406 is used in standalone spawns which an actor can use to create actors that don't need positioning relative to the actor creating them.

 

I believe Volvagia's boulders can follow this rule, but there are two spawns for the boulders. One set follows Volvagia, and the other randomly generates to hit Link. The randomly generated one is likely a 2406, but this is a brief example on how Nintendo used their functions. Of course what we see in hex/MIPS is not what Nintendo uses to code with. That would be mind-boggling.

Link to comment
Share on other sites

I only meant more common than 2401, I have no idea how common or uncommon 2407 may be compared to other values, but to know that 2401 is used only for storing temporary values is interesting, though are you certain about 2406's function? If such is the case that would mean that Actors literally spawn items into Link's hands when they give him a non-Quest item. Is that what is happening then?

Link to comment
Share on other sites

I only meant more common than 2401, I have no idea how common or uncommon 2407 may be compared to other values, but to know that 2401 is used only for storing temporary values is interesting, though are you certain about 2406's function? If such is the case that would mean that Actors literally spawn items into Link's hands when they give him a non-Quest item. Is that what is happening then?

No, items are used by their gi_object, and link creates it. It's not a seperate actor, otherwise we would need more groups with a treasure chest to make it work.

Link to comment
Share on other sites

And the mystery is solved! King Zora and the Poe Salesman have no more secrets to share! (Poe Salesman Especially! I have scoured his data hither and thither and found every single function of his by now)

 

Now this is bizarre and stands against all reason... The Poe Salesman did not have the reference to the Big Poe, it was in Link's actor file the entire time. So the first theory was correct. It was Half in Link's Actor and Half in the Poe Salesman, but to compound matters was that it wasn't in the Used Item Index, it was in the Action Parameter Index, and its located shortly before the game goes into the "This Item cannot be used here..." routine, a check against 0023 (Big Poe's Action Parameter) is in Link's File and from there it is turned into a 001C, Why it would no longer activate if 001B was changed (The Poe's Used Item Index value) is beyond me, but that no longer appears to apply. So now you can set any shown item (or bottled item I would imagine as well) you like as the Poe Salesman's 100 Point reward item and his 10 Rupee Item.

 

King Zora was just using a different value than I was expecting to find and seemed to miss it for that reason. I found that out after quite an amount of breakpointing on the Used Item Index spot.

 

Posted Image

 

So without further ado, here are the values...

 

01B8 ovl_En_Gb (Poe Salesman)
 
 
ROM: 0xDE6484 - (2407001B) - His reaction to Poe
ROM: 0xDE6514 - (2407001B) - Showing Poe
 
ROM: 0xDE6490 - (2407001C) - Reaction to Big Poe 
NOTE: Located in Link's Actor! Put here for easy reference! Refer to Action Parameter List above!
ROM: 0xC0A138 - (24010023) - Showing Big Poe
-------------------------------------------------
 
0164 ovl_En_Kz (King Zora)
 
ROM: 0xE52C80 - (2401000C) - King Zora's Reaction to Prescription
ROM: 0xE53180 - (2407000C) - Showing him the Prescription
 
ROM: 0xE52C10 - (2401001D) - King Zora's Reaction to Ruto's Letter
ROM: 0xE525F0 - (2409001D) - Showing King Zora Ruto's Letter
--------------------------------------------
 
 
That leaves the Biggoron Checks and the Beggar Checks to locate. Hopefully this little side-mission should be complete soon
  • Like 1
Link to comment
Share on other sites

Well I meant to find the Beggar checks but bizarrely enough the Beggar is broken for me on even a clean rom which simply does not make any sense. Every item he should give you money for has him respond with his normal message.

 

But I did find all of Biggoron's checks and though I wish I could have found the 3 Days Time in there as well, I had no basis on where to look so I'll look that up another time. From the way it seems Biggoron's Checks are programmed in such a way that he responds individually to each item in an order. First Broken Goron's Sword, then Eyedrops, then Claim Check, and finally Claim Check after 3 Days. It may have something to do with the 0A,09,08 values on the registers, but changing them to be all of the same causes the other two to non-function.

 

01AE ovl_En_Go2 All normal Gorons + Biggoron
 
ROM: 0xDFBE00 - (2401000B) - Biggoron's reaction to Broken Goron's Sword
ROM: 0xDFABCC - (240A000B) - Showing Biggoron the Broken Goron's Sword
 
ROM: 0xDFBD9C - (2401000E) - Biggoron's reaction to Eyedrops
ROM: 0xDFABD0 - (2409000E) - Showing Biggoron the Eyedrops (Only Applies After showing Broken Goron's Sword!)
 
 
ROM: 0xDFBCA8 - (2401000F) - Presumably the Reaction to Claim Check before 3 days elapse, but it is responded to with the normal text in the first place.
ROM: 0xDFBD04 - (2401000F) - The Reaction to Claim Check after three days have passed.
ROM: 0xDFABA0 - (2408000F) - Showing Biggoron the Claim Check (Only Applies After showing Eyedrops!)

 

 

Since Beggar seems inaccessible (besides he only gives money and empty bottles... then again that alone might be interesting) It's time to move onto Masks.

Link to comment
Share on other sites

I used a different Rom and found the Beggar Checks, there were a few surprises waiting on the wings on this one. 

First was the presence of an unused text call in the file to an entry for the Fairy which can't be sold because Link just uses it in front of the Beggar and second is that all of the sold items correspond to a single return entry, which is different from the Big Poe and Poe when the Poe Salesman gives you back an Empty Bottle entry they're in two separate pieces so you can have two returned items. Unfortunately for us the Beggar only has one Empty Bottle entry and returns that regardless of the item given.

 

Here are the Beggar Checks and that completes all Actor Trading with Items! Expect Mask trading in the near future!

 

------------------------------------------------------
016E ovl_En_Hy Normal Hylians (In this case Beggar)
 
ROM: 0xE26EE0 - (24060014) - Item Received (Refer to Event Items!) when any item is given. (ordinarily Empty Bottle)
 
ROM: 0xE293D8 - (0096) - Rupee Gain of Blue Fire (150)
ROM: 0xE293DA - (0064) - Rupee Gain of Fish (100)
ROM: 0xE293DC - (0032) - Rupee Gain of Bugs (50)
ROM: 0xE293DE - (0019) - Rupee Gain of Fairy (Beta!) (25)
 
ROM: 0xE274E8 - (24010019) - Reaction to Blue Fire
ROM: 0xE26728 - (24080019) - Showing Blue Fire to Beggar
 
ROM: 0xE274DC - (24010018) - Reaction to Fish
ROM: 0xE27D80 - (24060018) - Showing Fish to Beggar
 
 
ROM: 0xE274F4 - (2401001A) - Reaction to Bugs
ROM: 0xE27D18 - (2406001A) - Showing Bugs to Beggar
 
NOTE: Judging by text files and links to that text within the actor it was clear that the Beggar is supposed to also buy fairies.
However the game does not judge the Fairy in a Bottle Action Parameter as a valid Used Item Index entry and so the text and the function goes unused. I am certain that the data for the Fairy entry must still exist within the actor, but I have little reliable way to look for it.
Link to comment
Share on other sites

Alright, after a bit of searching I found Mask and they are in... shock of all shocks... yet Another index, I'll call this one "Mask Index" for obvious reasons. Now there are some pluses and there are some negatives...

 

The plus side is that you can trade even the Race masks and the Mask of Truth! The bad news is that there is only four Mask Receivers and they will always wear their normal assigned mask on their face regardless of what mask is given them. So... yeah. Until we get some custom actors to give the masks to, I'm afraid this is all we have.

 

Mask Trading
 
0179 ovl_en_Heishi 2 (Death Mountain Gate Guard)
 
 
ROM:  0xE0A5C0 - (24010001) - Check for Keaton Mask
ROM:  0xE0AD40 - (2405002C) - Sold Out Sign (From selling him Keaton Mask)
ROM:  0xE0AE20 - (2404000F) - 15 Rupees given for Mask
 
--------------------------------------------------------
0115 ovl_En_Skj Skullkid
 
 
ROM: 0xEB57D0 - (24010002) - Check for Skull Mask
ROM: 0xEB6264 - (2405002C) - Sold Out Sign (For selling Skull Mask)
ROM: 0xEB6234 - (2404000A) - 10 Rupees given for Mask
 
----------------------------------------------
 
016C ovl_En_Cs Graveyard Boy
 
ROM: 0xD988F8 - (24010003) Check for Spooky Mask
ROM: 0xD98864 - (2405002C) Sold Out Sign (From selling him Spooky Mask)
ROM: 0xD98874 - (2404001E) 30 Rupees given for Mask
 
-----------------------------------------------
0162 ovl_En_Mm Running Man
 
ROM: 0xE64338 - (24010004) Check for Bunny Hood
ROM: 0xE63C08 - (2405002C) Sold Out Sign (From selling him Bunny Hood)
ROM: 0xE63C18 - (240401F4) 500 Rupees given for Mask
 
---------------------
Mask Index
 
00 - No Mask
01 - Keaton Mask
02 - Skull Mask
03 - Spooky Mask
04 - Bunny Hood
05 - Goron Mask
06 - Zora Mask
07 - Gerudo Mask
08 - Mask of Truth
 
Link to comment
Share on other sites

After some thought I realized that I was missing two more important Mask matters, while not trading per se they are both equally important functions. One is the Gossip Stone and what is required to get their unique messages to appear and the second is the Deku Stage which does yield actual items and is probably more important than the information above because any mask can be used for either of the two events rather than having to jump through hoops and using external tools to switch the actual mask (graphic) given to a Mask Receiver.

 

-------------------------------------------------------
01A1 ovl_En_Dnt_Demo Deku Crowd
 
ROM: 0xDA7948 - (240C0002) - Appears to be the event played when wearing Skull Mask in regards to Deku Watchers.
00 - No Event
01 - Deku Nut Upgrade Event (Mask of Truth)
02 - Deku Stick Upgrade Event (Skull Mask)
 
ROM: 0xDA794C - (240D0002) - Appears to be the event played when wearing Skull Mask in regards to the Deku Judge. (Refer to List Above)
 
 
 
 
Deku Crowd Mask Check Info. Unlike every other mask dealing the Deku Stage is a very special occurrence, the other masks were dealt with by an NPC check due to interacting with the NPC.This is not how it works with the Deku Stage, because the cutscenes begin the moment you step on the stage, I searched and searched for mask references but each attempt came up empty. In time though I did manage to locate the event index with this basic style of searching.
 
Eventually I breakpointed on values near the events and found that the game was going to a list of eight addresses, depending on the mask you wore. Six of the addresses were the same and two were unique,
one I easily recognized as the Skull Mask event pointer. With this knowledge in hand it was only a couple more minutes before I realized that I was looking at the event pointers corresponding to the Eight Masks.
 
As such the data will be in addresses rather than the typical 24XX0XXX format used throughout the vast majority of the checks.
 
 
I could curiously not find the Mask of Truth event signifiers as listed above with the Skull Mask, but they're no longer needed as it is clear what event corresponds to which based on Address Pointer alone.
 
0xDA8570 - (809F0E1C) - Keaton Mask Event Pointer - (Random Event)
0xDA8574 - (809F0D50) - Skull Mask Event Pointer - (Deku Stick Upgrade)
0xDAB578 - (809F0E1C) - Spooky Mask Event Pointer - (Random Event)
oxDAB57C - (809F0E1C) - Bunny Hood Event Pointer - (Random Event)
0xDAB580 - (809F0E1C) - Goron Mask Event Pointer - (Random Event)
0xDAB584 - (809F0E1C) - Zora Mask Event Pointer - (Random Event)
0xDAB588 - (809F0E1C) - Gerudo Mask Event Pointer - (Random Event)
0xDAB58C - (809F0D80) - Mask of Truth Event Pointer - (Deku Nut Upgrade)
 
809F0E1C - Default Random Event
809F0D50 - Skull Mask Event
809F0D80 - Mask of Truth Event
 
Change the values in any of the desired Mask Events to those listed above to change the Deku Stage mask requirements as you will. 
 
--------------------------------------------------------
01B9 ovl_En_Gs Gossip Stones
 
ROM: 0xE05304 - (24010008) - Mask to wear to have the Gossip Stone respond. (set to 00 to no longer require a mask)
ROM: 0xE05310 - (24192054) - Normal Message before the unique one given by Gossip Stone.
ROM: 0xE57AF8 - (24012054) - A Check of Message to see if the Gossip Stone will gives its second message (Change this value and the above one to match to have a Mask activate the Gossip Stone's unique speech)
ROM: 0xE0530C - (24082053) - Default text ID for normal message without Mask (Change this value and the above one to match to have Link activate the Gossip Stone without a mask.)
 
Posted Image
Link to comment
Share on other sites

  • 1 year later...
 Share

×
×
  • Create New...

Important Information

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