v18 Pulling up the Fly Map in an event

This thread pertains to v18 of Pokémon Essentials.

MarcStuts08

Novice
Member
Joined
Sep 24, 2018
Posts
10
I want to create a Flight service that allows the player to pay $500 at a depot to fly to any city they've been to before.

I figure the event should be fairly simple, branch yes or no, yes has the player pay $500 then pulls up the Fly Map for the player to select the place they wish to fly too.

What's snagging my plan is I don't know how to pull up the Fly Map in an event, or if it's even something you can do.

Is it possible to have the event transition into the Fly sequence? Or am I better off using a different method?
 

aiyinsi

A wild Minun appeared!
Member
Joined
May 17, 2017
Posts
245
This is the code you would run in the event: I would recommend to actually condense all of that into one function in the scripts and just calling that.
Ruby:
def myCustomFlyThingy
            scene = PokemonRegionMap_Scene.new(-1,false)
            screen = PokemonRegionMapScreen.new(scene)
            ret = screen.pbStartFlyScreen
            if ret
                 $PokemonTemp.flydata = ret
                        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
                 }
                 return true
          end
          return false
end

also sorry for the weird indenting ... I hate this editor ...

EDIT: made it into a function that you can throw into your scripts. Also introduced a return value that tells you whether the player actually used fly or not. If they didn't you can use this in an if-statement to not have the player pay.
 
Top