• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Scottie, Todd, Serena, Kris - 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.

"Outcome" comment for trainers

  • 224
    Posts
    9
    Years
    • Seen Feb 20, 2025
    So I am refering to the "Trainers" page of the wiki:

    Outcome: 42
    The outcome of this battle will be stored in the Global Variable with this number.

    Regardless if the player wins or lose the battle, Variable 42 remains equal to 1.

    I thought it meant win =1, lose=0 or something like that, but it appears I am wrong... Does anyone know how to use this comment?
     
    As it says at the top of the script section PokeBattle_Battle:

    # Results of battle:
    # 0 - Undecided or aborted
    # 1 - Player won
    # 2 - Player lost
    # 3 - Player or wild Pokémon ran from battle, or player forfeited the match
    # 4 - Wild Pokémon was caught
    # 5 - Draw
     
    I am coming back to this because it seems I can't get the "Outcome" comment working. I want the trainer to lose a specific battle as a condition for moving forward.

    So I believe it should work like this:

    1st page
    Comment: Outcome: 60
    Script: pbTrainerIntro(:BUGCATCHER)
    Control Self Switch: A = ON
    Conditional Branch: Script: pbTrainerBattle(PBTrainers::BUGCATCHER,"Blabla",_I("..."),true,0,true)
    Script: pbTrainerEnd
    Branch End

    2nd page
    Conditions: Self Switch A = ON

    Conditional Branch: Variable [0060: Outcome]=2 (2= lost)
    Text: You let me win! Thanks! ...
    Else
    Text: Oh no, I lost...

    My issue is really about obtaining the battle outcome. Regardless if the player wins or loses the battle, variable 60 remains equal to 0 (as if the comment wasn't doing anything).
    I compiled the game several times but it doesn't work any better.

    Any advice? Thanks!
     
    You can't mix and match the comments with other event commands. You either need to use all the comments required to make the trainer you need, or you'll need to make the trainer event entirely out of other event commands. You can use the comments to generate a basic trainer's commands, then remove the comments and modify the commands if you need to.

    You can also look at the wiki, to which I've just added the information specific to your question (there's a lot of stuff missing from the wiki).
     
    Thank you for the reply! By using this information:

    7. Optional. The number of the game variable in which to store the outcome of the battle. By default, no outcome is stored.


    It is working just fine!
     
    Back
    Top