• 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!
  • Scottie, Todd, Serena, Kris - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

Adding the Eon Flute's flying effect

  • 6
    Posts
    9
    Years
    • Seen Jun 22, 2016
    Hi guys
    I need some help with scripting
    I am trying to make a Eon Flute
    1. I want it so when people use the item Eon Flute it will trigger a move that will display the hidden move animation but with a latias on it
    then it will teleport the player to a over view of the map that i will create and then they will be able to fly around then i was planning to fill each map with events on action button trigger which will take them back to the start of each map
    2. on my game the default screen size option is medium and i would like it to be Large


    i am happy to talk to someone that can help me with these problems
    hit me up on skype at kurt.raas
    i am in the uk


    appreciate anyone that could help
    thanks

    i also would need the character to change to a edited version of the surfing character where he will be sitting on latias this would be when he gets transfered to the new map

    Code:
    PItem_ItemEffects
    ItemHandlers::UseFromBag.add(:EONFLUTE,proc{|item|
    next 2 
    })
    if canUseMoveEon 
    
    ItemHandlers::UseFromBag.add(:EONFLUTE,proc{|item|
    next 2
    })
    useMoveEon if canUseMoveEon
    Here i keep getting syntax errors

    Code:
    PField_HiddenMoves
    #===============================================================================
    # Eon move animation
    #===============================================================================
    def pbEonMoveAnimation(pokemon)
      return false if !pokemon
      viewport=Viewport.new(0,0,0,0)
      viewport.z=99999
      bg=Sprite.new(viewport)
      bg.bitmap=BitmapCache.load_bitmap("Graphics/Pictures/hiddenMovebg1")
      sprite=PokemonSprite.new(viewport)
      sprite.setPokemonBitmap(pokemon)
      sprite.z=1
      sprite.ox=sprite.bitmap.width/2
      sprite.oy=sprite.bitmap.height/2
      sprite.visible=false
      strobebitmap=AnimatedBitmap.new("Graphics/Pictures/hiddenMoveStrobes")
      strobes=[]
      15.times do |i|
        strobe=BitmapSprite.new(26*2,8*2,viewport)
        strobe.bitmap.blt(0,0,strobebitmap.bitmap,Rect.new(0,(i%2)*8*2,26*2,8*2))
        strobe.z=((i%2)==0 ? 2 : 0)
        strobe.visible=false
        strobes.push(strobe)
      end
      strobebitmap.dispose
      interp=RectInterpolator.new(
         Rect.new(0,Graphics.height/2,Graphics.width,0),
         Rect.new(0,(Graphics.height-bg.bitmap.height)/2,Graphics.width,bg.bitmap.height),
         10)
      ptinterp=nil
      phase=1
      frames=0
      begin
        Graphics.update
        Input.update
        sprite.update
        case phase
        when 1 # Expand viewport height from zero to full
          interp.update
          interp.set(viewport.rect)
          bg.oy=(bg.bitmap.height-viewport.rect.height)/2
          if interp.done?
            phase=2
            ptinterp=PointInterpolator.new(
               Graphics.width+(sprite.bitmap.width/2),bg.bitmap.height/2,
               Graphics.width/2,bg.bitmap.height/2,
               16)
          end
        when 2 # Slide Pokémon sprite in from right to centre
          ptinterp.update
          sprite.x=ptinterp.x
          sprite.y=ptinterp.y
          sprite.visible=true
          if ptinterp.done?
            phase=3
            pbPlayCry(pokemon)
            frames=0
          end
        when 3 # Wait
          frames+=1
          if frames>30
            phase=4
            ptinterp=PointInterpolator.new(
               Graphics.width/2,bg.bitmap.height/2,
               -(sprite.bitmap.width/2),bg.bitmap.height/2,
               16)
            frames=0
          end
        when 4 # Slide Pokémon sprite off from centre to left
          ptinterp.update
          sprite.x=ptinterp.x
          sprite.y=ptinterp.y
          if ptinterp.done?
            phase=5
            sprite.visible=false
            interp=RectInterpolator.new(
               Rect.new(0,(Graphics.height-bg.bitmap.height)/2,Graphics.width,bg.bitmap.height),
               Rect.new(0,Graphics.height/2,Graphics.width,0),
               10)
          end
        when 5 # Shrink viewport height from full to zero
          interp.update
          interp.set(viewport.rect)
          bg.oy=(bg.bitmap.height-viewport.rect.height)/2
          phase=6 if interp.done?    
        end
        for strobe in strobes
          strobe.ox=strobe.viewport.rect.x
          strobe.oy=strobe.viewport.rect.y
          if !strobe.visible
            randomY=16*(1+rand(bg.bitmap.height/16-2))
            strobe.y=randomY+(Graphics.height-bg.bitmap.height)/2
            strobe.x=rand(Graphics.width)
            strobe.visible=true
          elsif strobe.x<Graphics.width
            strobe.x+=32
          else
            randomY=16*(1+rand(bg.bitmap.height/16-2))
            strobe.y=randomY+(Graphics.height-bg.bitmap.height)/2
            strobe.x=-strobe.bitmap.width-rand(Graphics.width/4)
          end
        end
        pbUpdateSceneMap
      end while phase!=6
      sprite.dispose
      for strobe in strobes
        strobe.dispose
      end
      strobes.clear
      bg.dispose
      viewport.dispose
      return true
    end
    Here i need to remove the part where the pokemon slides in from right to left as i have a latias on the graphic hiddenmovebg1

    Code:
    #===============================================================================
    # Eon
    #===============================================================================
    HiddenMoveHandlers::CanUseMove.add(:EON,proc{|move,pkmn|
       if !$DEBUG &&
          !(HIDDENMOVESCOUNTBADGES ? $Trainer.numbadges>=BADGEFORFLY : $Trainer.badges[BADGEFORFLY])
         Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
         return false
       end
       if $game_player.pbHasDependentEvents?
         Kernel.pbMessage(_INTL("It can't be used when you have someone with you."))
         return false
       end
       if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
         Kernel.pbMessage(_INTL("Can't use that here."))
         return true
       end
       return true
    })
    
    HiddenMoveHandlers::UseMove.add(:EON,proc{|move,pokemon|
       if !$PokemonTemp.flydata
         Kernel.pbMessage(_INTL("Can't use that here."))
       end
       if !pbEonMoveAnimation(pokemon)
         Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
       end
       pbFadeOutIn(99999){
          Kernel.pbCancelVehicles
          $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]
          $PokemonTemp.flydata=nil
          $game_temp.player_new_direction=2
          $scene.transfer_player
          $game_map.autoplay
          $game_map.refresh
       }
       pbEraseEscapePoint
       return true
    })
    Here it always says Cant use that here (no matter where i go on the game)and then gives me syntax errors, this i also a near copy of the move FLY

    O would it just be easier to rather then having a item triggering a move to just have the item teleport the player to another map

    but then this item must also trigger a character change to one where he is flying latias

    could someone help me with this scripting please
    i just cant get the script to teleport the player to the map i want as it has to teleport the player to the other version of the map that they are in eg if a player is in waters edge it need to teleport to the other version of waters edge which is a skyview
     
    Last edited by a moderator:
    Back
    Top