The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Pokemon Emerald: How do I change rematch trainer battles to on demand?

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old November 5th, 2020 (1:29 PM).
jastolze007 jastolze007 is offline
 
Join Date: Jan 2017
Age: 31
Gender: Male
Nature: Bold
Posts: 650
Hey, so I'm completely noobish at scripting. I know that in Emerald, battles are not so easily started, and are (I believe) RTC based. How could I make a battle to an already existing trainer go from the vanilla script to something that you can request as many times as you wish on demand?

So, I'd like the script text to be something like this:
*Talks to trainer*
Trainer: "Wanna rematch?"
Options: Yes/No
Option Yes: Engage battle
Option No: "Alright then, maybe later"

Also, would I need to create a new Person event in Advance Map? (I use PKSV-UI script editor) or can I just edit the existing script and compile it? Also, could this cause any foreseeable glitches after making specific trainers rematch on demand? If I remember correctly, the PokeNav lets you know when a trainer is ready to rebattle. Could that cause any issues if I do this? Also note, I don't know the offsets of the trainers. This is for an older mod called Theta Emerald EX but I can't figure out specific trainer information. What would I need to know beforehand?

Please be willing to explain, step by step how to accomplish this. I'm somewhat used to AM but not to the script editor. I'd appreciate the help! Thanks!
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old November 5th, 2020 (2:02 PM).
mcferaligatr's Avatar
mcferaligatr mcferaligatr is offline
 
Join Date: Nov 2018
Posts: 120
Here's a short script I compiled using XSE:

#dynamic 0x800000
#org @start
trainerbattle 0x0 0x1 0x0 @ch @de
msgbox @t1 0x5
compare 0x800d 0x1
if 0x0 goto @nope

settrainerflag 0x1
trainerbattle 0x0 0x1 0x0 @ch @de

release
end

#org @nope
msgbox @later 0x6
release
end

'-----------------
#org @ch
= Battle time!

#org @de
= How did I lose?

#org @t1
= Want a rematch?


#org @later
= Okay, Maybe later?
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old November 5th, 2020 (2:06 PM).
jastolze007 jastolze007 is offline
 
Join Date: Jan 2017
Age: 31
Gender: Male
Nature: Bold
Posts: 650
Quote:
Originally Posted by mcferaligatr View Post
Here's a short script I compiled using XSE:

#dynamic 0x800000
#org @start
trainerbattle 0x0 0x1 0x0 @ch @de
msgbox @t1 0x5
compare 0x800d 0x1
if 0x0 goto @nope

settrainerflag 0x1
trainerbattle 0x0 0x1 0x0 @ch @de

release
end

#org @nope
msgbox @later 0x6
release
end

'-----------------
#org @ch
= Battle time!

#org @de
= How did I lose?

#org @t1
= Want a rematch?


#org @later
= Okay, Maybe later?
I appreciate that, but if I paste that and compile, will it work the same way? Would I need to know any trainer offset info?
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old November 5th, 2020 (3:17 PM).
mcferaligatr's Avatar
mcferaligatr mcferaligatr is offline
 
Join Date: Nov 2018
Posts: 120
I've only been scripting in XSE and never used PKSV UI, but I don't think that it could be pasted onto PKSV UI from XSE as the codes are not written in the same way. You could however, use XSE for this code and compile it (I recommend it as it has become a modern scripting software) .
As far as trainer offset goes (I'm assuming you are talking about the 0x1 of the trainerbattle command), you have to open up your rom with a trainer editing tool like HTE, and if you make your first trainer (using the ID of 001) that is 0x1 in scritpting (if its 002 its 0x2, if its 010 its 0xA as 10 = A in hexadecimal)
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content

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 9:16 AM.