PHO - Pokémon Hackers Online

PHO - Pokémon Hackers Online (http://pokemonhackersonline.com/index.php)
-   Generation 3 (Traditional) (http://pokemonhackersonline.com/forumdisplay.php?f=192)
-   -   [Tutorial] [Emerald] Controlling Trainer Battle Music... Without ASM. (http://pokemonhackersonline.com/showthread.php?t=15098)

Sky0fBlades 30th July 2014 10:50 PM

[Emerald] Controlling Trainer Battle Music... Without ASM.
 
Controlling Trainer Battle Music in Pokemon Emerald... Without ASM

by Sky0fBlades
_________________________________


Supplies List:

☆ A Pokemon: Emerald ROM
XSE (Xtreme Script Editor) by HackMew
☆ Some basic scripting ability

Intro, and Method:

Hey again guys. Ever since I've gotten back into hacking I've been making all sorts of little 'discoveries' and whatnot and here's a good one that I managed to somehow pull off a long time ago but ever since then totally forgot how. I've noticed there's a few guides out there for this kind of thing but they either require ASM (assembly language) or a different ROM like FireRed. Some of us don't prefer having to use ASM, some aren't hacking FireRed. Basically, I needed to figure this out through trial and error - especially since I already knew it was possible. I think this is a different method than the one I used before... but whatever works, right? It's easy, here's how you do it:

----------
Make a trainer battle script that uses this format, and fill in the "?"s with what you want. All bold parts are very important things that seem to have to be in that order (just to make sure the song plays at the same time the battle does). In Italics are the comments (you can leave them there if you copy-paste), and the red parts are things you may/may not need to change:
Code:

#freespace 0xFF
#dynamic 0x9C0B20

#org @start
lock
faceplayer
checkflag 0x???? // *Has this trainer been beaten?
if 0x1 goto @nobattle
playsong 0x??? 0x0 // Trainer's intro theme.
msgbox @intro MSG_KEEPOPEN // You'll need to put this here, or the battle will start with no intro.
special 0x3E // Special that makes a default battle happen. Required.
playsong 0x??? 0x0 // What song you want during battle.
trainerbattle 0x0 0x??? 0x0 @intro @defeated
setflag 0x???? // *Trainer has been beaten.
release
end

#org @nobattle
msgbox @afterward MSG_KEEPOPEN
release
end

#org @intro
= Hi there. I can beat you. Easily.

#org @defeated
= You just killed me bro!

#org @afterward
= See you around. My team's wasted...

*= About the setflag commands... This script was mostly made for special trainer battles (ones where they don't challenge you on sight like the average route trainer). I tested it without the setflag and with a typical trainer ID and the battle could be repeated over and over without them, likely because of the additional commands in this script that aren't in normal battles.

Now, Special 0x3E is the real key here. It's purpose is to simply start a trainer battle that can be customized somewhat as long as things are in the right order. If you don't use it, as far as I know it will never give you the right results. It has specific equivalents in the other games (Ruby, FireRed), and you can find those in their special lists which have been publicized already.

EDIT: The values you use for "playsong" can be found in Advance-Map's "Musik_??.ini" files (be sure to find the correct game code: BPEE for the US Emerald ROM), and in Sappy's song list - though Sappy displays them in decimal instead of hex.

You should be able to pull off this same thing the same way with other types of trainer battles (double, gym), although it could work a little differently. Go ahead and experiment though, make things work for you. Thanks for reading.

UPDATE: Here's a script template I wrote for Gym Battles, which I posted later in this thread: http://romhackersonline.com/showpost...6&postcount=14

Dark Sneasel 31st July 2014 01:58 AM

Thank you very much, I was actually gonna look into this soon :)
I love you for this

Sky0fBlades 1st August 2014 08:48 AM

Quote:

Originally Posted by Dark Sneasel (Post 131327)
Thank you very much, I was actually gonna look into this soon :)
I love you for this

I'm glad you like it. As soon as I remembered how to do this trick, I couldn't wait to share it, especially because of how hard it is to find stuff like this. I plan to post some more guides in the near future.

Bauerklos 7th August 2014 05:10 PM

Is there any way to do this in FireRed?
 
Since I'm not hacking Emerald and that whole ASM thing gives me a headache, is there any way for this to work in Pokemon FireRed and LeafGreen?

Sky0fBlades 8th August 2014 01:06 AM

Quote:

Originally Posted by Bauerklos (Post 131678)
Since I'm not hacking Emerald and that whole ASM thing gives me a headache, is there any way for this to work in Pokemon FireRed and LeafGreen?

Crocky from PC wrote a tutorial like this for FireRed. Here it is. Anyway, the only real difference should theoretically be the value for 'special' in the script. Anything else is just possible differences in the script structure between the games.

Bauerklos 8th August 2014 02:09 AM

Quote:

Originally Posted by Sky0fBlades (Post 131706)
Crocky from PC wrote a tutorial like this for FireRed. Here it is. Anyway, the only real difference should theoretically be the value for 'special' in the script. Anything else is just possible differences in the script structure between the games.

Thanks. I couldn't figure out ASM at all. Glad there are alternatives here and there.

Dark Sneasel 10th August 2014 03:10 AM

So I've been trying this (in a script tile, rather than a normal trainer) and the battle repeats itself. Know how to fix?

Sky0fBlades 10th August 2014 09:42 PM

Quote:

Originally Posted by Dark Sneasel (Post 131763)
So I've been trying this (in a script tile, rather than a normal trainer) and the battle repeats itself. Know how to fix?

Wierd, when I copied this script over to a tile it doesn't repeat once the custom flag is set (although for some reason with a script tile it makes the player face downwards after... May need 'applymovement' to fix that one). What var number + value are you using with the script tile? I may need to see the script also so I can find out what's going on.

Bauerklos 11th August 2014 05:59 PM

Hello again, thanks for your help before by linking to Crocky's guide for this in FireRed.

Now, is there any way to do something like this for regional wild battle music without ASM?

Sky0fBlades 11th August 2014 09:31 PM

Quote:

Originally Posted by Bauerklos (Post 131816)
Hello again, thanks for your help before by linking to Crocky's guide for this in FireRed.

Now, is there any way to do something like this for regional wild battle music without ASM?

Unfortunately, I don't know of any way to do that without ASM. The only place I've seen it is in Jambo51's trainer music controlling guide (it includes changing the wild battle theme by region), which is with ASM and is for FireRed so I've never done it before.


All times are GMT. The time now is 02:33 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
User Alert System provided by Advanced User Tagging (Lite) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Pokémon characters and images belong to Pokémon USA, Inc. and Nintendo.
Pokémon Hackers Online (PHO) is in no way affiliated with or endorsed by Nintendo LLC, Creatures, GAMEFREAK inc,
The Pokémon Company, Pokémon USA, Inc., The Pokémon Company International, or Wizards of the Coast.
All forum/site content (unless noted otherwise) and site designs are © 2006-2013 Pokémon Hackers Online (PHO).

Green Charizard Christos TreeckoLv100