Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Teleporting you character to map using a script

I made an event based opening credit "cinematic and I need to be able to teleport to that map before the title screen. I also need my character to teleport to particular map upon gameover. Can anyone help me?

Edit: Ok I have some progress. I made the most Noobish script ever, its now teleporting me to the map but the title screen still flashes infront of the screen before it goes to it and when it goes back to the title screen, the same thing repeats.

Heres the script(don't laugh)

Code:
class Scene_Credits
  
def Initialize

  Credits == nil
  
end

 def Main

credits_show

update

refresh

end



def update
    Credits == false
 $game_temp = Game_Temp.new
 $game_system = Game_System.new
 $game_switches = Game_Switches.new
 $game_variables = Game_Variables.new
 $game_self_switches = Game_SelfSwitches.new
 $game_screen = Game_Screen.new
 $game_actors  = Game_Actors.new
 $game_party = Game_Party.new
 $game_troop  = Game_Troop.new
 $game_map = Game_Map.new
 $game_player = Game_Player.new
 $game_party.setup_starting_members
 $game_map.setup(8)
 $game_player.moveto(0,0)
 $game_player.refresh
 $game_map.autoplay
 $game_map.update
 $scene = Scene_Map.new
end

def refresh
     Credits == true
   end
   end

I also changed

Code:
  $game_system = Game_System.new
in Scene Title to

Code:
if credits = false
  $scene = Scene_Credits.new
else
  $game_system = Game_System.new
  end

The only thing is.... its never set to false so nothing happens. Help me!!!!!!
 
I don't know what you are trying to do, but you have a lot of errors in that script, so here is the same script with no errors.

Code:
class Scene_Credits
  def main
    update
    refresh
  end
  def update
    credits = false
    $game_temp = Game_Temp.new
    $game_system = Game_System.new
    $game_switches = Game_Switches.new
    $game_variables = Game_Variables.new
    $game_self_switches = Game_SelfSwitches.new
    $game_screen = Game_Screen.new
    $game_actors  = Game_Actors.new
    $game_party = Game_Party.new
    $game_troop  = Game_Troop.new
    $game_map = Game_Map.new
    $game_player = Game_Player.new
    $game_party.setup_starting_members
    $game_map.setup(8)
    $game_player.moveto(0,0)
    $game_player.refresh
    $game_map.autoplay
    $game_map.update
    $scene = Scene_Map.new
  end
  def refresh
    credits = true
  end
end

Again, I don't know what you were trying to do, I just removed the errors.
 
I made an opening credit "cinematic". I need it show before the title screen like a logo script. The only thing is, if I just put $scene=Scene_Credits.new in Scene_Title. Then when it goes back to the title it keeps teleporting me back to the cinematic.
 

Tdata

Sponsor

Why not change Main's $scene=Scene_Title to whatever you call your Script. Then once the cinimatic is finished, call $scene=Scene_Title.

But, if you really want to know how to teleport the player using a script it is:
Code:
    $game_temp.player_transferring = true
    $game_temp.player_new_map_id = #the map's ID #
    $game_temp.player_new_x = #x coordinate where you are teleporting 
    $game_temp.player_new_y = #y coordinate where you are teleporting
    $game_temp.player_new_direction = #8 = Up 4 = left 6 = right 2 = Down
    $scene = Scene_Map.new
    $game_map.autoplay
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top