- 13
- Posts
- 5
- Years
- The Netherlands
- Seen Oct 11, 2023
So it turns out that there's a problem in v18 with how the evolution data is stored and retrieved, where the retrieval expects pre-evolution data that isn't stored for fully evolved Pokémon. See the bug report thread for more info. This mostly affects breeding, in addition to the handful of us who dynamically adapt levels and evolution stages. Now this doesn't fix the underlying issue and it isn't pretty or efficient; it's simply a quick fix. If you want the species in a bred egg to be computed correctly, simply replace the definition of pbGetEvolutionData in Pokemon_Evolution with the following:
def pbGetEvolutionData(species)
species = getID(PBSpecies,species)
evosData = pbLoadEvolutionsData
if evosData[species] == nil #there is no evolution data present
preEvo=-1
for evoData in evosData: #cycle over all Pokémon to see if one is a pre-evolution to this one
preEvo=preEvo+1
if evoData:
for evo in evoData:
evolution = [preEvo,evo[1],evo[2],true] #reconstruct what the evolution data for a fully evolved Pokémon should have been
return [evolution] if evo[0] == species && !evo[3] #return it if it is indeed this Pokémon's pre-evolution.
end
end
end
else
return evosData[species] #there is evolution data present.
end
return [] #the Pokémon has no evolutionary relatives
end
def pbGetEvolutionData(species)
species = getID(PBSpecies,species)
evosData = pbLoadEvolutionsData
if evosData[species] == nil #there is no evolution data present
preEvo=-1
for evoData in evosData: #cycle over all Pokémon to see if one is a pre-evolution to this one
preEvo=preEvo+1
if evoData:
for evo in evoData:
evolution = [preEvo,evo[1],evo[2],true] #reconstruct what the evolution data for a fully evolved Pokémon should have been
return [evolution] if evo[0] == species && !evo[3] #return it if it is indeed this Pokémon's pre-evolution.
end
end
end
else
return evosData[species] #there is evolution data present.
end
return [] #the Pokémon has no evolutionary relatives
end