Help with using cut...

updawg734

Whats up, dawg?
Member
#1
So I am trying to make it so that all HM's are used without needing a badge requirement. I have figured that part out...but now it allows me to use cut whenever I want, even when I don't have a Pokémon that knows the move. I have tried running the game outside of debug mode and I'm getting the same thing. Here is my script under the "Cut" section of PField_FieldMoves:

def Kernel.pbCut
move = getID(PBMoves,:CUT)
movefinder = Kernel.pbCheckMove(move)
Kernel.pbMessage(_INTL("These weeds are blocking the path.\1"))
if Kernel.pbConfirmMessage(_INTL("Would you like to cut them?"))
speciesname = (movefinder) ? movefinder.name : $Trainer.name
Kernel.pbMessage(_INTL("{1} used {2}!",speciesname,PBMoves.getName(move)))
pbHiddenMoveAnimation(movefinder)
return true
end
return false
end

HiddenMoveHandlers::CanUseMove.add(:CUT,proc{|move,pkmn,showmsg|
return false if !pbCheckHiddenMoveBadge(BADGEFORCUT,showmsg)
facingEvent = $game_player.pbFacingEvent
if !facingEvent || facingEvent.name!="Tree"
Kernel.pbMessage(_INTL("Can't use that here.")) if showmsg
return false
end
return true
})

HiddenMoveHandlers::UseMove.add(:CUT,proc{|move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
facingEvent = $game_player.pbFacingEvent
if facingEvent
pbSmashEvent(facingEvent)
end
return true
})

def pbSmashEvent(event)
return if !event
if event.name=="Tree"; pbSEPlay("Cut",80)
elsif event.name=="Rock"; pbSEPlay("Rock Smash",80)
end
pbMoveRoute(event,[
PBMoveRoute::Wait,2,
PBMoveRoute::TurnLeft,
PBMoveRoute::Wait,2,
PBMoveRoute::TurnRight,
PBMoveRoute::Wait,2,
PBMoveRoute::TurnUp,
PBMoveRoute::Wait,2
])
pbWait(2*2*4)
event.erase
$PokemonMap.addErasedEvent(event.id) if $PokemonMap
end

I am stumped. Anyone know what I did wrong?
 

leilou

A wild Minun appeared!
Member
Posts
205
#2
The right Subforum to ask for such help would be under Pokémon Essentials

Regarding the question:
you deleted this entire bit that handels what happens if you cannot use cut:

Code:
if !pbCheckHiddenMoveBadge(BADGEFORCUT,false) || (!$DEBUG && !movefinder)
    Kernel.pbMessage(_INTL("This tree looks like it can be cut down."))
    return false
  end
you only wanted to delete the badge check so it would look like so:

Code:
if (!$DEBUG && !movefinder)
    Kernel.pbMessage(_INTL("This tree looks like it can be cut down."))
    return false
  end
 

updawg734

Whats up, dawg?
Member
#3
The right Subforum to ask for such help would be under Pokémon Essentials

Regarding the question:
you deleted this entire bit that handels what happens if you cannot use cut:

Code:
if !pbCheckHiddenMoveBadge(BADGEFORCUT,false) || (!$DEBUG && !movefinder)
    Kernel.pbMessage(_INTL("This tree looks like it can be cut down."))
    return false
  end
you only wanted to delete the badge check so it would look like so:

Code:
if (!$DEBUG && !movefinder)
    Kernel.pbMessage(_INTL("This tree looks like it can be cut down."))
    return false
  end
Thank you so much!! That fixed my issue, definitely my own error. I apologize for posting in the wrong subforum. I'll keep that info in mind when posting in the future. Thanks again!
 
Top