Error after catching multipleform Pokémon

Marina

Cooltrainer
Member
Joined
Mar 10, 2018
Posts
129
I get this error after catching a wild Pokémon with many forms (a Furfrou) and then after catching it, I get this error:


---------------------------
Essence
---------------------------
[Pokémon Essentials version 17.2]

Exception: TypeError

Message: cannot convert false into Integer

PSystem_Utilities:855:in `[]'

PSystem_Utilities:855:in `pbGetFSpeciesFromForm'

Pokemon_Forms:28:in `fSpecies'

PokeBattle_Pokemon:850:in `baseStats'

PokeBattle_Pokemon:886:in `calcStats'

PokeBattle_Battler:483:in `pbUpdate'

PokeBattle_Battler:947:in `pbResetForm'

PokeBattle_Battle:4024:in `pbEndOfBattle'

PokeBattle_Battle:4023:in `each'

PokeBattle_Battle:4023:in `pbEndOfBattle'



This exception was logged in

C:\Users\Saved Games\Essence\errorlog.txt.

Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------

In PSystem Line 855 =
if formdata[species] && formdata[species][form] && formdata[species][form]>0

I don't know what's wrong and I don't want to mess up with the code so I guess the TypeError should be around Line 852, where pbGetFSpeciesFromForm is being called, though I guess the "F" is wrong... but like I said I don't want to mess up with the code, please help. Help is appreciated! Thanks in advance!
 
Last edited:

Marina

Cooltrainer
Member
Joined
Mar 10, 2018
Posts
129
This is the script of which you talk on the other forum:

#===============================================================================
# fSpecies utilities
#===============================================================================
def pbGetFSpeciesFromForm(species,form=0)
return species if form==0
formdata = pbLoadFormsData
if formdata[species] && formdata[species][form] && formdata[species][form]>0
return formdata[species][form]
end
return species
end

def pbGetSpeciesFromFSpecies(species)
return [species,0] if species<=PBSpecies.maxValue
formdata = pbLoadFormsData
for i in 1...formdata.length
next if !formdata
for j in 0...formdata.length
return [i,j] if formdata[j]==species
end
end
return [species,0]
end
 

MGriffin

Trainer
Member
Joined
May 8, 2017
Posts
95
Yeah, I guess so.

My suggestion there was to investigate and work out why form is false, not 0. But depending on how lazy you're feeling you could try making this change (no idea if it will have other side-effects though—that's the danger of making changes without knowing why the bug is happening in the first place):

Code:
def pbGetFSpeciesFromForm(species,form=0)
  return species if form==0 || form==false
  ...
 
Top