• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] How do I give fly to teleport as well?

Fly takes you to a selected location (usually in front of a Pokemon Center) in the Town of your choice, Teleport takes you to the last Pokemon Center you used.
Since they both take you to a Pokemon Center I am not sure what you are asking, can you provide more details?
 
In
Code:
PScreen_Party
around line 1196 you should find where the game is checking to make sure your Pokemon knows the move Fly.
Code:
if isConst?(pkmn.moves[i].id,PBMoves,:FLY)

Change it to check for Fly and Teleport.
Code:
if isConst?(pkmn.moves[i].id,PBMoves,:FLY) || isConst?(pkmn.moves[i].id,PBMoves,:TELEPORT)


Next in
Code:
PField_FieldMoves
around line 914 you should see how Teleport is handled when the player tries to use it.
Replace it with this:
Code:
#===============================================================================
# Teleport
#===============================================================================
HiddenMoveHandlers::CanUseMove.add(:TELEPORT,proc { |move,pkmn,showmsg|
  next false if !pbCheckHiddenMoveBadge(BADGE_FOR_FLY,showmsg) #Delete this line if a badge is not required.
  if $game_player.pbHasDependentEvents?
    pbMessage(_INTL("It can't be used when you have someone with you.")) if showmsg
    next false
  end
    if !pbGetMetadata($game_map.map_id,MetadataOutdoor) #
    pbMessage(_INTL("Can't use that here.")) if showmsg #Delete these lines if you want to use Teleport while indoors and in caves.
    next false                                          #
  end                                                   #
  next true
})

HiddenMoveHandlers::UseMove.add(:TELEPORT,proc { |move,pokemon|
  if !$PokemonTemp.flydata
    pbMessage(_INTL("Can't use that here."))
    next false
  end
  if !pbHiddenMoveAnimation(pokemon)
    pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
  end
  pbFadeOutIn {
    $game_temp.player_new_map_id    = $PokemonTemp.flydata[0]
    $game_temp.player_new_x         = $PokemonTemp.flydata[1]
    $game_temp.player_new_y         = $PokemonTemp.flydata[2]
    $game_temp.player_new_direction = 2
    $PokemonTemp.flydata = nil
    $scene.transfer_player
    $game_map.autoplay
    $game_map.refresh
  }
  pbEraseEscapePoint
  next true
})

This will make Teleport act like fly!
 
Last edited:
In
Code:
PScreen_Party
around line 1196 you should find where the game is checking to make sure your Pokemon knows the move Fly.
Code:
if isConst?(pkmn.moves[i].id,PBMoves,:FLY)

Change it to check for Fly and Teleport.
Code:
if isConst?(pkmn.moves[i].id,PBMoves,:FLY) || isConst?(pkmn.moves[i].id,PBMoves,:TELEPORT)


Next in
Code:
PField_FieldMoves
around line 914 you should see how Teleport is handled when the player tries to use it.
Replace it with this:
Code:
#===============================================================================
# Teleport
#===============================================================================
HiddenMoveHandlers::CanUseMove.add(:TELEPORT,proc { |move,pkmn,showmsg|
  next false if !pbCheckHiddenMoveBadge(BADGE_FOR_FLY,showmsg) #Delete this line if a badge is not required.
  if $game_player.pbHasDependentEvents?
    pbMessage(_INTL("It can't be used when you have someone with you.")) if showmsg
    next false
  end
    if !pbGetMetadata($game_map.map_id,MetadataOutdoor) #
    pbMessage(_INTL("Can't use that here.")) if showmsg #Delete these lines if you want to use Teleport while indoors and in caves.
    next false                                          #
  end                                                   #
  next true
})

HiddenMoveHandlers::UseMove.add(:TELEPORT,proc { |move,pokemon|
  if !$PokemonTemp.flydata
    pbMessage(_INTL("Can't use that here."))
    next false
  end
  if !pbHiddenMoveAnimation(pokemon)
    pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
  end
  pbFadeOutIn {
    $game_temp.player_new_map_id    = $PokemonTemp.flydata[0]
    $game_temp.player_new_x         = $PokemonTemp.flydata[1]
    $game_temp.player_new_y         = $PokemonTemp.flydata[2]
    $game_temp.player_new_direction = 2
    $PokemonTemp.flydata = nil
    $scene.transfer_player
    $game_map.autoplay
    $game_map.refresh
  }
  pbEraseEscapePoint
  next true
})

This will make Teleport act like fly!



Thank you very much, I really wanted to have your knowledge, you are amazing !!!! THANKS !
 
Back
Top