- 132
- Posts
- 10
- Years
- New Brunswick
- Seen May 6, 2023
I know I made this same request a while back, but since updating to Essentials 17.2, I've lost compatibility with some custom scripts. This script, made by tustin2121, is used to store off the opposing trainer's pokemon so that the player can then take them. Here is the main part of the script that is especially giving me trouble:
I think something's up with the scene=PokemonScreen_Scene.new and screen=PokemonScreen.new. Maybe it's a compatibility issue, or maybe something else. Here's the error log:
![[PokeCommunity.com] Storing opposing trainer's pkmn (17.2) [PokeCommunity.com] Storing opposing trainer's pkmn (17.2)](https://s33.postimg.cc/hnf9dlxx7/Screen_Shot_2018-06-27_at_12.15.02_AM.png)
Thanks!
Code:
def pbSavePokemon
if $PokemonTemp.lastTrainerPokemon && !pbBoxesFull?
pbFadeOutIn(99999){
#Open a party selection screen, with the opponent's party
scene=PokemonScreen_Scene.new
screen=PokemonScreen.new(scene,$PokemonTemp.lastTrainerPokemon)
screen.pbStartScene(_INTL("Which Pok?mon would you like?"),false)
loop do
scene.pbSetHelpText(_INTL("Which Pok?mon would you like?"))
chosen=screen.pbChoosePokemon
if chosen>=0
pokemon=$PokemonTemp.lastTrainerPokemon[chosen]
if scene.pbDisplayConfirm(_INTL("Take {0}?", pokemon.name))
# Add the foreign pokemon
$Trainer.seen[pokemon.species]=true #Add to Pokedex
$Trainer.owned[pokemon.species]=true
pbStorePokemon(pokemon) #stores pokemon in party or boxes, if there's room
break;
end
else
#The player cancelled the selection
break if scene.pbDisplayConfirm(_INTL("Decide against taking a Pok?mon?"))
end
end
$PokemonTemp.lastTrainerPokemon=nil #clear out the stored party
screen.pbEndScene
}
else
#Either the player can't store any more pokemon, or the last opponent's party wasn't stored off properly.
Kernel.pbMessage(_INTL("Can't select a Pok?mon!"))
end
end
![[PokeCommunity.com] Storing opposing trainer's pkmn (17.2) [PokeCommunity.com] Storing opposing trainer's pkmn (17.2)](https://s33.postimg.cc/hnf9dlxx7/Screen_Shot_2018-06-27_at_12.15.02_AM.png)
Thanks!