The PokéCommunity Forums Fan Games ROM Hacking Tools, Tutorials & Resources
Tutorial Controlling Trainer Battle Music (No ASM)

Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.

Reply
 
Thread Tools
  #1    
Old August 7th, 2013 (4:15 PM).
Crocky's Avatar
Crocky Crocky is offline
SuperScarlet!
 
Join Date: Feb 2009
Posts: 95
Hey All,
Today I stumbled across this thread, which made me find out you can change the wild Pokémon music without ASM. I thought, hey, if you could do this with wild Pokémon, why not trainers?

Introducing the script that makes it all happen, using XSE:

Spoiler:
#dynamic 0x800000
#org @start
lock
faceplayer
checktrainerflag 0x9
if 0x1 goto @alreadybattled
playsong 0x11D 0x0
msgbox @before 0x6
special 0x03B
playsong 0x10A 0x0
trainerbattle 0x0 0x9 0x0 @before @after
release
end

#org @alreadybattled
msgbox @beaten 0x6
release
end

#org @before
= Go, all my fight!

#org @after
= Tch!

#org @beaten
= Your good at this!


If you instert this into a FireRed game using XSE, you will find yourself in a battle with an unnamed cooltrainer who uses a level 5 Ekans, with the great Hoenn trainer battle music instead of the default Kanto trainer battle music. This is because the Hoenn Trainer battle music is still in the FRLG Game, and so are the leftover RS trainer sprites. (You can easily change the trainer you would like to battle, and the music to any music in the Fire Red game)

The way this script works is that it makes the trainer you are interacting with face you, then check to see if you already battled said trainer, because without this you can just re battle the trainer whenever you talk to them. If you didn't, it plays the male trainer encounter (this also can easily be changed) theme, and proceeds to enter the battle. It then plays your selected music for the battle and ends normally.

Currently, this script doesn't work when you give the trainer any amount of view radius above 0. If any of you know a way to stop the trainer battle from looping without the checktrainerflag, I believe it will work with view radius.
Reply With Quote

Relevant Advertising!

  #2    
Old August 12th, 2013 (6:24 AM).
giradialkia's Avatar
giradialkia giradialkia is offline
 
Join Date: Apr 2009
Location: Ireland
Age: 23
Gender: Male
Nature: Timid
Posts: 1,562
This had been left unapproved for a number of days since I wasn't too sure of its validity as a tutorial (it works, but it could do with being developed further). As such, I've approved it in the hopes that it CAN be developed further, and have its kinks worked out.

Furthermore, the following thread is generally very similar, something I only realised upon approving this thread:
http://www.pokecommunity.com/showthread.php?t=305091
__________________

I'm working on an album of Pokémon-inspired music. Check out the Soundcloud link if you're interested!


This is my Soundcloud | | This is my bandcamp
Reply With Quote
  #3    
Old August 12th, 2013 (7:34 AM). Edited August 12th, 2013 by xGal.
xGal's Avatar
xGal xGal is offline
Mhm
 
Join Date: Nov 2011
Location: A tree
Gender: Other
Nature: Relaxed
Posts: 242
Great

Nice found!

Anyway, I think it's better you'll just show the command and not the script itself

What I meant is to just show the:
Code:
special 0x03B
 playsong 0x10A 0x0
 trainerbattle 0x0 0x9 0x0 @before @after
and then, an example of it in a script .

I was looking for this a lot of time, thanks!

EDIT:

Quote:
Originally Posted by Crocky
If any of you know a way to stop the trainer battle from looping without the checktrainerflag, I believe it will work with view radius
Code:
#dynamic 0x800000
 
#org #start
special 0x3B
playsong 0x10A 0x0
trainerbattle 0x0 0x9 0x0 @before @after
msgbox @1 \\This is the message will play after you defeat the trainer. No checktrainerflag is needed.
release
end
 
#org @before
= Let me battle you
 
#org @after
= I battled you!
 
#org @1
= No more battles again.
Also, I have been talking a little with Jambo51 about it and he said it's very limited - it only works with trainers who don't have encounters.

But after all, it can help a little for guys with poor hex editing knowledge .
__________________
Reply With Quote
  #4    
Old August 12th, 2013 (8:28 AM).
Wobbu's Avatar
Wobbu Wobbu is offline
Drag a needle on the good today
 
Join Date: Mar 2012
Location: Stardew Valley
Gender: Male
Nature: Relaxed
Posts: 2,797
ALL OF THIS IS FOR EMERALD

Well, I don't know if this helps, but here's something.

Code:
'---------------
#org 0xEC4617
special 0x139
playsong 0x1FF 0x0
trainerbattle 0x0 0xCE 0x1 0x8EC4637 0x8EC464C
msgbox 0x8EC4656 0x6 '"Did it work?"
release
end


'---------
' Strings
'---------
#org 0xEC4637
= This is a test yo!

#org 0xEC464C
= I lost.

#org 0xEC4656
= Did it work?
If you talk to the trainer, the encounter music will play. If you press A quick enough, then you'll proceed to the battle with the normal battle music. If you don't press A, then you'll battle a ? Pokémon while the encounter music is still playing. After you run or defeat it (catching it will freeze the game), the battle will end like normal. Then you'll be paused in the overworld with the normal map music playing, and then the normal trainer battle will start. After you talk to the trainer again, Gary's champ music will play (playsong 0x1FF 0x0) and the trainer's last used Pokémon will battle you as a wild Pokémon with zero HP.
__________________

Boyboy - Vices
Reply With Quote
  #5    
Old August 12th, 2013 (8:37 AM).
xGal's Avatar
xGal xGal is offline
Mhm
 
Join Date: Nov 2011
Location: A tree
Gender: Other
Nature: Relaxed
Posts: 242
Quote:
Originally Posted by jsziede View Post
ALL OF THIS IS FOR EMERALD

Well, I don't know if this helps, but here's something.

Code:
'---------------
#org 0xEC4617
special 0x139
playsong 0x1FF 0x0
trainerbattle 0x0 0xCE 0x1 0x8EC4637 0x8EC464C
msgbox 0x8EC4656 0x6 '"Did it work?"
release
end
 
 
'---------
' Strings
'---------
#org 0xEC4637
= This is a test yo!
 
#org 0xEC464C
= I lost.
 
#org 0xEC4656
= Did it work?
If you talk to the trainer, the encounter music will play. If you press A quick enough, then you'll proceed to the battle with the normal battle music. If you don't press A, then you'll battle a ? Pokémon while the encounter music is still playing. After you run or defeat it (catching it will freeze the game), the battle will end like normal. Then you'll be paused in the overworld with the normal map music playing, and then the normal trainer battle will start. After you talk to the trainer again, Gary's champ music will play (playsong 0x1FF 0x0) and the trainer's last used Pokémon will battle you as a wild Pokémon with zero HP.
Nice! I will try to improve it on my free time!
__________________
Reply With Quote
  #6    
Old August 12th, 2013 (8:53 AM). Edited August 12th, 2013 by AtecainCorp..
AtecainCorp.'s Avatar
AtecainCorp. AtecainCorp. is offline
Rejishan awake...
 
Join Date: Jun 2008
Location: Takoabe Town (Region Thonsu)
Age: 24
Gender: Male
Nature: Hardy
Posts: 1,225
This code need small remade bro. When I test it in game. It was been script of never ending Battle. I figured way how to use your script <mEYBE ONly Ruby make that failure. But I fix it> This is small fix of this script. But Important to CHECKFLAG section.

#dynamic 0x800000
#org @start
lock
faceplayer
checkflag 0x9
if 0x1 goto @alreadybattled
playsong 0x11D 0x0
msgbox @before 0x6
special 0x03B
playsong 0x10A 0x0
trainerbattle 0x0 0x9 0x0 @before @after
setflag 0x9
release
end

#org @alreadybattled
msgbox @beaten 0x6
release
end

#org @before
= Go, all my fight!

#org @after
= Tch!

#org @beaten
= Your good at this!


And done... It now read flag changes and give you text after Trainer Battle.

We allways set OW People event in 0000 flag. Rom change our flag to that which we needed. And make it new flag known as 1F00 <In my example> Thank you for this script. I use it in my Pokemon Ruby Renev hack. I need post there Team Rocket and Johto Trainer Battle themes. Now with your script i know what to do. Only one task which I must figured is How change by script WIld Battle Theme.

By This limiting I've seen that is Ideal Script for GYM LEADERS and for E4 and CHAMPIONS. By This you can inster separate E4 theme in FRLG.
__________________
- My new Project comming Soon
Reply With Quote
  #7    
Old August 12th, 2013 (11:38 AM).
GoGoJJTech's Avatar
GoGoJJTech GoGoJJTech is offline
(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
 
Join Date: Nov 2012
Location: Earth
Age: 18
Gender: Female
Nature: Jolly
Posts: 2,477
Flag 0x9 is not safe in any game we hack here.
__________________
I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this into your signature.
The HGSS Music Patch - The BW/2 Music Patch - ASM: Switch Music Based on Seasons
Romhack.me Profile - Pokecommunity Profile - Youtube Channel

Support me at my site!
Pokémon Platinum Red and Blue
Reply With Quote
  #8    
Old July 1st, 2014 (8:58 PM).
You Watanabe's Avatar
You Watanabe You Watanabe is offline
Vector to the Heavens
 
Join Date: Feb 2014
Location: Shiganshina District, Wall Maria
Gender: Male
Nature: Adamant
Posts: 425
Can you manipulate victory themes?
I'm doing a FireRed hack and I want to have the villain team to have its own victory theme when beaten, same for the elite four would be the gym leader's victory, and the champion would have its own victory theme. Can you help me out? This is one of my dilemmas. :/
__________________

Sky High's Userpage

Pokémon Dark Jade Version (Coming Soon!)

Hairo Region (Coming Soon!)

Reply With Quote
  #9    
Old April 9th, 2015 (10:34 AM).
Daman's Avatar
Daman Daman is offline
Former Douchebag
 
Join Date: Feb 2015
Location: North Carolina
Gender: Male
Nature: Rash
Posts: 158
Thanks ! This was very helpful !
__________________


Credit goes to EmperorOfTigers, one of the most awesome people I've ever met online!
Reply With Quote
  #10    
Old 3 Weeks Ago (2:17 AM). Edited 3 Weeks Ago by RqTT.
RqTT RqTT is offline
 
Join Date: Jun 2016
Gender: Male
Posts: 1
Hello guys!
I just figured out how to engage a trainer battle with custom music on Fire Red!
Here:
#dynamic 0x80000 --That's what I use..

#org @trainer
lock
faceplayer
checkflag "Put yourflag here"
if 0x1 call @done -Checks if the trainer is beaten, If yes then the script will call @done
msgbox @intro 0x6 -Intro here!!!
playsong "song to play in battle" 0x0
special 0x3B -Required for trainer battle!!
trainerbattle 0x1 "trainer to battle" 0x0 @intro @defeat @after -0x1 for no endless
call @after -It worked for me after i called the subscript @after here

#org @after
-Reminder:
You can continue making a script here, but you can also
just set the flag and end the script by releasing the NPC
setflag "the flag you set at checkflag"
release
end

#org @done
msgbox @battled 0x6
release
end

--Strings Now

#org @intro
= Yo! Let's battle

#org @defeat
= Dammit!

#org @battled
= I'm wasted!

Oh yeah.. Can somebody help me on engaging a wild battle with custom music on FR/LG?
Reply With Quote
  #11    
Old 3 Weeks Ago (3:11 AM).
Pokémon MB and GG Versions's Avatar
Pokémon MB and GG Versions Pokémon MB and GG Versions is offline
Rom Hacker
 
Join Date: Mar 2017
Posts: 48
I was just wondering if this would work, but I hadn't tried it yet. Awesome!
__________________
Coming soon...

More info to come!
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 10:53 PM.