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.

Need help editing “scene_endâ€

Code:
def transport(map_id, player_x, player_y, direction)
      $game_temp.player_transferring = true
      $game_temp.player_new_map_id = map_id
      $game_temp.player_new_x = player_x
      $game_temp.player_new_y = player_y
      $game_temp.player_new_direction = direction
  end
replace the line "$scene = Scene_Title.new" with something like:
transport(105, 0, 0, 0)
paste the code above above after the line "class Scene_End"
 

e

Sponsor

I don't think you should do that, though I haven't tested it. I believe the "main" of the Scene_End class will never "break" if you do not set a new scene object.

You should replace the line:
Code:
$scene = Scene_Title.new

With:
Code:
$game_map.setup(<YOUR_MAP_ID_HERE>)
$scene = Scene_Map.new

I'm not too sure about the $game_map.setup method however, since I cannot test it myself and have never used it (and, also, do not currently have access to a RGSS reference), but I assume it should work.
 
I know, just saying the code wasn't working. if I add the line $scene = Scene_Map.new to mine, it works. unless I'm missing something here.
Code:
def transport(map_id, player_x, player_y, direction)
      $game_temp.player_transferring = true
      $game_temp.player_new_map_id = map_id
      $game_temp.player_new_x = player_x
      $game_temp.player_new_y = player_y
      $game_temp.player_new_direction = direction
      $scene = Scene_Map.new
  end
 
Wow! This was really quick reply! Well, i have try all the method you suggested but the only one that is working is from Yautja Arbiter. One am wondering, is it possible to control the position where the player will be transfered(x and y)? Currently. the player is transferred to exactly where it was on the last map... for example, if i was on coordinate 10, 10 on map 001, when am transferred to map 105 my coordinate will be 10, 10. (i hope that my example makes sense...)

Anyway, thanks you people for your quick answer... i really appreciate this!

SBS

Edit: I completely forget to mention that am getting a syntax error while using the code from Silver wind and Etheon.
 
I understand ;) Anyway, am still trying to find a way to control the position of the player when transferred to map (hypothetically) 105.

EDIT: I tested the one by Silver Wind... IT'S WORKING NOW!!! I can even set the coordinates!

Again, thanks you all for helping me!

SBS
 

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