PHO - Pokémon Hackers Online
Go Back   PHO - Pokémon Hackers Online > Other Generations Hacking > Guides & Documentation

Guides & Documentation Learn how to make your own Pokémon game through the process of ROM Hacking, or help out the community by sharing your information.

Reply
 
Thread Tools Display Modes
Old 13th August 2014, 10:18 PM   #11
Dark Sneasel
Anti-Swag
 
Join Date: Oct 2013
Location: Miami, FL
Age: 17
Posts: 42
Dark Sneasel
Default

Quote:
Originally Posted by Sky0fBlades View Post
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.
I no longer have the script, but if I remember correctly, it was someone approaching you, they say something, then this stuff
special 0x3E
playsong 0x??? 0x0
trainerbattle 0x0 0x??? 0x0 @intro @defeated
and then finally a var was set to prevent the things from happening again. I'll try to remake the script later.
Dark Sneasel is offline   Reply With Quote
Sponsored Links
Old 14th August 2014, 04:48 AM   #12
Sky0fBlades
Emerald Hacker
Moderator
 
Sky0fBlades's Avatar
 
Join Date: Sep 2012
Location: Ice Path
Age: 25
Posts: 138
Sky0fBlades
Default

Quote:
Originally Posted by Dark Sneasel View Post
I no longer have the script, but if I remember correctly, it was someone approaching you, they say something, then this stuff
special 0x3E
playsong 0x??? 0x0
trainerbattle 0x0 0x??? 0x0 @intro @defeated
and then finally a var was set to prevent the things from happening again. I'll try to remake the script later.
Is the trainer battle you made used with there being a checkmark in the box in A-Map that says 'Trainer', and/or has a View Radius? If so, I imagine it may cause some problems with this kind of script. I have no proof of that, though.

From what you're saying about using a variable you seem to know already, but just as a reminder for everyone: since the lines that work with changing the music are supposed to come before the actual 'trainerbattle' command, it requires that you use flags or variables at the start of the whole script to stop the music stuff and default-style battle from happening again (regardless if the actual trainerflag is set or not) so that it will instead go to what the trainer says/does after you've beaten them.

I'd personally recommend you use flags instead of variables in Emerald if you want to stop events from happening again, since there are very few really safe variables in this game at all. I'll be updating it with more later. If you need flags, check out Diegoisawesome's XSE Scripting Guide.

This method was mostly meant for a battle that works in a similar way to the Steven battle in Emerald, where you talk to them (or through a story-like event) and they say their lines and the battle starts. I haven't tested it with the kind of battle you're doing; I haven't worked with those in forever since I'm leaving most trainers as they are in my hack but with stronger teams.

Once you post the remake of the script you were doing, I'll see if I can make it work properly. Let me know what variable you're using if you can.

Last edited by Sky0fBlades; 29th November 2014 at 05:16 AM.
Sky0fBlades is offline   Reply With Quote
Old 23rd February 2015, 10:28 PM   #13
64smashmaster3ds
n00b
 
64smashmaster3ds's Avatar
 
Join Date: Jan 2015
Posts: 1
64smashmaster3ds
Default

Could you make a sample script for gym battles and other type of boss battle. Also setting the checkflag, trainerbattle, setflag for a trainer and gym leader.
64smashmaster3ds is offline   Reply With Quote
Old 18th March 2015, 09:11 AM   #14
Sky0fBlades
Emerald Hacker
Moderator
 
Sky0fBlades's Avatar
 
Join Date: Sep 2012
Location: Ice Path
Age: 25
Posts: 138
Sky0fBlades
Default

Quote:
Originally Posted by 64smashmaster3ds View Post
Could you make a sample script for gym battles and other type of boss battle. Also setting the checkflag, trainerbattle, setflag for a trainer and gym leader.
Unfortunately I've been away for quite some time (college stuff) and haven't been hacking much but I did manage to throw together a basic Gym Leader sequence with this trick in it. Unlike your typical GL script, this one has a different structure to accomodate the weirdness that Special 0x3E causes if it isn't in the right places. I've tested it a few times, and it works perfectly for me. It doesn't include the other stuff like variable setting and deactivating the surrounding trainers, but it serves the purpose (as in, first a battle, then it gives the player the badge, sets the flag for it, and gives the player a TM once). You'll have to modify the text lines and add in what values you want but with the find-and-replace feature in XSE you can replace the little groups of 3 symbols described in the top line based on what they affect:
Code:
// Custom GYM LEADER battle with changeable battle music. Symbol sets to replace: ###, $$$, %%%, ???

#freespace 0xFF
#dynamic 0x9C0B20

#org @start
lock
faceplayer
checkflag 0x### // Checks if the TM has been given to you.
if 0x0 goto @battle_or_tm
msgbox @after_2 MSG_KEEPOPEN
release
end

#org @battle_or_tm
checkflag 0x$$$ // Has player gotten the badge?
if 0x0 goto @battleforbadge
giveitem ITEM_TM01 0x1 MSG_OBTAIN // Give player a TM.
compare LASTRESULT 0x0 // Is bag full?
if 0x1 goto @bagfull
setflag 0x### // You've gotten the TM.
msgbox @tmdescription MSG_KEEPOPEN
release
end

#org @battleforbadge
msgbox @intro MSG_KEEPOPEN
special 0x3E // Special that makes a default battle happen. Required.
playsong 0x%%% 0x0 // What song you want during battle.
trainerbattle 0x1 0x??? 0x0 @intro @defeat @after_1
goto @after_1 // Must put this here even though it is in the above line, or it won't work.

#org @bagfull
msgbox @fullmessage MSG_KEEPOPEN
release
end

#org @after_1
preparemsg @receivedbadge
waitmsg
call @badgefanfare
setflag 0x$$$ // Player now has this badge.
msgbox @describebadge MSG_KEEPOPEN
goto @battle_or_tm
release
end

#org @badgefanfare
fanfare 0x171
waitfanfare
return

#org @intro
= Hi there, welcome to my GYM.\pLet's battle now!

#org @defeat
= Alright, you win.

#org @receivedbadge
= [player] received the MYSTERY BADGE\nfrom LEADER.

#org @tmdescription
= That TECHNICAL MACHINE, TM01,\ncontains COOLMOVE.\pIt not only does THIS, but it\nalso does THIS too.

#org @describebadge
= The MYSTERY BADGE heightens the ATTACK\n of your POKéMON.\pIt also enables them to use the HM move\nWHIRLPOOL outside of battle.\pPlease take this TM, too.

#org @after_2
= Good luck on your path to the LEAGUE.

#org @fullmessage
= Uh... You have at least 99 of this TM.\nDid you.... cheat, or something?
The first script I posted is meant mainly for "boss"-like battles since it won't really work properly as far as I know for trainers who battle you on sight (not including ones where you've directly scripted one like that). If you want Elite-4 Battles to be like this you must make similar changes as outlined in the commented sections inside the script. A more permanent and thorough way to get the Gyms and E4 to play the themes you want is to switch/edit the default songs and their voicegroups using a GBA music editing program like Sappy 2006 Mod-17. Good luck, feel free to post if you need any more help.

Last edited by Sky0fBlades; 13th January 2017 at 03:18 AM. Reason: spelling error
Sky0fBlades is offline   Reply With Quote
Old 8th November 2015, 04:24 PM   #15
Gameskiller01
n00b
 
Join Date: Nov 2015
Posts: 4
Gameskiller01
Smile Changing Steven's Music

What I'm trying to do is change Steven's music in Pokémon Emerald to the champion music because his default music is the rival music and I really don't think that suits him at all, being a final boss and all, but I still want the rival to have that music. Would that just be like this or would it be something completely different. Also, if it isn't to much trouble, can you tell me what the 'playsong' value for the champion music is in Pokémon Emerald (I'm a bit unsure about where to find it in Advanced-Map's file). P.S. Sorry if any of this is very obvious, I'm pretty new to hacking. Thanks!
Gameskiller01 is offline   Reply With Quote
Old 21st November 2015, 05:53 AM   #16
Sky0fBlades
Emerald Hacker
Moderator
 
Sky0fBlades's Avatar
 
Join Date: Sep 2012
Location: Ice Path
Age: 25
Posts: 138
Sky0fBlades
Default

Quote:
Originally Posted by Gameskiller01 View Post
What I'm trying to do is change Steven's music in Pokémon Emerald to the champion music because his default music is the rival music and I really don't think that suits him at all, being a final boss and all, but I still want the rival to have that music. Would that just be like this or would it be something completely different. Also, if it isn't to much trouble, can you tell me what the 'playsong' value for the champion music is in Pokémon Emerald (I'm a bit unsure about where to find it in Advanced-Map's file). P.S. Sorry if any of this is very obvious, I'm pretty new to hacking. Thanks!
I completely agree with you about the choice of his music, as I am doing the same thing in my hack as you are doing in yours as far as that goes. Yes, this kind of scripting will definitely work with Steven's battle as well. You'd just need to either carefully alter his current script to include your changes without corrupting anything, or just re-compile the new script into free space. The playsong value for the Champion battle in Pokémon Emerald is 01DE, it can be found in the "Header" tab in A-Map after you've loaded a map from the game.

Last edited by Sky0fBlades; 21st November 2015 at 05:56 AM.
Sky0fBlades is offline   Reply With Quote
Old 9th January 2016, 11:49 AM   #17
Gameskiller01
n00b
 
Join Date: Nov 2015
Posts: 4
Gameskiller01
Default

Quote:
Originally Posted by Sky0fBlades View Post
I completely agree with you about the choice of his music, as I am doing the same thing in my hack as you are doing in yours as far as that goes. Yes, this kind of scripting will definitely work with Steven's battle as well. You'd just need to either carefully alter his current script to include your changes without corrupting anything, or just re-compile the new script into free space. The playsong value for the Champion battle in Pokémon Emerald is 01DE, it can be found in the "Header" tab in A-Map after you've loaded a map from the game.
Thanks! You know how I'm still really dumb? How would I find Steven's existing script in XSE? I feel like if I was to compile the new script I'd almost definitely do something wrong. Sorry for bothering you this much, I did do a Google search to see if I could find anything without having to bother you again, but nothing came up. Thanks again for all your help! :)

EDIT: Or if you could tell me how to safely compile the new script that would be fine as well, whichever is easier for you. Thanks again!
Gameskiller01 is offline   Reply With Quote
Old 19th January 2016, 09:17 AM   #18
Sky0fBlades
Emerald Hacker
Moderator
 
Sky0fBlades's Avatar
 
Join Date: Sep 2012
Location: Ice Path
Age: 25
Posts: 138
Sky0fBlades
Default

Quote:
Originally Posted by Gameskiller01 View Post
Thanks! You know how I'm still really dumb? How would I find Steven's existing script in XSE? I feel like if I was to compile the new script I'd almost definitely do something wrong. Sorry for bothering you this much, I did do a Google search to see if I could find anything without having to bother you again, but nothing came up. Thanks again for all your help!

EDIT: Or if you could tell me how to safely compile the new script that would be fine as well, whichever is easier for you. Thanks again!
Hey, no problem! I wanted to go ahead and tell you how to do both things (especially since others may be wondering the same thing too), and I also really do appreciate your gratitude. Don't worry, you aren't a bother at all: especially since you have been trying to figure this stuff out on your own as well. As for your questions:

You can find the offset for the script in A-Map, it is located in the events tab for Steven's location in Meteor Falls when his sprite is selected in the viewer (which should be automatic since he is the only sprite on this paticular map). From here, you can open the ROM in XSE and enter that script offset in the offset box and click on the 'screwdriver and wrench' icon next to it to decompile the script.

A much easier way to do this though is to use A-Map's "Open script" button which is a bit below where it shows the offset from earlier. To make it work though, you'll have to have it set to open XSE as your script editor (you can do that by clicking "Choose script editor" in A-Map's Settings drop-down menu and locating XSE's executable file). In the prompt that asks you about separation of the offset from the ROM name, just go ahead and hit "No". From then on, it should open the scripts you want as long as you have one selected in A-Map.

To compile your finished script to free space instead, you will have to replace the script addresses in the parts you edited with a dynamic label, like "@myscriptstartshere". An example of this kind of thing is my script in post #14. To be safe, I typically just replace all used offsets with dynamic labels so they get their own space away from the normal data when compiled.The whole script (like my example) should start with:
#freespace 0xFF <---- To make sure the right kind of space is used.
#dynamic 0x?????? <---- Your free space offset.

Last edited by Sky0fBlades; 19th January 2016 at 09:29 AM.
Sky0fBlades is offline   Reply With Quote
Old 12th May 2016, 04:50 PM   #19
Gameskiller01
n00b
 
Join Date: Nov 2015
Posts: 4
Gameskiller01
Default Welp

So I finally finished the main game of Emerald on my playthrough and went to fight Steven, who has now got the champion battle theme (thanks btw), but after I beat him another battle starts immediately after, before the msgbox can even show up. It just goes to the overworld and starts a new battle. I don't know why this is. If you could offer any help it would be greatly appreciated.
Here's my script. (Before I compiled it and XSE changed everything into hex).

Code:
'---------------
#freespace 0xFF
#dynamic 0xE3E2CA

#org @start
lock
checkflag 0x4F8
if 0x1 goto @nobattle
checksound
sound 0x15
applymovement 0x1 0x8272598
waitmovement 0x0
applymovement 0x1 0x827259A
waitmovement 0x0
applymovement 0x1 0x827259E
waitmovement 0x0
msgbox @intro MSG_KEEPOPEN '"STEVEN: Oh, wow, [player]\v\h05.\n..."
special 0x3E
playsong 0x1DE 0x0
trainerbattle 0x0 0x324 0x0 @intro @defeated
msgbox @afterwards MSG_KEEPOPEN '"STEVEN: Come to think of it, ever ..."
setflag 0x4F8
release
end

'---------------
#org @nobattle
applymovement 0x1 0x827259E
waitmovement 0x0
msgbox @afterwards MSG_KEEPOPEN '"STEVEN: Come to think of it, ever ..."
release
end


'---------
' Strings
'---------
#org @intro
= STEVEN: Oh, wow, [player]\v\h05.\nI'm amazed you knew where to find me.\pDo you, uh[.]maybe think of me as\njust a rock maniac?\pNo, that can't be right.\pWe battled alongside each other at\nthe SOOTOPOLIS SPACE CENTER.\pYou should have a very good idea\nabout how good I am.\pOkay, [player]\v\h05, if you're going to mount\na serious challenge, expect the worst!

#org @defeated
= You[.]\nI had no idea you'd become so strong[.]

#org @afterwards
= STEVEN: Come to think of it, ever since\nour paths first crossed in GRANITE\lCAVE in DEWFORD, I had this feeling.\pI thought that you would eventually\nbecome the CHAMPION.\pMy predictions usually come true.\pAnd where will you go from here?\p[.] [.] [.] [.] [.] [.]\n[.] [.] [.] [.] [.] [.]\pFufufu, even I couldn't tell you that.


'-----------
' Movements
'-----------
#org 0x272598
#raw 0x56 'Exclamation Mark (!)
#raw 0xFE 'End of Movements

#org 0x27259A
#raw 0x14 'Delay5
#raw 0x14 'Delay5
#raw 0x14 'Delay5
#raw 0xFE 'End of Movements

#org 0x27259E
#raw 0x3E 'Face Player
#raw 0xFE 'End of Movements
And here's it afterwards

Code:
'---------------
#org 0xE3E2CA
lock
checkflag 0x4F8
if 0x1 goto 0x8E3E321
checksound
sound 0x15
applymovement 0x1 0x8272598
waitmovement 0x0
applymovement 0x1 0x827259A
waitmovement 0x0
applymovement 0x1 0x827259E
waitmovement 0x0
msgbox 0x8E3E336 MSG_KEEPOPEN '"STEVEN: Oh, wow, [player]\v\h05.\n..."
special 0x3E
playsong 0x1DE 0x0
trainerbattle 0x0 0x324 0x0 0x8E3E336 0x8E3E484
msgbox 0x8E3E4B1 MSG_KEEPOPEN '"STEVEN: Come to think of it, ever ..."
setflag 0x4F8
release
end

'---------------
#org 0xE3E321
applymovement 0x1 0x827259E
waitmovement 0x0
msgbox 0x8E3E4B1 MSG_KEEPOPEN '"STEVEN: Come to think of it, ever ..."
release
end


'---------
' Strings
'---------
#org 0xE3E336
= STEVEN: Oh, wow, [player]\v\h05.\nI'm amazed you knew where to find me.\pDo you, uh[.]maybe think of me as\njust a rock maniac?\pNo, that can't be right.\pWe battled alongside each other at\nthe SOOTOPOLIS SPACE CENTER.\pYou should have a very good idea\nabout how good I am.\pOkay, [player]\v\h05, if you're going to mount\na serious challenge, expect the worst!

#org 0xE3E484
= You[.]\nI had no idea you'd become so strong[.]

#org 0xE3E4B1
= STEVEN: Come to think of it, ever since\nour paths first crossed in GRANITE\lCAVE in DEWFORD, I had this feeling.\pI thought that you would eventually\nbecome the CHAMPION.\pMy predictions usually come true.\pAnd where will you go from here?\p[.] [.] [.] [.] [.] [.]\n[.] [.] [.] [.] [.] [.]\pFufufu, even I couldn't tell you that.


'-----------
' Movements
'-----------
#org 0x272598
#raw 0x56 'Exclamation Mark (!)
#raw 0xFE 'End of Movements

#org 0x27259A
#raw 0x14 'Delay5
#raw 0x14 'Delay5
#raw 0x14 'Delay5
#raw 0xFE 'End of Movements

#org 0x27259E
#raw 0x3E 'Face Player
#raw 0xFE 'End of Movements
Nvm, I was being an idiot. XD I forgot to change the script offset in A-Map. Sorry. Even after months, I'm still stupid. XD

Last edited by Gameskiller01; 12th May 2016 at 05:08 PM.
Gameskiller01 is offline   Reply With Quote
Old 2nd July 2016, 01:00 AM   #20
Sky0fBlades
Emerald Hacker
Moderator
 
Sky0fBlades's Avatar
 
Join Date: Sep 2012
Location: Ice Path
Age: 25
Posts: 138
Sky0fBlades
Default

@Gameskiller01

No problem, we are all a little forgetful sometimes but it's great you've got it all working though. Good luck with the rest of your work and if you need any more help with this stuff feel free to ask of course. The forum may not be very active anymore but I'll still drop in once in a while at least.
Sky0fBlades is offline   Reply With Quote
Likes Gameskiller01 liked this post
Reply

Tags
asm, battle, controlling, emerald, music, trainer, [Tutorial]

Thread Tools
Display Modes

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. The time now is 10:46 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc. User Alert System provided by Advanced User Tagging (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2017 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

"Black 2" by ARTPOP. Kyurem artwork by XOUS.

no new posts