News:

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

Main Menu

[SM] [ASM] Play 03 = Elevator when you kill an enemy ?

Started by chrismk, January 17, 2012, 03:47:24 PM

Previous topic - Next topic

chrismk

I want to make a room with a Metroid to be similar to boss battles, that when you kill it, changes the music to play 03 Elevator and of course make the grey doors flashing and trigger an event of the room state without the Metroid.

I suppose i need to make a new Metroid enemy with data similar to the Torizo or another boss, but i don't know how to do this, i hope someone can make this to work.

Smiley

To make the grey door unlock after killing the Metroid:
Open the 'Species' -menu (right-click on enemy -> Species) and change "Enemies to clear room" to 01, assuming the Metroid is the only enemy in the room.
Now right-click on your grey door, open the PLM menu and change the door's 'High' value to 0C. This makes it so the door unlocks when you kill the Metroid.

Vener

If you want that the music played change when the metroid is defeated , like normal bosses , i suggest you to create a new event bit . (you specify what header offset ennemie , what room offset , the death bit , etc ..) You can write a short code in bank $8F to set up this thing ; There is someone here who can do it easily , it's "JAM" . He is very busy , but you could ask him anyway .

There is also another way , it seems to me that was done with FX1 code alteration . not sure , But "Scyzer" know the solution so (she made it in her hack).

I regret I cannot say to you about it more  :^_^:

chrismk

Thanks SMILEuser96, it works fine  :^_^:

Vener, JAM made the Boss Music Fix patch, it makes that when Spore Pawn dies change the music to Elevator. He put a pointer in the AI (i think) to make this, but i don't know how Enemy AI works so I can change scrolls, tiles, doors and music with it.

JAM

#4
Yes, it can be done pretty easy.

First of all, you'll need to use rooms with alternate state for metroid defeating.

Second, download my patch FF events and tubes from the main site. It contains PLM that will set Event determined by PLM's Low Byte when the room is clear.
Third, do what SMILEuser96 said to set corrent amount of enemies to clear the room.

Example:
After installing the patch place PLM DB44 in the room with metroids. Set Low Byte to 20 and set alternate state event to 20. Place Metroids in original state, but don't do it in alternate one.

After you killing all metroids in this room, event 20 will be set and next time empty room (with no metroids) will be loaded.


And finally, the last part: changing the music. Too good that Nintendo already wrote the code for changing music, it only need to be activated.

Open your hack in hex editor and find a free space in bank $8F. For example, at 7F000.

Write this code there:

AD 50 0E CD 52 0E 90 0A A9 03 00 22 C1 8F 80 9C DF 07 60

Save and exit. Now, in any room where you want to change music after killing all the enemies, set FX2 to F000 (if you wrote the code at 7F000) and click NO when SMILE ask you about repointing stuff.

To get better effect after all, set elevator music in alternate state of the room (without metroids)

chrismk

 :whoa: Thanks JAM, it works perfectly!

By the way, your FF events and tubes patch is great!

JAM

Thank you. =) I wish someone actually used ALL FF events to make a giant hack with a lot of events...

Vener

Quote from: JAM on January 23, 2012, 01:31:29 PM
Thank you. =) I wish someone actually used ALL FF events to make a giant hack with a lot of events...

it's my intention ! And also , i want to learn how to create new event bits ..

Qactis

Quote from: JAM on January 23, 2012, 01:31:29 PM
Thank you. =) I wish someone actually used ALL FF events to make a giant hack with a lot of events...

Will be using a lot in Synergy including altering tilesets of rooms to simulate day and night time and things like areas that came under attack and are in ruins

JAM

#9
Quote from: Qactis on January 23, 2012, 10:52:16 PM
Will be using a lot in Synergy including altering tilesets of rooms to simulate day and night time and things like areas that came under attack and are in ruins
That's what I dreamed to see in hacks. I Will play your hack definitely.

Quote from: Vener on January 23, 2012, 02:38:21 PM
it's my intention ! And also , i want to learn how to create new event bits ..
Glad to hear that =)
Well, I tell how this works in general. When certain event is happened, cetrain bit it stored to the RAM. Later when you're checking for event using event state, certain byte is extracted from RAM to check is certain bit was set or not.

Event bits are using RAM data from $7E:D820 to D83F.

So, if you want to create new events (more than $FF) you'll need to store data to another RAM address and extract it later from it.

RAM data from $7E:D840 to D86F is completly unused so you can just set values over FF by my Event PLM and data will be stored in RAM. Yes, original game subroutine can do that. But there is no state check for events over $FF in original game as the event check uses only 1 byte as argument. So, I made one.

Download $100 Extra Events patch from collaboration topic. It contains new event check instruction that will checks for events 100..1FF (I call them extra events 00..FF), but since SMILE works only for default instuctions, you'll need to do a few hex editing.

But I've covered you again releasing one more patch: Extra Event Doors. It will unlock grey doors, based the number of event, including extra events. So you may use extra events just to unlock doors after extra event was happed and regular events to change states (and unlock doors too) to avoid hex editing.