View Single Post
Old 9th January 2017, 10:54 PM   #22
Sky0fBlades
Emerald Hacker
Moderator
 
Sky0fBlades's Avatar
 
Join Date: Sep 2012
Location: Ice Path
Age: 26
Posts: 128
Sky0fBlades
Default

Quote:
Originally Posted by Thirteen1355 View Post
Hello, @Sky0fBlades, many thanks for helping me out in advance with the information you posted earlier!
I want to do the same thing as Gameskiller01, change an already existing trainer so I can change the music. I have opened the script for Sidney of the Elite Four in this case. What exactly do I have to do now? Do I just have to add:
special 0x3E
playsong 0x1C2 0x0
(1C2 is Leaf Green Elite 4 song)
just above the trainerbattle line, and should it work then?
And how do you save the script into the ROM?

This is the part of the script I'm referring to, with the lines I added in bold:
'---------------
#org 0x109A4D3
lock
faceplayer
checkflag 0x1202
if 0x1 goto 0x909A710
special 0x3E
playsong 0x1C2 0x0

trainerbattle 0x1 0x201 0x0 0x90D8C02 0x90D8C8A 0x909A72D
msgbox 0x9107066 MSG_FACE '"IVAN: I am not familiar with the\n..."
release
end
Is this how it should be done?
Hey there @Thirteen1355, welcome to the forum. I tried to use my method with Sidney's script, but that one seems a bit tricky compared to the others for some reason. Those Elite 4 battles seem to have some kind of attribute where the battle itself will be immediately repeated once, with the first time using the new music and the second time using its normal theme; only then moving on to the rest of the event. This problem was mentioned earlier as a script offset problem, but it seems to still be happening to me after double-checking the offset.

Right now I'm not certain why this happens, but with the script you showed me here it should work as long as you have the other elements of the script (like the other message boxes you need) working too. You are hacking Emerald, right? If not, you will need FR/LG's variant of "special 0x3E", which is apparently "special 0x3B". If you are hacking FR/LG, the song #s don't go as high as 0x1C2, which in Sidney's script in Emerald is the song that plays when you talk to him before the battle. Hopefully this helped. Just give it a try, if it doesn't work just let me know and I'll see what I can do to help.

Oh yeah, almost forgot: to save the script into the ROM, open it in A-Map (assuming that you are using a new offset instead of the original), browse to and open the event script you want to change in XSE, edit it in XSE, then use XSE to compile it (but after replacing the old offset with a dynamic one so you don't overwrite other data). Copy the offset it gives you, paste this offset into the offset box in A-Map for your event, then save the ROM in A-Map. It seems that if using A-Map 1.95, you may have to exit out of the program to really save the changes to the ROM. If you are using the same offset the whole time, make sure that it won't take up any more space than it did before, and then recompile it. I mention dynamic offsets here too

Last edited by Sky0fBlades; 9th January 2017 at 11:30 PM.
Sky0fBlades is offline   Reply With Quote