The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script (Repost) Newbie Scripter Needs Help

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 May 17th, 2021 (4:06 AM).
SixtySixRoses SixtySixRoses is offline
 
Join Date: May 2021
Posts: 5
I had what I thought was a simple idea for a bit of extra postgame content in FireRed: creating Gym Leader rematches on the Sevii Islands. I think I bit off more than I could chew. Following Anthroyd's tutorials on YouTube got me started and I can make a functional trainer battle, but tinkering with XSE and trying to make anything more complex yields a minefield of errors. If anyone more experienced could lend me some advice I would be very grateful!
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old May 17th, 2021 (8:25 PM).
Asith's Avatar
Asith Asith is offline
Uwao
 
Join Date: Nov 2020
Posts: 204
Could you be more specific in what your problems are? What you want to do is definitely possible, so if you post some of your scripts we can find the mistakes in them. What errors are you getting? It's also worth noting that re-editing an already compiled script may come with problems depending on size, so your problem may be there too. It's easiest to finalize your script and compile it into fresh space once you're sure it works, and just discard the testing phases
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old May 18th, 2021 (1:30 AM).
Anon822 Anon822 is offline
 
Join Date: Nov 2017
Posts: 326
You could check out some of the scripting tutorials on this site like: https://www.pokecommunity.com/showthread.php?t=397107
You could also look at the game's original scripts to learn how specific things are done.
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old May 19th, 2021 (1:25 AM).
SixtySixRoses SixtySixRoses is offline
 
Join Date: May 2021
Posts: 5
Quote:
Originally Posted by Asith View Post
Could you be more specific in what your problems are? What you want to do is definitely possible, so if you post some of your scripts we can find the mistakes in them. What errors are you getting? It's also worth noting that re-editing an already compiled script may come with problems depending on size, so your problem may be there too. It's easiest to finalize your script and compile it into fresh space once you're sure it works, and just discard the testing phases
So my idea was to try and set the trainer flag after each fight so you could rematch without using the VS Seeker. I realize this probably looks like gibberish but I am NEW to this. The main issue I run into at this point is correcting parameters, but that's probably not the only issue.

'---------------
#dynamic 0x800000
#org @start
lock
faceplayer
trainerbattle 0x0 0x001 0x0 0x880005E 0x880004F @continue
release
end


'---------
' Strings
'---------

#org @continue
msgbox @afterText 0x6
settrainerflag 0x001
release
end

#org @afterText
= You're good!

#org 0x80005E
= Let's see if this works.

#org 0x80004F
= You beat me!
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old May 19th, 2021 (1:44 AM).
kalarie kalarie is offline
 
Join Date: Jun 2008
Posts: 760
@SixtySixRoses

Check how the vanilla games set up trainerbattles. If you toggle ''trainer'' in AdvanceMap, set a view radius and an NPC will walk up to you in-game, the game will crash if you use the script above. A regular trainerbattle script always starts with a trainerbattle command (not lock or faceplayer).

It would probably require some ASM te set-up rematches in an proper manner. Why would you want to get rid if the VS Seeker anyway?

Edit: Just read your first comment. If you only want to set-up rematches for gym leaders, that would be perfectly possible without ASM. Since those are only triggered when you talk to them and not when walking in their view radius. The way you set them up right now will cause the exact same battle to happen again. Not sure whether you want that?
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old May 19th, 2021 (6:49 AM).
Asith's Avatar
Asith Asith is offline
Uwao
 
Join Date: Nov 2020
Posts: 204
Quote:
Originally Posted by SixtySixRoses View Post
So my idea was to try and set the trainer flag after each fight so you could rematch without using the VS Seeker. I realize this probably looks like gibberish but I am NEW to this. The main issue I run into at this point is correcting parameters, but that's probably not the only issue.

'---------------
#dynamic 0x800000
#org @start
lock
faceplayer
trainerbattle 0x0 0x001 0x0 0x880005E 0x880004F @continue
release
end


'---------
' Strings
'---------

#org @continue
msgbox @afterText 0x6
settrainerflag 0x001
release
end

#org @afterText
= You're good!

#org 0x80005E
= Let's see if this works.

#org 0x80004F
= You beat me!
So what happens with this script that is your error, exactly? If you're trying to let the player infinitely repeat the same battle, then this script is pretty close to perfect. The only glaring mistake I see is that, iirc, when you do a trainer battle with an @continue pointer like that it should be trainerbattle 0x1. You've used trainer battle 0x0, which shouldn't have that function.
That's the main fix - if you're trying to accomplish something else or if that doesn't fix your issue feel free to reply :)
Reply With Quote
  #7   Link to this post, but load the entire thread.  
Old May 19th, 2021 (11:31 AM). Edited May 19th, 2021 by SixtySixRoses.
SixtySixRoses SixtySixRoses is offline
 
Join Date: May 2021
Posts: 5
Creating an infinitely repeatable battle was my goal, so I'm glad I had the right idea. I wanted to also include a dialogue box that changes after the first fight. 0x80004F is obviously the dialogue box to introduce the fight, but I'm not sure how to subsequently change it.

The main problem I keep running into is in trying to compile, XSM says there are too many parameters defined on the "trainerbattle" line.
Reply With Quote
  #8   Link to this post, but load the entire thread.  
Old May 20th, 2021 (10:25 AM).
Asith's Avatar
Asith Asith is offline
Uwao
 
Join Date: Nov 2020
Posts: 204
Quote:
Originally Posted by SixtySixRoses View Post
Creating an infinitely repeatable battle was my goal, so I'm glad I had the right idea. I wanted to also include a dialogue box that changes after the first fight. 0x80004F is obviously the dialogue box to introduce the fight, but I'm not sure how to subsequently change it.

The main problem I keep running into is in trying to compile, XSM says there are too many parameters defined on the "trainerbattle" line.
That's because, well, you're defining too many parameters on the trainerbattle line :P
Like I said, the trainerbattle 0x0 you're using does not allow for the @continue pointer. It's for normal trainer battles, with only text pointers. What you need is tarinerbattle 0x1, a different type used for gym battles and such.
The trainerbattle line should be:
trainerbattle 0x1 0x001 0x0 0x880005E 0x880004F @continue

Again, that's the main error I see, so hopefully that small change is enough to fix your main problem :)
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
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 9:17 AM.