I am trying to convert HM Flash to an item, but when I use them I have this error:
I revised all, I have this code in PField_HiddenMoves:
And I have that at the bottom of PItem_ItemEffects:
And in PBS:
I follow the -FL- tutorial on the wiki to make that, but I can't find the error. I don't understood 100% the tutorial, maybe it's a bit difficult for me, but I think that I have all in order.
Code:
Excepción: NameError
Mensaje: uninitialized constant UseMoveFlash
PItem_ItemEffects:1755
PItem_ItemEffects:1754:in `call'
Event:150:in `trigger'
PItem_Items:219:in `triggerUseInField'
PItem_Items:499:in `pbUseKeyItemInField'
PScreen_PauseMenu:198:in `pbStartPokemonMenu'
PScreen_PauseMenu:143:in `loop'
PScreen_PauseMenu:269:in `pbStartPokemonMenu'
Scene_Map:193:in `call_menu'
Scene_Map:163:in `update'
I revised all, I have this code in PField_HiddenMoves:
Code:
#===============================================================================
# Destello / Flash
#===============================================================================
HiddenMoveHandlers::CanUseMove.add(:FLASH,proc{|move,pkmn|
if !$DEBUG &&
!(HIDDENMOVESCOUNTBADGES ? $Trainer.numbadges>=BADGEFORFLASH : $Trainer.badges[BADGEFORFLASH])
Kernel.pbMessage(_INTL("Necesitas una nueva medalla."))
return false
end
if !pbGetMetadata($game_map.map_id,MetadataDarkMap)
Kernel.pbMessage(_INTL("No puedes usar eso aquí."))
return false
end
if $PokemonGlobal.flashUsed
Kernel.pbMessage(_INTL("Ya se está utilizando."))
return false
end
return true
})
HiddenMoveHandlers::UseMove.add(:FLASH,proc{|move,pokemon|
darkness=$PokemonTemp.darknessSprite
return false if !darkness || darkness.disposed?
if !pbHiddenMoveAnimation(nil)
Kernel.pbMessage(_INTL("¡{1} usó {2}!",pokemon.name,PBMoves.getName(move)))
end
$PokemonGlobal.flashUsed=true
while darkness.radius<176
Graphics.update
Input.update
pbUpdateSceneMap
darkness.radius+=4
end
return true
})
def CanUseMoveFlash?
if !$DEBUG &&
!(HIDDENMOVESCOUNTBADGES ? $Trainer.numbadges>=BADGEFORFLASH : $Trainer.badges[BADGEFORFLASH])
Kernel.pbMessage(_INTL("Necesitas una nueva medalla."))
return false
end
if !pbGetMetadata($game_map.map_id,MetadataDarkMap)
Kernel.pbMessage(_INTL("No puedes usar eso aquí."))
return false
end
if $PokemonGlobal.flashUsed
Kernel.pbMessage(_INTL("Ya se está utilizando."))
return false
end
return true
end
def UseMoveFlash
darkness=$PokemonTemp.darknessSprite
return false if !darkness || darkness.disposed?
if !pbHiddenMoveAnimation(nil)
Kernel.pbMessage(_INTL("¡{1} usó el Casco Minero!"))#,$Trainer.name))
end
$PokemonGlobal.flashUsed=true
while darkness.radius<176
Graphics.update
Input.update
pbUpdateSceneMap
darkness.radius+=4
end
return true
end
And I have that at the bottom of PItem_ItemEffects:
Code:
ItemHandlers::UseFromBag.add(:MININGHELMET,proc{|item|
next CanUseMoveFlash? ? 2 : 0
})
ItemHandlers::UseInField.add(:MININGHELMET,proc{|item|
UseMoveFlash if CanUseMoveFlash?
})
And in PBS:
Code:
676,MININGHELMET,Casco Minero, Cascos Mineros,8,0,"Un casco que puede iluminar cuevas muy oscuras.",2,0,6,
I follow the -FL- tutorial on the wiki to make that, but I can't find the error. I don't understood 100% the tutorial, maybe it's a bit difficult for me, but I think that I have all in order.