The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Script (Repost) Newbie Scripter Needs Help (https://www.pokecommunity.com/showthread.php?t=451116)

SixtySixRoses May 17th, 2021 4:06 AM

(Repost) Newbie Scripter Needs Help
 
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!

Asith May 17th, 2021 8:25 PM

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

Anon822 May 18th, 2021 1:30 AM

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.

SixtySixRoses May 19th, 2021 1:25 AM

Quote:

Originally Posted by Asith (Post 10359505)
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!

kalarie May 19th, 2021 1:44 AM

@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?

Asith May 19th, 2021 6:49 AM

Quote:

Originally Posted by SixtySixRoses (Post 10360114)
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 :)

SixtySixRoses May 19th, 2021 11:31 AM

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.

Asith May 20th, 2021 10:25 AM

Quote:

Originally Posted by SixtySixRoses (Post 10360334)
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 :)


All times are GMT -8. The time now is 9:17 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.