• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • 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