Partner, I try to use this code
overworld = ["trchar000","trchar001","trchar002","trchar003"]
battle = ["trainer000","trainer001","trainer002","trainer003"]
result = pbCharacterSelection(overworld,battle)
if result==0
pbRegisterPartner(PBTrainers::HOOPYTRAINER,"Zaphod",0)
elsif result==1
pbRegisterPartner(PBTrainers::OTHERTRAINER,"Purple",0)
elsif result==2
pbRegisterPartner(PBTrainers::ANOTHERTRAINER,"Gray",0)
elsif result==3
pbRegisterPartner(PBTrainers::ONEMORETRAINER,"Brown",0)
end
, and I get this error.
[2022-10-18 23:25:40 +0200]
[Pokémon Essentials version 20.1]
Script error in event 2 (coords 0,14), map 1 (Intro)
Exception: NameError
Message: uninitialized constant Interpreter::PBTrainers
***Full script:
overworld = ["trainer_POKEMONTRAINER_Red", "trainerPAU_2", "trainer_POKEMONTRAINER_Brendan",
"trainer_POKEMONTRAINER_May"]
battle = ["POKEMONTRAINER_Red", "trainerPAU_1", "POKEMONTRAINER_Brendan", "POKEMONTRAINER_May"]
result = startCharacterSelection(overworld,battle)
pbChangePlayer(result+1)
insertSomeMethodNameHere = result
if insertSomeMethodNameHere==0
pbRegisterPartner(PBTrainers::HOOPYTRAINER,"Zaphod",0)
elsif insertSomeMethodNameHere==1
pbRegisterPartner(PBTrainers::OTHERTRAINER,"Purple",0)
elsif insertSomeMethodNameHere==2
pbRegisterPartner(PBTrainers::ANOTHERTRAINER,"Gray",0)
elsif insertSomeMethodNameHere==3
pbRegisterPartner(PBTrainers::ONEMORETRAINER,"Brown",0)
end
Backtrace:
(eval):10: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:160:in `block in update'
032:Scene_Map:159:in `loop'
It is clear that the PBTrainer constant fails, but I don't know which one I should use to define the character of my partner.