v20 canLose and outcome scripts crashing the battle

This thread pertains to v20 of Pokémon Essentials.

Noctael

Rookie
Member
Joined
Jun 21, 2022
Posts
2
Hello, I am new to Pokemon Essentials. As in, I got it last Friday I think?
I started thinking about converting a GBA project and have been mostly playing around with scripts I know I'll need before I do the big scary stuff like mapping.

I've been trying to test this script for the sake of a rival battle, where the player is expected to lose but I don't want to make it scripted so they have to lose. I want there to be dialogue acknowledging if they win or lose so I checked the docs and it referred me to the setBattleRules commands. However, programming this script in the test scene has been giving me grief.

It always crashes after the dialogue and before the battle starts.

I know it's not the pbs files now as I fixed a stupid error where I forgot to capitalise 'Skitty' in the trainers.txt file.

The event is scripted as such (barring the snip, that's because the dialogue ain't the issue):
@>Script: pbTrainerIntro (:LASS)

@>Script: pbNoticePlayer(get_self)

@>Text: \r (snip)

@>Text: \r (snip)

@>Script: setBattleRules(“canLose”)

@>Script: setBattleRules(“outcome”,26)

@>Conditional Branch: Script: TrainerBattle.start(:ROSA, “Rosa”)

@>Control Self Switch: A =ON

@>

:Branch End

@>Script: pbTrainerEnd

@>Conditional Branch: Variable [0026: Outcome] == 1

@>Text: \r (snip)

:Else

@>Conditional Branch: Variable [0026: Outcome] == 2

@>Text: \r (snip)

@>Text: \r (snip)

@>

:Branch End

@>

:Branch End


The error message reads:
[Pokémon Essentials version 20]
[v20 Hotfixes 1.0.5]

Script error in event 9 (coords 12,11), map 47 (Route 7)
Exception: NoMethodError
Message: undefined method `setBattleRules' for #<Interpreter @event_id: 9>

***Full script:
setBattleRules("canLose")
setBattleRules("outcome",26)

Backtrace:
(eval):1:in `execute_script'
033:Interpreter:143:in `eval'
033:Interpreter:143:in `execute_script'
034:Interpreter_Commands:1112:in `command_355'
034:Interpreter_Commands:116:in `execute_command'
033:Interpreter:133:in `block in update'
033:Interpreter:90:in `loop'
033:Interpreter:90:in `update'
032:Scene_Map:163:in `block in update'
032:Scene_Map:162:in `loop'
 
Top