• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

Using Fly without owning a Pokémon that knows it

9
Posts
12
Years
    • Seen May 15, 2013
    Hey guys,
    Just looking for a bit of help with RMXP, I need to allow the player to be transported to a place of his/her choosing within an event (like the dungeon choosing in PMD)
    My solution was to open up the fly screen so that players can fly to "dungeons" they've been to before, and there won't be any tacky choice screens. I soon realised this was tricky to do, however, without actually giving the player a Pokémon that knows Fly. As such have resorted to the forums.
    Anyone know how I go about this?
    Many thanks,
    Mike

    P.S. One last quick question: How do I copy across the variable catchRate into my own Script Section?
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    If the only way the player can use Fly is through your event transport system, then you can edit its scripts so that it no longer requires that a player's Pokémon knows Fly in order to use it. That is, delete what you need to from HiddenMoveHandlers::CanUseMove.add(:FLY,proc (probably most of it; just return true like Sweet Scent's does).

    Here is some stripped-down code which you can use to use Fly:
    Code:
    scene=PokemonRegionMapScene.new(-1,false)
    screen=PokemonRegionMap.new(scene)
    ret=screen.pbStartFlyScreen
    if ret
      $PokemonTemp.flydata=ret
      Kernel.pbUseHiddenMove(nil,PBMoves::FLY)
    end
    You'll also want to remove the "Pidgeot used Fly!" message and the hidden move animation for using Fly, because they're not appropriate.

    However, if you want to be able to use Fly normally as well, then you'll need to create a new method containing (mostly) the above code and Fly's effect (minus the message/animation as mentioned). Call this method from your event.


    The catch rate for a species can be loaded with the following code:
    Code:
    dexdata=pbOpenDexData
    pbDexDataOffset(dexdata,species,16)
    catchrate=dexdata.fgetb
    dexdata.close
    You can use this anywhere, so long as you have a species to find the catch rate of.
     
    9
    Posts
    12
    Years
    • Seen May 15, 2013
    If the only way the player can use Fly is through your event transport system, then you can edit its scripts so that it no longer requires that a player's Pokémon knows Fly in order to use it. That is, delete what you need to from HiddenMoveHandlers::CanUseMove.add(:FLY,proc (probably most of it; just return true like Sweet Scent's does).

    Here is some stripped-down code which you can use to use Fly:
    Code:
    scene=PokemonRegionMapScene.new(-1,false)
    screen=PokemonRegionMap.new(scene)
    ret=screen.pbStartFlyScreen
    if ret
      $PokemonTemp.flydata=ret
      Kernel.pbUseHiddenMove(nil,PBMoves::FLY)
    end
    You'll also want to remove the "Pidgeot used Fly!" message and the hidden move animation for using Fly, because they're not appropriate.

    However, if you want to be able to use Fly normally as well, then you'll need to create a new method containing (mostly) the above code and Fly's effect (minus the message/animation as mentioned). Call this method from your event.

    I don't want to be able to Fly normally too, but what method do I call in the event?

    The catch rate for a species can be loaded with the following code:
    Code:
    dexdata=pbOpenDexData
    pbDexDataOffset(dexdata,species,16)
    catchrate=dexdata.fgetb
    dexdata.close
    You can use this anywhere, so long as you have a species to find the catch rate of.

    This worked perfectly, thanks.
    Which bit of this do I change to get base HP?
    Code:
    catchrate=dexdata.fgetb
    Sorry for all the questions...

    Thanks
    Mike
     
    Last edited:

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    You can create a new method with the stripped-down code I gave you, and call that.

    To get the base HP, use the same code as for catch rate but replace the 16 with 10.
     
    9
    Posts
    12
    Years
    • Seen May 15, 2013
    You can create a new method with the stripped-down code I gave you, and call that.

    To get the base HP, use the same code as for catch rate but replace the 16 with 10.

    Thanks for all your help :D
     
    Back
    Top