Hey, I do not know if the creator of this plugin is still here after the nuke of relic castle but I'll try my luck.
I am totally lost right now. I made some modification in the plugin few days ago, and those modifications were working fine.
I just added forms in the considerations of the plugin (the plugin was only based on species, I made it based on species + form).Sadly, I see now that it is not working anymore. When i try to trigger the UI in fight it opens well. But when I click on right, I encounter this error:
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]
Exception: NoMethodError
Message: undefined method id' for nil:NilClass
Backtrace:
[Type Match-up UI] 002_SpeciesTypeMatch_UI.rb:112:in block in drawSpeciesTypes'
[Type Match-up UI] 002SpeciesTypeMatch_UI.rb:111:in times'
[Type Match-up UI] 002_SpeciesTypeMatch_UI.rb:111:in drawSpeciesTypes'
[Type Match-up UI] 002_SpeciesTypeMatch_UI.rb:101:in block in pbTypeMatchUp'
[Type Match-up UI] 002_SpeciesTypeMatch_UI.rb:73:in loop'
[Type Match-up UI] 002_SpeciesTypeMatch_UI.rb:73:in pbTypeMatchUp'
[Type Match-up UI] 002_SpeciesTypeMatch_UI.rb:233:in pbStartScreen'
[Type Match-up UI] 002_SpeciesTypeMatch_UI.rb:281:in block in pbSpeciesTypeMatchUI'
MessageConfig:594:in pbFadeOutIn'
[Type Match-up UI] 002_SpeciesTypeMatch_UI.rb:264:in `pbSpeciesTypeMatchUI'
Apparently it says that method id doesn't exist, which is weird cause it should. Line 112 is this one for me :
2.times do |i|
@sprites["icon#{i}"].pbSetParams(s.id,0,s.form,false)
end
s was created like that: s = GameData::Species.get_species_form(species, form). Note that previously, s was created this way: s = GameData::Species.get(species)
What I don't get is that s should have the method id, since it is created as a class Species in GameData.
Here are all the changes I made so any helper can reproduice the error (I guess):
In
002_SpeciesTypeMatch_UI
1) In
def pbTypeMatchUp
- replaced drawSpeciesTypes(species) with drawSpeciesTypes(species, form)
- added newForm = @form[@index] after newSpecies = @species[@index] (twice)
- replaced drawSpeciesTypes(newSpecies) if refresh with drawSpeciesTypes(newSpecies, newForm) if refresh
2) In
def drawSpeciesTypes
- replaced def drawSpeciesTypes(species) with def drawSpeciesTypes(species, form = 0)
- replaced s = GameData::Species.get(species) with s = GameData::Species.get_species_form(species, form)
3) In
def pbSpeciesTypeMatchUI
- I defined
pbSpeciesTypeMatchUI as following:
def pbSpeciesTypeMatchUI(custom_species = nil, custom_form = 0)
pbFadeOutIn {
if custom_form == 0
scene = SpeciesTypeMatch_Scene.new
screen = SpeciesTypeMatch_Screen.new(scene)
# Use the custom_species array if it is provided
scene.instance_variable_set(:@species, custom_species)
screen.pbStartScreen
else
scene = SpeciesTypeMatch_Scene.new
screen = SpeciesTypeMatch_Screen.new(scene)
# Use the custom_species array if it is provided
scene.instance_variable_set(:@species, custom_species)
scene.instance_variable_set(:@form, custom_form)
screen.pbStartScreen
end
}
end
4) In Essentials Scripts, in 187-Battle_Scene, in
def pbFrameUpdate, I added :
if Input.triggerex?(:T)
custom_species = @battle.battlers.map { |battler| battler.species }.uniq
custom_form = @battle.battlers.map { |battler| battler.form }.uniq
pbSpeciesTypeMatchUI(custom_species, custom_form)
end