• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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
352
Days
    • 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.
     
    1,682
    Posts
    8
    Years
    • Seen today
    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