• 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.

[Other Question] Fly don’t work

43
Posts
7
Years
    • Seen May 4, 2023
    Hello everyone, when I use "fly" from the party menu the map opens to me, I select the point to fly but then close the screen without making me fly, what can be the problem?
     

    StCooler

    Mayst thou thy peace discover.
    9,301
    Posts
    4
    Years
    • Seen May 5, 2024
    Hello everyone, when I use "fly" from the party menu the map opens to me, I select the point to fly but then close the screen without making me fly, what can be the problem?

    Do you have a correct Region Map ?
    It's probably because the game doesn't know that the city can be selected. If it knew, you wouldn't be the one closing the map, it would close itself on selection and then make you fly. Check "Fly destination" on the link given above.
     
    43
    Posts
    7
    Years
    • Seen May 4, 2023
    Do you have a correct Region Map ?
    It's probably because the game doesn't know that the city can be selected. If it knew, you wouldn't be the one closing the map, it would close itself on selection and then make you fly. Check "Fly destination" on the link given above.

    The pbs file is compiled correctly, the game recognizes the city etc., I really can't understand, if it gave me error it would be better hahah the scripts seem to be going well
     

    StCooler

    Mayst thou thy peace discover.
    9,301
    Posts
    4
    Years
    • Seen May 5, 2024
    The pbs file is compiled correctly, the game recognizes the city etc., I really can't understand, if it gave me error it would be better hahah the scripts seem to be going well
    When you don't know what's happening, it's time to scan the file in functioning :)

    In the script 009_UI_RegionMap (in Essentials v19) or in the script PScreen_Party (in Essentials v18), find this code:
    Code:
    class PokemonRegionMapScreen
      def initialize(scene)
        @scene = scene
      end
    
      def pbStartFlyScreen
        @scene.pbStartScene(false,1)
        ret = @scene.pbMapScene(1)
        @scene.pbEndScene
        pbMessage(_INTL("DEBUG: ret = {1}", ret)) # Add this line here.
        return ret
      end
    
      def pbStartScreen
        @scene.pbStartScene($DEBUG)
        @scene.pbMapScene
        @scene.pbEndScene
      end
    end

    Tell me what the message says when you open the Fly menu.
     
    43
    Posts
    7
    Years
    • Seen May 4, 2023
    When you don't know what's happening, it's time to scan the file in functioning :)

    In the script 009_UI_RegionMap (in Essentials v19) or in the script PScreen_Party (in Essentials v18), find this code:
    Code:
    class PokemonRegionMapScreen
      def initialize(scene)
        @scene = scene
      end
    
      def pbStartFlyScreen
        @scene.pbStartScene(false,1)
        ret = @scene.pbMapScene(1)
        @scene.pbEndScene
        pbMessage(_INTL("DEBUG: ret = {1}", ret)) # Add this line here.
        return ret
      end
    
      def pbStartScreen
        @scene.pbStartScene($DEBUG)
        @scene.pbMapScene
        @scene.pbEndScene
      end
    end

    Tell me what the message says when you open the Fly menu.

    As soon as I can text it, and I'll let you know, Anyway I use 17.2 does it change?
     

    StCooler

    Mayst thou thy peace discover.
    9,301
    Posts
    4
    Years
    • Seen May 5, 2024
    As soon as I can text it, and I'll let you know, Anyway I use 17.2 does it change?

    Hum, I don't know, I don't have v17.2.
    However I believe that the main difference between v17.2 and v18.1 consists in the battle system, so as far as Fly is concerned, they should be similar.
     
    Last edited:
    43
    Posts
    7
    Years
    • Seen May 4, 2023
    Hum, I don't know, I don't have v17.2.
    However I believe that the main difference between v17.2 and v18.1 consists in the battle system, so as far as Fly is concerned, they should be similar.

    I added the line you wrote to me and now when I fly it gives me error and closes the game telling me undefined method "pbMessage" 😆
     
    43
    Posts
    7
    Years
    • Seen May 4, 2023
    Hum, I don't know, I don't have v17.2.
    However I believe that the main difference between v17.2 and v18.1 consists in the battle system, so as far as Fly is concerned, they should be similar.

    Ok, the Kernel was missing, the code that comes out to me is 31417
     

    StCooler

    Mayst thou thy peace discover.
    9,301
    Posts
    4
    Years
    • Seen May 5, 2024
    Ok, the Kernel was missing, the code that comes out to me is 31417

    Ok, so it actually gives the necessary fly data.

    Do you have a function called "pbUseHiddenMove" somewhere in the code? Find its definition. If it's like a three-line definition like this:
    Code:
    def pbUseHiddenMove(pokemon,move)
      return HiddenMoveHandlers.triggerUseMove(move,pokemon)
    end

    find some code that looks like this:

    Code:
    HiddenMoveHandlers::CanUseMove.add(:FLY,proc { |move,pkmn,showmsg|
      # CODE
    }
    Code:
    HiddenMoveHandlers::UseMove.add(:FLY,proc { |move,pokemon|
      # CODE
    }

    In either cases, post here the codes of pbUseHiddenMove and of the two HiddenMoveHandlers please (for Fly only lol).

    NB: you can remove the line "pbMessage" I had you add ^^
     
    43
    Posts
    7
    Years
    • Seen May 4, 2023
    Ok, so it actually gives the necessary fly data.

    Do you have a function called "pbUseHiddenMove" somewhere in the code? Find its definition. If it's like a three-line definition like this:
    Code:
    def pbUseHiddenMove(pokemon,move)
      return HiddenMoveHandlers.triggerUseMove(move,pokemon)
    end

    find some code that looks like this:

    Code:
    HiddenMoveHandlers::CanUseMove.add(:FLY,proc { |move,pkmn,showmsg|
      # CODE
    }
    Code:
    HiddenMoveHandlers::UseMove.add(:FLY,proc { |move,pokemon|
      # CODE
    }

    In either cases, post here the codes of pbUseHiddenMove and of the two HiddenMoveHandlers please (for Fly only lol).

    NB: you can remove the line "pbMessage" I had you add ^^

    I have this code in PField_FiledMoves:
    Code:
    def Kernel.pbUseHiddenMove(pokemon,move)
      return HiddenMoveHandlers.triggerUseMove(move,pokemon)
    end
    And these are the HiddenMoveHandlers
    Code:
    HiddenMoveHandlers::CanUseMove.add(:FLY,proc{|move,pkmn,showmsg|
       return false if !pbCheckHiddenMoveBadge(BADGEFORFLY,showmsg)
       if $game_player.pbHasDependentEvents?
         Kernel.pbMessage(_INTL("It can't be used when you have someone with you.")) if showmsg
         return false
       end
       if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
         Kernel.pbMessage(_INTL("Can't use that here.")) if showmsg
         return false
       end
       return true
    })
    
    HiddenMoveHandlers::UseMove.add(:FLY,proc{|move,pokemon|
       if !$PokemonTemp.flydata
         Kernel.pbMessage(_INTL("Can't use that here."))
         return false
       end
       if !pbHiddenMoveAnimation(pokemon)
         Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
       end
       pbFadeOutIn(99999){
          $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
          Kernel.pbCancelVehicles
          $PokemonTemp.flydata = nil
          $scene.transfer_player
          $game_map.autoplay
          $game_map.refresh
       }
       pbEraseEscapePoint
       return true
    })
     

    StCooler

    Mayst thou thy peace discover.
    9,301
    Posts
    4
    Years
    • Seen May 5, 2024
    Below the line:

    Code:
       return false if !pbCheckHiddenMoveBadge(BADGEFORFLY,showmsg)

    write the line:

    Code:
       pbMessage("Hello.")
    And tell me if you see the "Hello" message when trying to fly.
     
    43
    Posts
    7
    Years
    • Seen May 4, 2023
    Below the line:

    Code:
       return false if !pbCheckHiddenMoveBadge(BADGEFORFLY,showmsg)

    write the line:

    Code:
       pbMessage("Hello.")
    And tell me if you see the "Hello" message when trying to fly.

    It shows me "Hello", and then it opens the map it makes me select the point and then nothing comes back to the game without doing anything, I own all the medals in the game of course
     

    StCooler

    Mayst thou thy peace discover.
    9,301
    Posts
    4
    Years
    • Seen May 5, 2024
    It shows me "Hello", and then it opens the map it makes me select the point and then nothing comes back to the game without doing anything, I own all the medals in the game of course
    That's the error I hoped to see, because now it means the issue is yet to be found XD

    In the handler:
    Code:
    HiddenMoveHandlers::UseMove.add(:FLY,proc{|move,pokemon|
    above the line:
    Code:
       pbFadeOutIn(99999){
    paste the line:
    Code:
      Kernel.pbMessage("Hello 2")
    and tell me if you see this hello.

    (remove the other "Hello" I had you add)

    Sorry it takes time, I don't use v17.2 and I don't know what your issue is ^^"
     
    43
    Posts
    7
    Years
    • Seen May 4, 2023
    That's the error I hoped to see, because now it means the issue is yet to be found XD

    In the handler:
    Code:
    HiddenMoveHandlers::UseMove.add(:FLY,proc{|move,pokemon|
    above the line:
    Code:
       pbFadeOutIn(99999){
    paste the line:
    Code:
      Kernel.pbMessage("Hello 2")
    and tell me if you see this hello.

    (remove the other "Hello" I had you add)

    Sorry it takes time, I don't use v17.2 and I don't know what your issue is ^^"

    I'll let you know later if it appears to me, and don't worry about the time you take, in fact I thank you infinitely for the help
     
    43
    Posts
    7
    Years
    • Seen May 4, 2023
    That's the error I hoped to see, because now it means the issue is yet to be found XD

    In the handler:

    Code:
    HiddenMoveHandlers::UseMove.add(:FLY,proc{|move,pokemon|
    above the line:
    Code:
       pbFadeOutIn(99999){
    paste the line:
    Code:
      Kernel.pbMessage("Hello 2")
    and tell me if you see this hello.

    (remove the other "Hello" I had you add)

    Sorry it takes time, I don't use v17.2 and I don't know what your issue is ^^"

    No, it doesn't show me the writing
     

    StCooler

    Mayst thou thy peace discover.
    9,301
    Posts
    4
    Years
    • Seen May 5, 2024
    No, it doesn't show me the writing
    Argggggg :(
    So it means that the Fly function is not called. Remove the "hello" message and find the function self.triggerUseMove(item,pokemon) and add the following messages:

    Code:
      # Returns whether move was used
      def self.triggerUseMove(item,pokemon)
        Kernel.pbMessage("triggerUseMove 1") # Add this 
        return false if !UseMove[item]
        Kernel.pbMessage("triggerUseMove 2") # Add this 
        return UseMove.trigger(item,pokemon)
        Kernel.pbMessage("triggerUseMove 3") # Add this 
      end

    and tell me the last message you get.
     
    43
    Posts
    7
    Years
    • Seen May 4, 2023
    Argggggg :(
    So it means that the Fly function is not called. Remove the "hello" message and find the function self.triggerUseMove(item,pokemon) and add the following messages:

    Code:
      # Returns whether move was used
      def self.triggerUseMove(item,pokemon)
        Kernel.pbMessage("triggerUseMove 1") # Add this 
        return false if !UseMove[item]
        Kernel.pbMessage("triggerUseMove 2") # Add this 
        return UseMove.trigger(item,pokemon)
        Kernel.pbMessage("triggerUseMove 3") # Add this 
      end

    and tell me the last message you get.

    The game crashes me as soon as I start
     
    43
    Posts
    7
    Years
    • Seen May 4, 2023
    The game tells me "Script '115' line PField_FieldMov: SyntaxError occured.
    compile error
    115:PField FieldMoves:43: syntax error
    Kernel.pbMessage("triggerUseMove3")
    A
    115:PField FieldMoves: 71: syntax error
    .Kernel.pbMessageLINTL("Sorry, a new Badge is required.,") .
    115:PField FieldMoves: 71: dynamic constant assignment
    ...Kernel.pbMessageLINTL("'Sorry,a new Badge is required.")) i.
    115:PField FieldMoves: 71: syntax error
    ....pbMessageLINTL("Sorry, a new Badge is required.")) if show.
    A
    115:PField FieldMove
     

    StCooler

    Mayst thou thy peace discover.
    9,301
    Posts
    4
    Years
    • Seen May 5, 2024
    The game tells me "Script '115' line PField_FieldMov: SyntaxError occured.
    compile error
    115:PField FieldMoves:43: syntax error
    Kernel.pbMessage("triggerUseMove3")
    A
    115:PField FieldMoves: 71: syntax error
    .Kernel.pbMessageLINTL("Sorry, a new Badge is required.,") .
    115:PField FieldMoves: 71: dynamic constant assignment
    ...Kernel.pbMessageLINTL("'Sorry,a new Badge is required.")) i.
    115:PField FieldMoves: 71: syntax error
    ....pbMessageLINTL("Sorry, a new Badge is required.")) if show.
    A
    115:PField FieldMove

    In the error message, I see : Kernel.pbMessageLINTL("Sorry, a new Badge is required.,")
    Find that pbMessageLINTL( and replace it with pbMessage(_INTL( (note the parentheses). It's probably a typo you made ^^
     
    Last edited:
    43
    Posts
    7
    Years
    • Seen May 4, 2023
    In the error message, I see : Kernel.pbMessageLINTL("Sorry, a new Badge is required.,")
    Find that pbMessageLINTL( and replace it with pbMessage(_INTL( (note the parentheses). It's probably a typo you made ^^

    I reported the message by scanning the text with the phone, maybe the error was made by the phone itself hahha but I will check for security because I have a doubt xD
     
    Back
    Top