• 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!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking 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.

[Eventing Question] How to use "outcomes" for battles?

  • 1
    Posts
    1
    Years
    • Seen May 29, 2023
    Hello, I am trying to script a loseable battle where afterwords an NPC has a different comment depending on whether or not you have won. I have been looking on the wiki and found the outcome and losebattle commands. However I am not very sure on how outcome works, it mentions needing an additional parameter that gives the number of the Game Variable to use however I am not entirely sure how to set this up. Could nayone give advice? Currently my attempt looks like this:

    Script: setBattleRule("canLose")
    Script: setBattleRule("Outcome", 42)
    Conditional Brance: Script: TrainerBattle.start(:RIVALF, "Dawn", 1)
    Script: pbTrainerEnd
    Conditional Branch: Variable [0001:Temp Pokemon Choice] == 1
    Text: \bDawn: Wow you're strong!
    Else
    Text: \bDawn: You still have some work to do.
     
    The outcome is automatically saved in game variable 1 without you setting a battle rule.
    Though a battle will automatically return false if the player loses or draws, and true otherwise, so you really only need to do the battle in the conditional branch.
    Code:
    Script: setBattleRule("canLose")
    Conditional Branch: Script: TrainerBattle.start(:RIVALF, "Dawn", 1)
      Text: Wow, you're pretty good.
    Else
      Text: Wow, you're pretty bad.
    Branch End
    Control Self Switch: A=ON
    Script: pbTrainerEnd
     
    Back
    Top