Primary Zelda Hacking
April 21, 2014, 09:26:03 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: There is now an official Primary Zelda Hacking Press!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Make Your Own (Ghetto) Chests...  (Read 401 times)
Marky
Newcomer
*
Offline Offline

Posts: 20


View Profile
« on: January 09, 2012, 01:02:01 PM »

If, for whatever reason, you're unsatisfied with the number of chests that you're provided with in-game, I've found a way of making your own - somewhat.  It's still not perfect, and if anyone knows a way to disable item use temporarily that would help immensely.  These "ghetto chests" don't function the same as real chests, there are some notable differences:
- Whichever item you have set to 'A' will be activated (so if you have the Roc's Feather equipped, you'll jump while opening the chest).
- The item you get appears above your head, not the chest.

However, with some creativity, this can be a more versatile tool than traditional chests.  Here is the code snippet you need to enter into ZOSE to make your ghetto chest (beneath 'writelocation' and 'setinteraction72'):

Code:
checkitemflag (so you can only get the item once, I think?)
checkmemory CC99 yx (this line checks to see if you're standing on the correct map tile.  Obviously, 'y' is the Y-coordinate and 'x' is the X-coordinate.)
checkmemory D008 xx (this line checks which direction you're facing.  Up: 0, right: 1, down: 2, left: 3.)
checkmemory CC29 01 (this line checks to see whether button A is being pressed.  I think this could also be accomplished by using 'checkabutton', but I haven't tested that.)
giveitem xx yy (this is obviously the line that gives you the item once all the above criteria have been met.)

Because you choose which tile and which direction the player is facing, this could be used to give hidden items, kind of like in a treasure hunt.  You could also replace the 'giveitem' command with others, to potentially make your own signs, hidden messages or other uses.

However, because of the way that standard chest and sign tiles work, if you actually want to use a chest or sign tile, you will have to go to the Tileset Editor, find another tile that you don't plan on using, and replace it with the chest tile, which is very easy.  Just make sure that the tile you're replacing is one you can't walk on.

If you do want to use a chest tile, in order to make it stay open after you leave the map and return, follow these steps.

1. On the map, place the opened chest tile where you want your chest to be.
2. Insert this line below 'checkitemflag':
Code:
settile xx (where 'xx' is the value of the tile you set to be your closed chest using the Tileset Editor - DO NOT USE THE STANDARD CHEST TILE 'F1'!)
This will make sure to only display a closed chest before you've received the item inside.
3. Insert this line at the end:
Code:
settile F0
This will make sure that, once you've opened the chest and remain on the same map, it will show as an opened chest.


So yeah, I hope this was helpful.  I'd really like it if someone could let me know if there is a memory address or command to stop whichever item is set to 'A' from activating, that would just make it look a little better.  If not, it works fine without that little visual difference.

Edit:  I just discovered I made a small error which I've now corrected above, I had 'checkmemory' string looking for the wrong address.  Should work as intended now.
« Last Edit: January 10, 2012, 05:42:26 AM by Marky » Logged
Fatories
LALE Creator
Administrator
Full Member
*****
Offline Offline

Posts: 223



View Profile
« Reply #1 on: January 10, 2012, 01:50:01 AM »

Yeah this is one way to get around the lack of chests in in a dungeon. On the overworld though there is the 30 chest patch that automatically applies when you open your rom with zole. Basically what it does is it adds 30 chest datas onto map 0 of the present, past, underwater and past underwater map groups allowing you to just take a chest form map 0 onto whatever map you are using. In dungeons however this can't be used so this tutorial can come in handy.

Something you brought to my attention with this tutorial is actually the memory address CC99. I had been looking for an address like that for quite some time so thanks for that.
Logged

The force of a true man can penetrate all. Nothing is safe.
Marky
Newcomer
*
Offline Offline

Posts: 20


View Profile
« Reply #2 on: January 10, 2012, 02:31:29 AM »

Happy to be of some help!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!