• 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] Battle's result

37
Posts
5
Years
    • Seen Jul 25, 2020
    I don't get really much how to create events based on the result of a battle, i want a text to appear if i win and an other one if i lose, can someone explain me step by step how to do this?
     

    Poq

    144
    Posts
    6
    Years
    • Seen Aug 28, 2021
    From the wiki:
    pbTrainerBattle itself has six arguments:

    1. The trainer type.
    2. The trainer's name.
    3. A message that is shown at the end of the battle (before the battle screen is closed).
    4. Optional. Double battle. TRUE if it is a double battle, FALSE if it isn't. If this is TRUE, then you must also check before the battle whether the player has at least 2 able Pokémon, and forbid the battle if they don't. Default is FALSE.
    5. Optional. A number used to distinguish between different versions of the same trainer (see above). Is 0 if there is only one version. Default is 0.
    6. Optional. Whether the player can continue after losing the battle. If TRUE, the player's party is fully healed upon losing the battle. You should also modify the Conditional Branch to include the "Set handling when conditions do not apply" option (i.e. an "else" part of that Branch), and insert something in there that says the player has lost the battle (you must also set a Self Switch to ON here, like if the battle was won, to prevent the trainer instantly re-challenging the player). Default is FALSE (i.e. the player returns to the last Poké Center upon losing).
    7. Optional. The number of the game variable in which to store the outcome of the battle. By default, no outcome is stored.
    Take a close look at 6 and 7. Those are values you can set a conditional branch off of.
     
    172
    Posts
    7
    Years
    • Seen Sep 6, 2022
    I don't get really much how to create events based on the result of a battle, i want a text to appear if i win and an other one if i lose, can someone explain me step by step how to do this?

    Yeah each battle is a conditional branch so it already does that. If you win, then you just continue your script within the conditional branch right underneath the battle line, then you'll notice the "else" that's in it since it's a conditional branch, that's where you put what happens if you lose, although you'll need to set the battle script itself to "true" so it continues and heals your party even if you lost. Then it's just a normal event from there.
     
    172
    Posts
    7
    Years
    • Seen Sep 6, 2022
    i put 42 as variable to store result and put continue true, but where should i put the conditional branch?
    the battle is a conditional branch. when you go to type out your script that contains the battle line it should be done on a conditional branch. that same line you just put var 42 and continue to true.
     
    Back
    Top