Transfer player on game start

Yuuta Kirishima

kind of a big deal
Veteran
Joined
Jul 9, 2013
Messages
551
Reaction score
131
First Language
Engilsh
Primarily Uses
RMMV
Is there a method that when the game starts that it transfers the player to a certain location rather they load a save or not?


For example, I save my game on a map, close it, open the game again, I load my save but instead of being on the map that I saved on I am on a predefined map.
 

KingKraken

Veteran
Veteran
Joined
Apr 2, 2015
Messages
132
Reaction score
32
First Language
English
Primarily Uses
RMMV
I'm not in a position to go poke around my rpgmaker, but you could probably do something like a global condition branch, that when a game is saved and then exited, that it teleport the player to those specific coordinates before the exit/save.

Otherwise you might have to have a script created that can do that.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,141
Reaction score
12,416
First Language
English
Primarily Uses
RMMV
For new game, just put the player's starting location where you want them to be.


When loading from a save file, I'd look at Scene_Load.prototype.reloadMapIfUpdated - comment out the condition and use values rather than variables for the reserveTransfer() call.
 

Yuuta Kirishima

kind of a big deal
Veteran
Joined
Jul 9, 2013
Messages
551
Reaction score
131
First Language
Engilsh
Primarily Uses
RMMV
For new game, just put the player's starting location where you want them to be.


When loading from a save file, I'd look at Scene_Load.prototype.reloadMapIfUpdated - comment out the condition and use values rather than variables for the reserveTransfer() call.
Pretty sure that doesn't exist in ace ;) But thank you, gave me an idea where to look.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,141
Reaction score
12,416
First Language
English
Primarily Uses
RMMV
Sorry - for some reason I thought you were talking MV.  However, there IS a load_map_if_updated method in Ace, in the DataManager script.  And it's even easier than MV:

Code:
  #--------------------------------------------------------------------------
  # * Reload Map if Data Is Updated
  #--------------------------------------------------------------------------
  def self.reload_map_if_updated
    if $game_system.version_id != $data_system.version_id
      $game_map.setup($game_map.map_id)
      $game_player.center($game_player.x, $game_player.y)
      $game_player.make_encounter_count
    end
  end
Again, get rid of the conditions surrounding the block, and replace the map and player coordinates with the values you want to use.  Easy peasy :)
 

Yuuta Kirishima

kind of a big deal
Veteran
Joined
Jul 9, 2013
Messages
551
Reaction score
131
First Language
Engilsh
Primarily Uses
RMMV
Thanks, works perfectly!
 

SaburoX

Veteran
Veteran
Joined
Jan 27, 2013
Messages
79
Reaction score
8
Primarily Uses
DP3 has a script snippet that lets you run a common event on loading. You could just use that and handle the transfer there. Maybe use a conditional branch so that you can change where the spawn point is.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

The video of a psycho chasing people on the streets with a sword before getting subdued is wild. Apparent screenshots of his Twitter feed before it went private reveal a dangerous delusional mindset. I heard there was a bow person too. The crazies are really coming out of the woodworks.
Stream will be live shortly with some Witcher 3, followed by a session of the Interactive Text Adventure! Feel free to drop by!
Managed to find a way to hang a bed cover over my window. So no more being toasted alive in the afternoon!:kaoswt2:
So, uh, has anyone tried buying any resources from KokoroReflections? Because I've been looking for a 'buy' button on the site for like 10 minutes now and can't find one.
Any also thought it's too cringy to put the word "and you" in your credit as a special thanks?
Cause that's what I thought...

Forum statistics

Threads
97,993
Messages
948,401
Members
129,255
Latest member
RPGLordLight
Top