Advertiser Content

Crocky

SuperScarlet!

Seen 8 Hours Ago
Posted November 19th, 2016
95 posts
10.2 Years
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.

giradialkia

Age 25
Male
Ireland
Seen 4 Weeks Ago
Posted March 25th, 2019
1,555 posts
10.1 Years
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

xGal

Mhm

Non-binary
A tree
Seen February 16th, 2018
Posted May 20th, 2017
243 posts
7.6 Years
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:
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:

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
#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 ;).

Wobbu

Drag a needle on the good today

Male
Stardew Valley
Seen August 28th, 2016
Posted August 28th, 2016
2,793 posts
7.2 Years
ALL OF THIS IS FOR EMERALD

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

'---------------
#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.

My Favorite Song

xGal

Mhm

Non-binary
A tree
Seen February 16th, 2018
Posted May 20th, 2017
243 posts
7.6 Years
ALL OF THIS IS FOR EMERALD

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

'---------------
#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!

AtecainCorp.

Rejishan awake...

Age 26
Male
Takoabe Town (Region Thonsu)
Seen 42 Minutes Ago
Posted 6 Days Ago
1,339 posts
10.9 Years
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

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)

Age 20
Female
Earth
Seen December 9th, 2016
Posted December 5th, 2016
2,473 posts
6.6 Years
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

Xencleamas

Suddenly lurking in the shadows...

Male
Asgard
Seen January 21st, 2019
Posted August 7th, 2018
460 posts
5.3 Years
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. :/

Xencleamas Untitled Pokémon Fan Game (Coming Soon!) Untitled Region (Coming Soon!)
Male
Seen March 31st, 2019
Posted September 3rd, 2017
2 posts
2.9 Years
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?
Advertiser Content