The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Script What command was it to play music in battles? (https://www.pokecommunity.com/showthread.php?t=417457)

Ace Trainer Slash January 23rd, 2019 2:18 AM

What command was it to play music in battles?
 
Hi. :)

So, since I'm making a hack (for Fire Red), where most important trainers in the game intend to use the Champion's battle theme, I'm not sure what command, nor where to put it within a script. I can create a simple trainer battle script, but I'm unsure what command it is to play that specific theme during a trainer battle, nor where I should put that command in the script to actually function.

Any help is greatly appreciated. :)

Ace Trainer Slash January 23rd, 2019 11:25 PM

Quote:

Originally Posted by Petuuuhhh (Post 9971378)
So this should play a song before you start the trainerbattle. Make sure to read XSE's scripting commands to see how playsong works.
Code:

special 0x03B
playsong
trainerbattle



Ok, so I executed the script, specifically like this:
special 0x03B
playsong 0x12B 0x0
trainerbattle etc...

And the result was my trainer crashing the game, and turning the screen red, what was it that I did incorrectly?

DrFuji January 24th, 2019 12:46 AM

If you've attached the script to a trainer with a view radius, the game will crash; the only battles you can give battles custom music via scripting are ones that are activated by talking to an NPC or by stepping on a green script tile. This is because a trainer with a view radius must have trainerbattle as the first command in the script.

If in your case the script isn't attached to a trainer with a view radius then ¯\_(ツ)_/¯

Ace Trainer Slash January 24th, 2019 2:13 AM

Quote:

Originally Posted by DrFuji (Post 9971488)
If you've attached the script to a trainer with a view radius, the game will crash; the only battles you can give battles custom music via scripting are ones that are activated by talking to an NPC or by stepping on a green script tile. This is because a trainer with a view radius must have trainerbattle as the first command in the script.

If in your case the script isn't attached to a trainer with a view radius then ¯\_(ツ)_/¯

Ah, ok, well that's ok I guess, I wanted to give Youngster Joey his own Champion battle theme to be somewhat funny, but normal trainer battle fits too. I've got some stationary trainers in my hack that will utilise this information perfectly. :) Thanks for the help!, and to Petuuuhhh too! :)

BirdstarCat13 January 24th, 2019 4:59 AM

Firstly - Welcome back!

Secondly - I think this might be what you're looking for

Ace Trainer Slash January 24th, 2019 8:58 PM

Quote:

Originally Posted by BirdstarCat13 (Post 9971557)
Firstly - Welcome back!

Secondly - I think this might be what you're looking for

Firstly, Thankyou for welcoming me back, secondly, this should be useful too! Thanks! :D


All times are GMT -8. The time now is 9:13 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.