- 28
- Posts
- 9
- Years
- Seen May 11, 2024
Hi Everyone,
So I have been trying desperately to figure out how to add Defog back in as a HM to my game. I plan to use it alot to keep the player from entering certain caves and areas around my islands too early. So Far I have figured out how to:
1. add it as an HM Item
2. add it to the TM PBS as a HM with the Properly added Pokemon to the list
3. added a Fog graphic to my map using a single line parallel process in an event
4. and my HM programming has gotten this far:
#===============================================================================
# Defog
#===============================================================================
def Kernel.pbDefog
if $DEBUG ||
(HIDDENMOVESCOUNTBADGES ? $Trainer.numbadges>=BADGEFORDEFOG : $Trainer.badges[BADGEFORDEFOG])
movefinder=Kernel.pbCheckMove(:DEFOG)
if $DEBUG || movefinder
Kernel.pbMessage(_INTL("This entire area is covered in a terrible and ominous Fog\1"))
if Kernel.pbConfirmMessage(_INTL("Would you like to use Defog to clear it?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
Kernel.pbMessage(_INTL("{1} used Defog!",speciesname))
pbHiddenMoveAnimation(movefinder)
return true
end
else
Kernel.pbMessage(_INTL("This entire area is covered in a terrible and ominous Fog"))
end
else
Kernel.pbMessage(_INTL("This entire area is covered in a terrible and ominous Fog"))
end
return false
end
HiddenMoveHandlers::CanUseMove.add(:DEFOG,proc{|move,pkmn|
if !$DEBUG &&
!(HIDDENMOVESCOUNTBADGES ? $Trainer.numbadges>=BADGEFORDEFOG : $Trainer.badges[BADGEFORDEFOG])
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
facingEvent=$game_player.pbFacingEvent
if !facingEvent || facingEvent.name!="Fog"
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
})
HiddenMoveHandlers::UseMove.add(:DEFOG,proc{|move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
return true
})
I'm guessing my programming is not perfect and im just not sure how to create an event on my map that would clear the fog? Could someone please help? I know that the Wiki says to do it like Flash but, that doesn't really help since adding fog doesn't change the metadata, and im trying to clear it all away not just a small moving circle. Any help in this area would be greatly appreciated.
So I have been trying desperately to figure out how to add Defog back in as a HM to my game. I plan to use it alot to keep the player from entering certain caves and areas around my islands too early. So Far I have figured out how to:
1. add it as an HM Item
2. add it to the TM PBS as a HM with the Properly added Pokemon to the list
3. added a Fog graphic to my map using a single line parallel process in an event
4. and my HM programming has gotten this far:
Spoiler:
#===============================================================================
# Defog
#===============================================================================
def Kernel.pbDefog
if $DEBUG ||
(HIDDENMOVESCOUNTBADGES ? $Trainer.numbadges>=BADGEFORDEFOG : $Trainer.badges[BADGEFORDEFOG])
movefinder=Kernel.pbCheckMove(:DEFOG)
if $DEBUG || movefinder
Kernel.pbMessage(_INTL("This entire area is covered in a terrible and ominous Fog\1"))
if Kernel.pbConfirmMessage(_INTL("Would you like to use Defog to clear it?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
Kernel.pbMessage(_INTL("{1} used Defog!",speciesname))
pbHiddenMoveAnimation(movefinder)
return true
end
else
Kernel.pbMessage(_INTL("This entire area is covered in a terrible and ominous Fog"))
end
else
Kernel.pbMessage(_INTL("This entire area is covered in a terrible and ominous Fog"))
end
return false
end
HiddenMoveHandlers::CanUseMove.add(:DEFOG,proc{|move,pkmn|
if !$DEBUG &&
!(HIDDENMOVESCOUNTBADGES ? $Trainer.numbadges>=BADGEFORDEFOG : $Trainer.badges[BADGEFORDEFOG])
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
facingEvent=$game_player.pbFacingEvent
if !facingEvent || facingEvent.name!="Fog"
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
})
HiddenMoveHandlers::UseMove.add(:DEFOG,proc{|move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
return true
})
I'm guessing my programming is not perfect and im just not sure how to create an event on my map that would clear the fog? Could someone please help? I know that the Wiki says to do it like Flash but, that doesn't really help since adding fog doesn't change the metadata, and im trying to clear it all away not just a small moving circle. Any help in this area would be greatly appreciated.