Seen 1 Week Ago
Posted 1 Week Ago
1 posts
15 Days
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.

Vendily

Seen 16 Hours Ago
Posted 1 Week Ago
1,607 posts
7.8 Years
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.
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