HOW TO CHANGE A ROOM'S STATE FROM A BOSS/EVENT STATE, TO AN ITEM-BASED EVENT! By Sting_Chameleon Basic simple way to change events in any room from 'Boss Events', 'Regular Events', to a simple 'Item Pick-up Event'! What you will need: SMILE Hex Editor(I prefer HxD) WordPad(or some way to keep track of values) Super Metroid (J) [!].smc Now this is as simple as it gets. Reasons? 1. There is NO repointing to free space 2. This is EASY to do 3. Mainly just basic math and copy and paste functions are needed. 4. If it isn't then this tutorial probably didn't turn out as I'd expect it to turn out. Here's what you can do. You can make it so you need just Morph and Missiles to get the desired state, or just Morph, or whatever item you want to trigger a state. So far, only Power Bombs, Morph Ball, Morph and Missiles, and I think Speed Booster are the only known items available for state changes with items basically. Now lets begin! LOCATING YOUR STATES First thing is first. We will do this WITHOUT scroll rooms, and WITH scroll rooms. We will then do this in a Boss Room(Phantoon will be used). First, lets do this in the room "79A90". Open up this room in SMILE. What you have is a 1x1 room with a chozo statue with nothing in his hands, but yet a visor which tracks you when you enter the room after aquiring Morph(which is hidden behind the statue to make it look like it has a seeking eye or something. This state of the room was NEVER met in the actual game without having bombs as well. Even then, after Morph Ball, you'd already be in a different state by the time you can even get in the morph ball space. This state was apparently for enjoyment purposes and creativity. Alright. Go to change the state(the other drop-down box beside the level ID #), and select 'Events 1'. When the room refreshed, the visor will be gone, but instead the chozo statue will be holding a missile pack instead. This is AFTER you clear your first room of space pirates, and in other words, if you go to EDIT > STATE PROPERTIES while in the 'Events 1' state, you'll get a quick two drop-down boxes. This room by default has the following start-up text. 'E612 = Events' 'Zebes is awake' The first drop-down contains event states and boss states. When 'Events' is selected, the second drop-down box will be there. Listing 256 values, in hex, values $00 - $FF. $00 - $15 are labeled, and values $40 - $7F are boss states. I don't know why there is another drop-down box for boss states, there just is. I listed a full list nicely in another document of all Event States that I know of. However I won't be able to get it up until I get permission from someone to do so. I'm hoping to get all known states in there without everyone having to overwrite the unknown states. Knowing what you need to edit, your ready and set! CHANGING STATES WITHIN A NON-SCROLL-ENABLED ROOM So you know your room ID. $79A90. Keep track of it, and also keep track of the value E612(the value we wish to edit). Those of you that took the time to read 'JAM's MEGA State Editing Guide', you should know we will be shifting bytes from here on out. Those of that didn't, please be sure to do so. Moving on, head to the level ID, and look what the value is for the next room on the list! It would be 79AD9. Keep track of this as well. Alright, exit SMILE and open up your hex editor. SEARCH > GOTO > Type in 79A90(make sure the hexadecimal search is active), and you'll arrive at the beginning of your 1x1 room. This is the FIRST byte of your room, and most likely the number it was placed into the game. Still unsure, but this is originally 1F. If not, look a few bytes around for it. Alright. Now search again, but this time for the next room, and in our case, 79AD9. You'll get another value, but it should be 00 this time. I have no idea why. Now highlight the value from the byte 79A90 all the way to the 01 before your next room. You should get in hex, 49 bytes, or 73 if it's in decimal. Copy and paste into your document or write it out. Preferably copy and paste. Remember, all this is done in a CLEAN ROM. Meaning fresh, never hacked, touched, until now. Ok, search in that long string of code, for the FIRST sign of 12 E6. Why 12 E6? Because hexadecimal is counted backwards in a hex editor for whatever reason. You WOULD look for E612, but just flip it and you get 12 E6. Alright. Now, you found it, and notice that puny little 00 to the right of it? Thats what the value of the state is looking for. Guess what? We don't need it. Before we do this, change the value 12 E6 to whatever you need it to be. 40 E6 - Morph Ball 52 E6 - Morph and Missiles 69 E6 - Power Bombs 76 E6 - Speed Booster Remember, once you inventory the required state, like any Power Bombs, or Morph and any Missiles, that state will activate! Once you changed the value(in this example, I'll pick Morph), we are not done yet! Copy all of the values from BC just after the 00's you found, all the way to the value before the next room, all the way to the 01. Length would be 3B in hex, 59 in decimal. Now, highlight the 00 after your state you manually changed(the 12 E6 to whatever, but mine would read 40 E6), all the way to the 81 instead, and paste. Now heres how I do this. After you paste, the 01 you didn't overwrite at the end, would replaced with FF for free space. Now know your range of edited bytes. We changed the bytes from 79A9D all the way to 79AD8, however, this is an alternate way than 'JAM' does it. Though his way is more simple for others, this way I grew used to. Since we changed these bytes, or 'shifted them' all by one byte each, this means there are still pointers pointing to the spots the data was originally at. Or in other words, wrong data. ANY bytes that point in the region of(in the hex editor view): 9D 9A - D8 9A, please take away 1 from the first byte. Say the pointer reads C6 9A. You'll want to subtract 1 from the C6, not 9A. It should read afterwards, C5 9A. Do this for ALL values in this LEVEL that POINTS to THIS region. After you have finished, your bytes from the beginning of the level SHOULD read the following from 79A90 all the way to 79AD8. If it doesn't, see what didn't compare right, and edit as needed(remember, I used the Morph State, so there's a 40 instead of what you used for the state to change). 1F 00 10 07 01 01 70 A0 00 D5 9A 40 E6 BB 9A E6 E5 32 82 C4 02 00 00 B0 80 AF 85 07 81 C1 C1 D7 9A 00 00 00 00 86 84 05 B9 D4 91 32 82 C4 02 0F 05 E4 81 86 85 DD 80 C1 C1 D7 9A 00 00 00 00 84 84 05 B9 D4 91 9A 8C 01 FF Now save and exit, then open the rom in SMILE again. Head BACK to room 79A90. If you got an error, you made a mistake in your coding and you'll need to fix it accordingly. If you didn't, simply click the state drop-down box to find your state has been successfully changed to morph(or whatever you picked)! You can change the pointers in this room to match whatever Graphic Set you want, pointers for enemies to add, PLMs(or item's/doors to add), scroll data, ect. Though this is simple to do, however, before we get carried away, lets try another room on for size. :P +++NOTE+++ Now here's a common problem you might experience when testing the rooms after your data is set and managed. Sometimes, when you try to exit the room, and you enter a weird room, not entering a room at all, or entered a room with the room scrolling VERY weird? It means the 'Door Out' pointer isn't pointing to the right data. Subtract 1 from it, and it alone to fix this. Say your pointer reads 82AD. This isn't backwards, so you subtract 1 from it, and you'll get 82AC. Simple enough. :) CHANGING STATES WITHIN A SCROLL ENABLED ROOM For this, we will use the room 792FD(two doors from the room we JUST changed states for). Find it in the hex editor. Same for the NEXT room, which is 793AA. Copy the bytes from 792FD all the way to 793A9. Paste in a document. Should be AD(173) bytes total. Now in SMILE, there's 3 events. 'Events 1'/'Events 2'/'Standard 1'. We won't worry about 'Events 1' this time because thats the escape sequence after you eliminate Mother Brain. The event we need is 'Events 2'. This would be the SECOND value that we are to change that shows up 12 E6 in our hex editor. So the 2nd time 12 E6 shows up, which it's value is 00, then perform the same operation you did to the previous room you changed the state. I picked morph as well for this room. So you can imagine these next hex lines. :P Check and correct if needed(cept the Morph byte I picked if you didn't pick it...). This is the value range from 792FD all the way to 793A9. 02 00 12 04 05 05 70 A0 00 61 93 12 E6 0E 47 93 40 E6 2D 93 E6 E5 C4 DB C2 00 06 05 F0 80 FA 86 85 81 C1 C1 6F 93 00 00 00 00 5A 80 B4 B8 D3 91 C4 DB C2 00 0F 00 50 80 61 82 67 80 C1 C1 6F 93 00 00 00 00 5A 80 B4 B8 BC 91 C4 DB C2 00 00 00 10 80 A0 8D 95 82 C1 C1 6F 93 00 00 24 C1 04 81 B4 B8 94 91 5E 89 6A 89 76 89 82 89 8E 89 9A 89 A6 89 00 01 01 01 01 00 00 00 00 00 00 02 00 01 00 00 02 00 00 00 00 02 00 00 00 08 02 80 08 00 80 00 00 02 00 06 02 80 06 00 80 00 01 80 02 01 80 04 01 80 04 00 80 04 00 08 02 80 FF Woo. However, your not QUITE done just yet! If your doing this to a room with scroll PLMs within a room, you must do this part within SMILE! SO! Head back to the room 792FD in SMILE, and right click on each and every Scroll PLM, and move the 'LOW' bit up one(or minus one from it) and click ok. Do this for all of them, then save your room. Now, lets take a quick double check on your pointers box. If the data points between your room data and the next room's data, check to see if it all matches in your hex editor. It IS in order, so don't worry about zooming the area around to find it all. CHANGING STATES WITHIN A NON-SCROLL ENABLED BOSS ROOM Since I said before we will do Phantoon's room, you HAVE to remember, WE ARE DOING HIS ROOM! :D Ok, first thing is first, find Phantoon, or just head to the room 7CD13. Here's the thing. This WILL loop, so if your stuck beating the crap out of Phantoon everytime you enter, this is whats gonna happen(after you inventoried power bombs of course). SO! First off, open the pointers list. Now copy all the data you see in a new doc or something. Change states and do the same again. We need to keep this info intact in case you need to re-do some value pointing. We will also need blank enemy data(a pointer value that points to blank enemy data) from a random room, aaaannnd a random item PLM from another room. A power bomb would be perfect for this. Head to those rooms and snatch the pointers accordingly. Use enemy bank data from the Varia Suit room, and use the Power Bomb PLM from the room straight across from Crocomire's room. I'll supply the values for you. PLM - 8C04 Enemie Pop/Allowed - 9666 Enemie Set - 8499 Ok, here's what you do. In the 'Boss 1' state, you copy the values from the pointers you used from 'Standard 1'. Click 'Save'. A window will pop-up. We just pointed the boss and the other values the state used. We WON'T edit this. So, click 'No'. You may need to change the Graphic Set as well for it to look nice when you fight him. In the 'Standard 1' pointers box, just copy the values above into the corresponding lines. Then if your using a transition from a light room, to get to dark, use the 'Boss 1' BG_Data from it's pointers bank and copy it into the 'Standard 1' BG_Data pointers bank to fix the glitchy room. If you want to make a dark transition that changes the room after collecting an item, you'll have to wait for a bit. I'm gonna work on this when I can get the chance. Click 'Save'. A window will pop-up. We ARE using data from another room, however we DON'T need to edit it in any way. So in our case, Click 'No'. Now copy the values AGAIN, but this time, probably on a different note. But you MUST keep this! Really important! What we did is changed Phantoon to appear in the 'Boss 1' state instead of the regular 'Standard 1' state, and we now have a Power Bomb pickup in the room. Move the item wherever you want someone to pick it up at. Save the room for safetly measures. Now, knowing the drill, all we have to do is the basic state change for the 'Boss 1' state. Just like any other state that isn't Item-based, has a bit set JUST for it. Keep track of your current room your editing. 7CD13. The next room? 7CD5C. Distance of bytes in between is 49(73). Now, this time is a little bit different. this time the value we will look for will be E629. So it'd show 29 E6 instead. Find it and notice there is a value of 01 set to it. The first bit is set so it'll show a 01. In boss states, there are 3 bits you can set. It shows 8 in total, but only 3 are used. You can repoint data as needed, however, I'm not covering that, now am I? The first three bits are in this order. Boss Miniboss Torizo Lets say you enable all three, so all three conditions must be met. 0000 0111 <--- This is binary, from RIGHT to LEFT, is the bits for the 'Boss 1' event, from TOP to BOTTOM being set. SO! If all three are enabled(like it is shown), you'll get 07 for your byte answer(that shows in the hex editor). Boss alone, is 01, Miniboss is 02 and Torizo is 04. This is alone. So whatever is checked, add accordingly. I'll show the bits for each so you can get a better understanding. DEC - TYPE - HEX 01 - BOSS - 01 02 - MINIBOSS - 02 04 - TORIZO - 04 08 - [NOT USED] - 08 16 - [NOT USED] - 10 32 - [NOT USED] - 20 64 - [NOT USED] - 40 128 - [NOT USED] - 80 255 - TOTAL VALUES - FF Whatever is checked, add them up to get the total value separately. So whatever value you get, make it hex if you haven't already(calculators are epic win here), and see for yourself what that value is used for. Since we don't need it though, lets go ahead and copy all the bytes after it until you hit the byte block 7CD5B, which is the last byte for this room. You copy it too, but avoid the next room's first byte. Follow your regular routine you have done with your previous rooms to this one. Now, finally, go all the way up to find your value of the Power Bombs. E669. Use this to replace the E629. If all went well, this SHOULD be what you got. If it isn't change accordingly. Yours must look exactly like this all the way from byte 7CD10 - 7CD5B. Remember, if the pointer lands within THAT region, lower the value by 1! And one more thing. ALWAYS check the pointers after saving. More than likely the door out pointer has a tendency to never get changed sometimes, leaving the pointer to recieve strange data from other parts of the next room. Or no data at all due to the last byte in the string to be FF. :P 0A 03 13 13 01 01 70 A0 00 58 CD 69 E6 3E CD E6 E5 8C E5 C4 04 27 06 44 9C 66 96 99 84 01 01 5A CD 00 00 00 00 04 8C FD E0 D0 C8 8C E5 C4 05 00 03 44 9C D4 CC 1D 8D 01 01 5A CD 00 00 00 00 B3 C2 FD E0 D0 C8 C4 A2 01 FF Remember those values I mentioned you to write down for the pointers AFTER the edit? Bring it out, and save changes in your hex editor, re-open SMILE in the room 7CD13. Now open the pointers box again. Check the values that are in your Pointers window. If the newer values are 1 value smaller, than you are set! Now. This boss will repeat over and over until you decide to add in your own state after his death with either an 'Event State' set at 58, or a 'Boss State' set to 'Phantoon'. I do believe you can find out how to do this in another document that isn't mine. This is 'State Header Changing'. Not 'State Header Adding/Deleting'. However, I'll make a tutorial on utilizing more space to be used within rooms without using extra banks. Give me time, and I'll give you tutorial. :) However, should you get graphic glitches in Phantoon's room, most likely the room state's FX needs to be tinkered with. Swap the FX1 pointer to the other state's original pointer. So basically its a 'FX1' swap. If this doesn't fix it, then state the problem you see(to contact me, check the end of this documentation!), to me or the Help board. More than likely, check other documented tutorials on 'Pointers', or check out tutorials on 'YouTube'. CHANGING STATES WITHIN A SCROLL ENABLED BOSS ROOM Ok, this is gonna be quicker than the previous sections. Believe it or not, but this is more simple than you'd think. If you added scrolls to a boss room, however, the boss itself has no scroll data to change after death or no extra scrolling data DURING the fight, then this is simple enough. Just look at these in the order given. #1.'CHANGING STATES WITHIN A NON-SCROLL ENABLED BOSS ROOM' #2.'CHANGING STATES WITHIN A SCROLL ENABLED ROOM' This will work, as long as your sure you edited in a Scroll PLM regularly, and repointed for basic use. Congrats! You successfully learned to Change an Event/Boss State in rooms that have scroll plm data, and without scroll plm data! Or you wanted to see the end of this documentation I made in less than 7 hours. :) PS. I'll get to working on making this look n00b-friendly if I can get the chance. Well I know it's not gonna be as nice as other people's documents, thats for sure, but none-the-less this is my first tutorial! Problems, questions, suggestions, you can contact me on my YouTube. You may also find me lurking in the IRC channel. Contacting my metroidconstruction forums username, is like talking to a brick wall, but if its the only way you can contact me, then please do so. I'll check back every-so-often as I possibly can. I seriously hope this is read-able to any and all who read this tutorial. Not the best at making one, but this is as much as I can get done. Created by Sting_Chameleon