News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

Old SMILE Help Thread

Started by GF_Kennon, May 17, 2009, 02:24:28 PM

Previous topic - Next topic

Crashtour99

I have a question that I don't think anyone has ever really explained.

How does one add/remove room states in already existing rooms?

Basically what I'd like to do is remove 2 of the states from the landing site (so it's just a standard state and the escape state) so I can change it's dimensions and such.  I've seen people talk about it, but no one ever said how to do it.   :icon_neutral:

GF_Kennon

Quote from: Sadiztyk Fish on September 27, 2009, 07:11:54 AM
Is there any way to put text from a .txt file into a hex editor, provided it's all hex values? I have a list of pointers in txt format that I need to put into the ROM, but it's a long list (over $1000 bytes), and I really don't want to type them all out into the hex editor manually :icon_eek:

err, i can copy paste just fine like that, i use HxD btw, just get them all and then CTRL + B (B for overwrite dont insert using V because that will make the ROM bigger (and we all know what happens then))

Quote from: Crashtour99 on October 02, 2009, 12:28:44 AM
I have a question that I don't think anyone has ever really explained.

How does one add/remove room states in already existing rooms?

Basically what I'd like to do is remove 2 of the states from the landing site (so it's just a standard state and the escape state) so I can change it's dimensions and such.  I've seen people talk about it, but no one ever said how to do it.   :icon_neutral:

Ill have to write a guide on that soon, i know how to, if your in IRC and im not busy ill explain it (or if i am someone else might do)

personitis

Quote from: Crashtour99 on October 02, 2009, 12:28:44 AM
Basically what I'd like to do is remove 2 of the states from the landing site (so it's just a standard state and the escape state) so I can change it's dimensions and such.  I've seen people talk about it, but no one ever said how to do it.   :icon_neutral:
I've asked before ;_; and didn't get an exact answer. So GF, expect me to bother you sometime... maybe. <_<

Scyzer

#103
I've added/subtracted states to heaps of rooms before. Here's how to do it:

[spoiler=The Room Header]

*NOTE* Values WITHOUT "$" before them are in Decimal System, NOT HEX

1. You need to find the room Header for the ENTIRE room. For a single room, this is 39 bytes long. Any states add an extra 31 bytes to that. The easiest way to find the header is to just take the entire bit of data between the start of the room header (the MDB file) and the door_out pointer, as doors come RIGHT after the room data.

2. The part of the header you need to edit for states is the first part of the header, and is set up like this: ROOM 792B3 (2 states)

01 00 12 02 05 01 70 A0 00 F9 92 ***12 E6 00 DF 92 E6 E5***

The data in the asterisks is what you need, and it is always after the door_out pointer, before the Level data for the first state.

The data is set up like this:
12 E6 - 00 - DF 92 - E6 E5

Type of alternate state - condition for the alternate state - pointer to data for alternate state - standard state (always E6 E5).
The data for the first state always follows this, led by the level_data pointer.

To explain each part:
The type of alternate state is the type of condition for it to be set. You'll notice different types have different numbers. E612 refers to events, while others refer to picking up items, defeating bosses, etc.
The condition  for the alternate state is what causes that state to load. Single byte, which tells the event needed pretty much. This state was to load upon event $00 being set (zebes awake)
Pointer to data for alternate state is simply the pointer to the room data pointers for the alternate state
Standard state is always E6 E5, always comes last in the states, and doesn't have a pointer to data, because its state's pointers come right after it.
[/spoiler]

[spoiler=TO ADD STATES:]
You will need to make a new room, or do this in a room that has at least 5 bytes of scroll data, as this will make the header larger by 5 bytes for every state. You can put the data for the second state anywhere in bank $8F. If you wish to do this for a room without sufficient scroll data, you will need to copy the room header, and add it to free space in $8F, and update the MDB list for the new room.

1. Locate the E6 E5 part of the room header.

   Your data should look like this
   F9 92 - E6 E5 - E8 D6 C2
   Door out - states - Leveldata pointer

2. In front of this part, put 5 00's. INSERT, NOT OVERWRITE!

   F9 92 - 00 00 00 00 00 E6 E5 - E8 D6 C2

3. Locate the scroll data for the room, and delete 5 bytes. Essentially, the next room's header MUST start at the same place it always does.
4. Pick your type of state. The most common is Events, which is set by E612
   
   F9 92 - 12 E6 00 00 00 E6 E5 - E8 D6 C2

5. Go to the leveldata pointer, and copy everything between the pointer (including) and the door data (excluding). This should be 26 (decimal) bytes long.
6. Go to free space in bank $8F, and paste overwrite this data. Remeber the location of this new data
7. Put the pointer for this data over the last 2 00's for the alternate state. EG, data was pasted at $7F020

   F9 92 - 12 E6 00 20 F0 E6 E5 - E8 D6 C2

8. Done. You can now edit this state in SMILE for that room. Remember when adding states, the data for the alternate states does NOT need to be within the room header, and can be anywhere in bank $8F. If you want to add more states, simply repeat the process, but remember the delete another 5 bytes scroll data. If you moved a room that already had states, you NEED to change all pointers to alternate states to point to the new rooms data, not the old location. So you would find the pointer for all the other alternate states, and add $5 to them.
[/spoiler]

[spoiler=TO REMOVE STATES:]
Please do this for a room with more than 1 state lol

1. Locate the E6 E5 part of the room header.

   Your data should look like this
   F9 92 - 12 E6 00 DF 92 E6 E5 - E8 D6 C2
   Door out - states - Leveldata pointer

2. In front of the E6 E5 is the pointer for the second states room pointers. Go to this location and overwrite all data until the doors start (F9 92 in this example). So you would clear out the data between $792DF (inclusive) and $792F9 (exclusive). You can use this free space for anything else you like.

3. Add 5 bytes of free space to this section of new free space (INSERT)

4. Now delete the 5 bytes of state data before the E6 E5 part.

5. That's it. DONE =D. To remove more states, repeat the process.
[/spoiler]

Any questions? Ask me on IRC or send me a message. If you can't do it still, tell me the room you want to change, how many states, and I'll do it for you when I get around to it

Crashtour99

Awesome!  Thanks Sadiztyk, I'll put that to great use.   :grin:
Now if only I could find time to work on this project again.  LOL  Work interferes so very much with hacking.

personitis

Read now, understand later. O_O

Zhs2

You think we can get that moved into a guide for the documents section, Sadiztyk? =D

Scyzer

You certainly can. But I'm not a mod so I can't do it XD. I just fixed a few spelling errors as well in it.

I also have this one, but I think I gave this to Grime already? Can't remember if it was this one.

Cadarot

So Just a little while ago, I was expanding a room whose scroll pointer was at 0000. I decided to re-point the data 7EA50 because I wanted to change the scrolls in the room, but it didn't let me change the scrolls because it said my room was pointed to either 0000 or 0001, which it was not. So after trying to troubleshoot and to get it to work, I changed

7EA50 from FF to 02

Which gave me one green scroll at '0,0' and let me change the rest areas. Do you think that doing this can cause any dire consequences, or do you think I'm o.k. since I pointed it to an empty part of the rom?

DSO

You're fine, the "pointer is 0000/0001" when it's not is a SMILE bug caused by the very thing you fixed (FF for the first screen).

Cadarot

Quote from: DSO on October 05, 2009, 04:52:36 AM
You're fine, the "pointer is 0000/0001" when it's not is a SMILE bug caused by the very thing you fixed (FF for the first screen).
Cool thanks.

Zhs2

Quote from: Sadiztyk Fish on October 05, 2009, 01:34:33 AM
You certainly can. But I'm not a mod so I can't do it XD. I just fixed a few spelling errors as well in it.

I also have this one, but I think I gave this to Grime already? Can't remember if it was this one.
You don't have to be a mod. Just paste helpful stuff on the wiki so they can be turned into Docs. =D Which, by the way, we have yet to advertise...

If you wanna take a look over the page I made up on that note: http://wiki.metroidconstruction.com/index.php/Room_Headers

personitis

Quote from: Zhs2 on October 05, 2009, 08:31:45 AM
If you wanna take a look over the page I made up on that note: http://wiki.metroidconstruction.com/index.php/Room_Headers
I can help with the coding provided it's in HTML. =P I'm in web design class atm so yea. Just offering assitance.

Scyzer

Wow. I never knew we had a wiki! :icon_eek: Sweet!

Zhs2


Silver Skree

#115
Halp. Apparently this is another glitch that nobody has seen before.

Never mind. I'm dumb; Black Falcon saw the problem.

personitis

Quote from: Silver Skree on October 11, 2009, 12:43:34 PM
Halp. Apparently this is another glitch that nobody has seen before.

Never mind. I'm dumb; Black Falcon saw the problem.
At least tell us so we know how to avoid the prob. =\

Silver Skree

It wasn't a glitch so much as me being stupid and overlooking a text box.

Zhs2

Don't edit your original post when your problem is solved. How is anyone else supposed to learn from your mistakes? :<_<:

Silver Skree

 :<_<:

Ok, look I was just making the stupid mistake of scrolling the screens of an area load station instead of moving Samus herself because I overlooked Samus's position text box. K? Like I said, not even a glitch, just me being dumb.

begrimed

Not a ground-breaking find by any means, but useful for anyone editing the appearence of Kraid's room. Hats off to squishy and his palette hunting guide.



1386C7-0F (I'm a Genius offsets) - Palette for the background of Kraid's room (not Kraid himself, durhur)

Xaggoth

I was playing with Grime's hex tweaks and I added more than a few thinking everything was working properly.  Now I'm running into a problem than whenever I take damage I fly backwards a long distance and am then invulnerable to enemies afterwards.  If anyone has an idea what combination or specific tweak is causing this it would save me a lot of work.  I was mostly playing with gravity, walljump height, not losing speed on landing, and speed booster tweaks.

begrimed

Haha, Wingard said the same thing happened to him after he applied every single one on the page.

I'd say it's definitely a certain combination of them. Take the one of the space jump changes, for instance. It is a combination of two changes, but has a very different effect than the two by themselves. I'd go back over the list one by one, and restore the changes you made to their default value until the damage problem fixes itself, then work around it. I'd like to know what change(s) are causing it so I can either take them off the page or make a note of which combination(s) to avoid.

Xaggoth

Well this is frustrating, yesterday after I finished putting everything back I still had the problem so I posted about it.  Today I check a few more values, make no changes, and the problem is gone...  I'll make sure to post if I find the combination though.

begrimed

When does this problem trigger, exactly? Do spikes do it, or just enemies? Both? Does it happen when Samus falls into lava/acid or uses a shinespark? Flying backwards when you take damage sounds kind of like using the damage boost trick, which is an intended mechanic I believe. Could be something triggering that and overriding the timer for how long Samus stays invulnerable after taking damage. Very odd.