- Joined
- Sep 24, 2022
- Posts
- 270
Hello, I have a small issue after a save that seems to be related to the quest manager combined with the menu.
Do you have a suitable solution?
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]
Exception: NoMethodError
Message: undefined method `y' for nil:NilClass
Backtrace:
[Voltseon's Pause Menu] 004_VoltseonMenu_Components.rb:232:in `update'
[Voltseon's Pause Menu] 002_VoltseonMenu_Main.rb:223:in `block (2 levels) in update'
[Voltseon's Pause Menu] 002_VoltseonMenu_Main.rb:223:in `each'
[Voltseon's Pause Menu] 002_VoltseonMenu_Main.rb:223:in `block in update'
[Voltseon's Pause Menu] 002_VoltseonMenu_Main.rb:219:in `loop'
[Voltseon's Pause Menu] 002_VoltseonMenu_Main.rb:219:in `update'
[Voltseon's Pause Menu] 002_VoltseonMenu_Main.rb:297:in `pbStartPokemonMenu'
[Voltseon's Pause Menu] 002_VoltseonMenu_Main.rb:288:in `call_menu'
[Following Pokemon EX] Refresh.rb:122:in `call_menu'
032:Scene_Map:203:in `update'
If you have encountered the same error as me while saving, here is the fix to avoid this issue
[004_VoltseonMenu_Components]
#-------------------------------------------------------------------------------
# New Quesst Message Hud component
#-------------------------------------------------------------------------------
class VPM_NewQuestHud < Component
def initialize
@counter = 0
end
def start_component(viewport, menu)
super(viewport, menu)
@sprites["overlay"] = BitmapSprite.new(Graphics.width / 2, 32, viewport)
@sprites["overlay"].ox = @sprites["overlay"].bitmap.width
@sprites["overlay"].x = Graphics.width
@sprites["overlay"].y = 96
@sprites["overlay"].oy = 32
@base_color = $PokemonSystem.from_current_menu_theme(MENU_TEXTCOLOR, Color.new(248, 248, 248))
@shdw_color = $PokemonSystem.from_current_menu_theme(MENU_TEXTOUTLINE, Color.new(48, 48, 48))
end
def should_draw?
return false if !defined?(hasAnyQuests?)
return false if !$PokemonGlobal
return false if !$PokemonGlobal.respond_to?(:quests)
return $PokemonGlobal.quests.active_quests.any? { |quest| quest.respond_to?(:new) && quest.new }
end
def update
super
return unless @sprites["overlay"]
@counter += 1
if @counter > Graphics.frame_rate / 2
@sprites["overlay"].y += 1 if @counter % (Graphics.frame_rate / 8) == 0
else
@sprites["overlay"].y -= 1 if @counter % (Graphics.frame_rate / 8) == 0
end
@counter = 0 if @counter >= Graphics.frame_rate
end
def refresh
quest_count = $PokemonGlobal.quests.active_quests.count { |quest| quest.respond_to?(:new) && quest.new }
@sprites["overlay"].bitmap.clear
if quest_count > 0
if quest_count == 1
text = _INTL("You have {1} new quest!",quest_count)
else
text = _INTL("You have {1} new quests!",quest_count)
end
pbSetSmallFont(@sprites["overlay"].bitmap)
pbDrawTextPositions(@sprites["overlay"].bitmap, [[text, (Graphics.width / 2) - 8, 12, 1, @base_color, @shdw_color]])
end
end
end
# New Quesst Message Hud component
#-------------------------------------------------------------------------------
class VPM_NewQuestHud < Component
def initialize
@counter = 0
end
def start_component(viewport, menu)
super(viewport, menu)
@sprites["overlay"] = BitmapSprite.new(Graphics.width / 2, 32, viewport)
@sprites["overlay"].ox = @sprites["overlay"].bitmap.width
@sprites["overlay"].x = Graphics.width
@sprites["overlay"].y = 96
@sprites["overlay"].oy = 32
@base_color = $PokemonSystem.from_current_menu_theme(MENU_TEXTCOLOR, Color.new(248, 248, 248))
@shdw_color = $PokemonSystem.from_current_menu_theme(MENU_TEXTOUTLINE, Color.new(48, 48, 48))
end
def should_draw?
return false if !defined?(hasAnyQuests?)
return false if !$PokemonGlobal
return false if !$PokemonGlobal.respond_to?(:quests)
return $PokemonGlobal.quests.active_quests.any? { |quest| quest.respond_to?(:new) && quest.new }
end
def update
super
return unless @sprites["overlay"]
@counter += 1
if @counter > Graphics.frame_rate / 2
@sprites["overlay"].y += 1 if @counter % (Graphics.frame_rate / 8) == 0
else
@sprites["overlay"].y -= 1 if @counter % (Graphics.frame_rate / 8) == 0
end
@counter = 0 if @counter >= Graphics.frame_rate
end
def refresh
quest_count = $PokemonGlobal.quests.active_quests.count { |quest| quest.respond_to?(:new) && quest.new }
@sprites["overlay"].bitmap.clear
if quest_count > 0
if quest_count == 1
text = _INTL("You have {1} new quest!",quest_count)
else
text = _INTL("You have {1} new quests!",quest_count)
end
pbSetSmallFont(@sprites["overlay"].bitmap)
pbDrawTextPositions(@sprites["overlay"].bitmap, [[text, (Graphics.width / 2) - 8, 12, 1, @base_color, @shdw_color]])
end
end
end