- 151
- Posts
- 6
- Years
- Seen Feb 4, 2020
Hello everyone it's me again!
I made this code copying the existing one so I can have a wild encounter adapting to my pokes level but with higher lvl (used for bosses). Then I wanted to add that if the encounter is a SCIZOR then it should learn some moves (because depending on the level it will be defied I'm afraid it has only bad moves).
Events.onWildPokemonCreate+=proc {|sender,e|
pokemon=e[0]
if $game_switches[89]
newlevel=pbBalancedLevel($Trainer.party) + 2 + rand(5)
newlevel=1 if newlevel<1
newlevel=PBExperience::MAXLEVEL if newlevel>PBExperience::MAXLEVEL
pokemon.level=newlevel
pokemon.calcStats
pokemon.resetMoves
end
if pokemon.species=[212]
pokemon.pbLearnMove(:VOLTTACKLE)
pokemon.pbLearnMove(:THUNDER)
pokemon.pbLearnMove(:FLAMETHROWER)
pokemon.pbLearnMove(:TACKLE)
end
}
This is the error I get:
---------------------------
Pokemon Essentials
---------------------------
[Pokémon Essentials version 17]
Exception: RuntimeError
Message: Script error within event 27 (coords 30,4), map 127 (Forêt):
Exception: TypeError
Message: MiscData:165:in `-'cannot convert Fixnum into Array
***Full script:
pbWildBattle(:SCIZOR,5,1,false,true)
Interpreter:243:in `pbExecuteScript'
MiscData:165:in `pbDexDataOffset'
PokeBattle_Pokemon:144:in `growthrate'
PokeBattle_Pokemon:123:in `level'
PokeBattle_Battler:209:in `__shadow_pbInitPokemon'
Pokemon_ShadowPokemon:525:in `pbInitPokemon'
PokeBattle_Battler:510:in `pbInitialize'
PokeBattle_Battle:2364:in `pbStartBattleCore'
PokeBattle_Battle:2340:in `pbStartBattle'
PField_Battles:98:in `pbWildBattle'
Interpreter:276:in `pbExecuteScript'
Interpreter:794:in `command_111'
Interpreter:320:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:161:in `follow_update'
Scene_Map:159:in `loop'
Scene_Map:168:in `follow_update'
Follow:1551:in `update'
I don't understand which fix number is trying to be converted into array. Thanks in advance
I made this code copying the existing one so I can have a wild encounter adapting to my pokes level but with higher lvl (used for bosses). Then I wanted to add that if the encounter is a SCIZOR then it should learn some moves (because depending on the level it will be defied I'm afraid it has only bad moves).
Events.onWildPokemonCreate+=proc {|sender,e|
pokemon=e[0]
if $game_switches[89]
newlevel=pbBalancedLevel($Trainer.party) + 2 + rand(5)
newlevel=1 if newlevel<1
newlevel=PBExperience::MAXLEVEL if newlevel>PBExperience::MAXLEVEL
pokemon.level=newlevel
pokemon.calcStats
pokemon.resetMoves
end
if pokemon.species=[212]
pokemon.pbLearnMove(:VOLTTACKLE)
pokemon.pbLearnMove(:THUNDER)
pokemon.pbLearnMove(:FLAMETHROWER)
pokemon.pbLearnMove(:TACKLE)
end
}
This is the error I get:
---------------------------
Pokemon Essentials
---------------------------
[Pokémon Essentials version 17]
Exception: RuntimeError
Message: Script error within event 27 (coords 30,4), map 127 (Forêt):
Exception: TypeError
Message: MiscData:165:in `-'cannot convert Fixnum into Array
***Full script:
pbWildBattle(:SCIZOR,5,1,false,true)
Interpreter:243:in `pbExecuteScript'
MiscData:165:in `pbDexDataOffset'
PokeBattle_Pokemon:144:in `growthrate'
PokeBattle_Pokemon:123:in `level'
PokeBattle_Battler:209:in `__shadow_pbInitPokemon'
Pokemon_ShadowPokemon:525:in `pbInitPokemon'
PokeBattle_Battler:510:in `pbInitialize'
PokeBattle_Battle:2364:in `pbStartBattleCore'
PokeBattle_Battle:2340:in `pbStartBattle'
PField_Battles:98:in `pbWildBattle'
Interpreter:276:in `pbExecuteScript'
Interpreter:794:in `command_111'
Interpreter:320:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:161:in `follow_update'
Scene_Map:159:in `loop'
Scene_Map:168:in `follow_update'
Follow:1551:in `update'
I don't understand which fix number is trying to be converted into array. Thanks in advance