Airikita Posted November 16, 2012 Share Posted November 16, 2012 Hi, I have had many of you asking about the item spawner, and how I found it, etc... so I'm going to discuss the basics on what I have found. First off, I need to explain WHERE it was found... the item spawner was found in code.zdata, which is located in 00A94000 - 00BCEF30. How I figured out it was in there wasn't as straight forward as searching for the spawner from the start of the rom (even though that is how I started). I thought about how all things spawn random items the same way: grass, Skulltulas, Stalfos, pillars, etc... So I figured, it would be a lot of space to fill if every single enemy had to use the same code copied over-and-over, so I considered Nintendo made it more efficient by calling the spawner from somewhere else. So, with some time, I researched into some assembly to find out how a function can be called, and learned it was JAL that linked a section of code to be called by an external source (also with Sakura's help), so I looked into JAL functions in the ik, and tested out a few that were not on the list... I found this: By changing 0C007E50 to 00000000, I discovered that this prevented the Iron Knuckle from dropping items, and it was exactly what I was looking for! Using NEMU64 to find the location shown as 8001F940 (translating from the code shown), I was able to find out where in code.zdata the item spawner was. I searched for the actor spawner, which starts with 2406... the items generated were collectibles, which was actor number 0015, a value. So I simply searched up 24060015, tested each one, and it turned out the 2nd one down changed the items spawned: But actors simply did not show up... I didn't know at this point that there was a buggy function within the code, but I'll get to that later. I tested out Arwings, only to find that they exploded: To my dismay and fustration, I kept testing more and more, and found out that bombs can appear, but would crash when one exploded into another... and it seemed as though some actors were invisible, which turned out to be they were microscopic in size: After a while, I could not get the token to appear, so I just about through a fit, and nearly quit there... Although, when I found out that the token was just SUPER tiny, I knew something was resizing the token, and other things too. I swear, if only Link had a magnifier! So, I tried eliminating other functions below the location of the item spawner: So I tested that out, and found out incredibly positive results, including fully-functional Arwings (and other stuff): I got so excited that actors finally spawned, I went to spawn the token... but, I still had the issue of it "sliding" away, and had to change a floating-point value below the item spawner, which turned out to be at location 0xA96EA4.. I also found other related function calls in other enemies, and replaced a piece of the ik's code to limit the drops it was calling from THREE drops to ONE: By changing 00B0 to 00D0 (called in other enemies) I could make the ik only drop one token! Now, I could've probably changed something in the item spawner code itself, but this was simpler. Also, to reduce the risk of not running the chance of the token to NOT appear (as it is a random item generator), I happened to find this floating-point value that prevented items from not appearing, and made every single grass clump drop an item no matter what: With all these combined, and a bit more editing to remove any other drops, the Iron Knuckle will now drop a token: There's still the issue of leaving the room without picking it up, and comming back will eliminate your chances of getting it, but that's a whole other issue... Also, the variable to change the actor's status is stored to S3, so you may have to look around, but the 00FF especially should be changed: 5 Link to comment Share on other sites More sharing options...
haddockd Posted November 16, 2012 Share Posted November 16, 2012 Love it, love it and love it. Nice work man. I thought I was awesome when I documented some music stuff but this is certainly beyond me. This will certainly come in handy and thanks for posting it! Link to comment Share on other sites More sharing options...
Zeth Ryder Posted November 16, 2012 Share Posted November 16, 2012 This is really impressive! Keep up the good work! Link to comment Share on other sites More sharing options...
Conker Posted November 16, 2012 Share Posted November 16, 2012 I always love seeing your work, Airkita. Link to comment Share on other sites More sharing options...
DeathBasket Posted November 16, 2012 Share Posted November 16, 2012 Thank you! With this information I think I finally found that random number generator I was supposed to be looking for. Link to comment Share on other sites More sharing options...
Airikita Posted November 16, 2012 Author Share Posted November 16, 2012 Yup, glad to help! You can do anything with it, not just spawn a token for the Iron Knuckle. Link to comment Share on other sites More sharing options...
Recommended Posts