• 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!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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] Setting flags mid-battle

  • 10
    Posts
    6
    Years
    • Seen Jun 22, 2023
    Hello there,

    I'm messing around with a new rombase and noticed that by setting a flag I can trigger the ability to capture trainer's Pokemon. Doing so works well, however ends the battle meaning Ideally the catchable Pokemon would be saved for last in the enemy's team. As a result I'd like to know if I could somehow set this flag mid-battle, as if I cannot I have to split the battle split up into two phases which seems choppy.
     
    The only reliable idea popping into my head for now is to write an ASM hook to wherever the main battle loop is, loop through the opponent's party, check to see if they only have one pokemon with more than 0 HP. If true, toggle this catchable flag, and then branch to the rest of the main battle loop. You could probably have another flag that you can toggle with an XSE script that, when true, this check is run, otherwise jump straight to the main battle loop (so you can choose which trainers have catchable pokemon).

    I personally have no idea where this hook would be so you'd need a fair amount of research to go this route beforehand.
     
    Back
    Top