• 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?".
  • Forum moderator applications are now open! Click here for details.
  • 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] Pokémon event battle

7
Posts
5
Years
  • Age 29
  • Seen Dec 12, 2018
Hello guys.
I'm trying to make an event in which I battle a pokémon and the olny way to continue is catching it and, after caught, it increases a variable. If I lose/win or it escapes, I have to fight it again.

I saw at pokémon essentials this text:
pbWildBattle(PBSpecies::species,level,result,escape,canlose)
"result" is a Global Variable number in which the outcome of the battle will be recorded (1=won, 2=lost, 3=run, 4=caught, 5=draw). "escape" is whether the player can flee from the battle (TRUE if not defined). "canlose" is whether the game continues even if the player loses the battle (with the player's party fully healed) (FALSE if not defined). These last three parameters are optional.

The event consists of two pages:

Page 1 - Contains a call to pbWildBattle.
Page 2 - Blank, and depends on the event's Self Switch A being ON.
In most cases, the encounter can only be done once, which means that after the battle, regardless of the outcome, the event should go to page 2. Simply set the event's Self Switch A to ON immediately after the battle.

If the event Pokémon will only disappear because of certain battle outcomes (e.g. because of a win, capture or flee, but not because of a loss), then you will need to save the battle's result to a variable as described above. After the call to pbWildBattle, instead of simply setting the event's Self Switch, you should create one or more Conditional Branches which check the saved outcome value, and do things accordingly.


I didn't manage how to use it (more specifically, how this save battle outcome works). Can anybody help me?
 

Poq

144
Posts
6
Years
  • Age 34
  • Seen Aug 28, 2021
The battle outcome is stored in a variable, so you can add a conditional branch to your event right after the battle to check that variable. If the variable==4 (caught) the event should increase your variable by 1. You can add the self switch A to that conditional branch as well.
 
7
Posts
5
Years
  • Age 29
  • Seen Dec 12, 2018
The battle outcome is stored in a variable, so you can add a conditional branch to your event right after the battle to check that variable. If the variable==4 (caught) the event should increase your variable by 1. You can add the self switch A to that conditional branch as well.

Thanks! It helped me a lot.
 
  • Like
Reactions: Poq
Back
Top