• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Script] (Repost) Newbie Scripter Needs Help

  • 5
    Posts
    3
    Years
    • Seen Sep 7, 2024
    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!
     
    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
     
    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!
     
    @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?
     
    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 :)
     
    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.
     
    Last edited:
    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 :)
     
    Back
    Top