Noob question - Move player "Set event location"-like

Status
Not open for further replies.

gufino2

Villager
Member
Joined
Jun 14, 2014
Messages
9
Reaction score
1
First Language
Italian
Primarily Uses
Hello guys,

in an autorun event I want to "teleport" the main character to another location of the current map. I noticed I can't use "Set event location" to move the main player, and I'd like to know what's the correct way to do it. Should I simply use "Transfer player" targeting the same map and disabling fade? Won't this trigger some sort of map reload/events restart?

Thanks :)

EDIT: I looked into the Game_Player script:

 #--------------------------------------------------------------------------

  # * Execute Player Transfer

  #--------------------------------------------------------------------------

  def perform_transfer

    if transfer?

      set_direction(@new_direction)

      if @new_map_id != $game_map.map_id

        $game_map.setup(@new_map_id)

        $game_map.autoplay

      end

      moveto(@new_x, @new_y)

      clear_transfer_info

    end

  end

 

So it looks like moving the player into the same map does not retrigger map's setup etc. etc.

 

So I guess "Transfer player" is the right way to do it. Or use "script: $game_player.moveto(newx,newy)" maybe :)

 

Feel free to post corrections if my assumptions are wrong. Thanks !
 
Last edited by a moderator:

Cadh20000

Veteran
Veteran
Joined
Sep 15, 2013
Messages
1,828
Reaction score
445
First Language
English
Primarily Uses
Hello guys,

in an autorun event I want to "teleport" the main character to another location of the current map. I noticed I can't use "Set event location" to move the main player, and I'd like to know what's the correct way to do it. Should I simply use "Transfer player" targeting the same map and disabling fade? Won't this trigger some sort of map reload/events restart?

Thanks :)
I just set up a little experiment to check and I can say for sure that it does not "trigger some sort of map reload/events restart".

I set up some dummy NPCs to talk to that "Erase Event" when triggered. I talked to them then teleported to another spot on the same map. They stayed gone which means the map was not reloaded.

Saving on a map and restarting from the save file also will not "reload" it, but leaving the map and reentering it will.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Transferring a player to the same map does not require the map to be reloaded. So no, the "startup" autorun/parallel events will not be reloaded and rerun.


You could have just tried it and had your answer straight away :)
 

gufino2

Villager
Member
Joined
Jun 14, 2014
Messages
9
Reaction score
1
First Language
Italian
Primarily Uses
Ehehe that's exactly what I did, but when my "coder-mind" kicked in, the best way to try it was to analyze the scripts to understand how it actually works :p
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
:)


Okay, for your coder-mind ...


Autorun and parallel process events are kicked off from Game_Map's setup method. This is only called when the player transfers from one map to another (method in Game_Player, which I can't remember the name of and don't have in front of me). That Game_Player method checks to see if the current map number is the same as the last one, and it only calls Game_Map.setup if they are different.


This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

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

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,868
Messages
1,017,066
Members
137,576
Latest member
SadaSoda
Top