Is there a way to transfer from one map to another map while you are riding a vehicle?

Status
Not open for further replies.

Hunor

Villager
Member
Joined
Jan 1, 2014
Messages
23
Reaction score
5
First Language
English
Primarily Uses
Is there a way to transfer from one map to another map while you are riding a vehicle and stay riding that vehicle?
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
can't you issue a transfer player command while on a vehicle? if not then you can always fade the screen off, remove the player from vehicle, transfer, ride the vehicle, fade the screen in
 
Last edited by a moderator:

Hunor

Villager
Member
Joined
Jan 1, 2014
Messages
23
Reaction score
5
First Language
English
Primarily Uses
I tried the boat and the ship.  They work with the transfer event, but I cannot seem to get the airship to work with the transfer event.  Is there a way to get the airship to work with a transfer event to move you and the airship to another map?  And is there a tutorial that I can read that can help me with that?

PS: is there a way to make a land vehicle?  Like a horse and wagon?
 

ArchaicSpoon

Villager
Member
Joined
Jan 5, 2014
Messages
25
Reaction score
4
First Language
Portuguese
Primarily Uses
I tried the boat and the ship.  They work with the transfer event, but I cannot seem to get the airship to work with the transfer event.  Is there a way to get the airship to work with a transfer event to move you and the airship to another map?  And is there a tutorial that I can read that can help me with that?

PS: is there a way to make a land vehicle?  Like a horse and wagon?
Yes, you can technically create an event to change your character's sprite, change the BGM, and increase their movement speed, creating the illusion that they're riding a vehicle.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Events do not activate when you're in an airship. The scripts have explicitly hardcoded to not do so.
 

Yato

(aka Racheal)
Veteran
Joined
Mar 17, 2012
Messages
825
Reaction score
346
Primarily Uses
I'm not looking at the airship code right now, but could you use a parallel process to monitor the player's location and teleport them that way? I assume parallels still work while riding an airship.
 

Hunor

Villager
Member
Joined
Jan 1, 2014
Messages
23
Reaction score
5
First Language
English
Primarily Uses
Is there a tutorial on how to use parallels?

And thank you everyone for your input on this subject.  I greatly appreciate it.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You create an event and set its trigger to parallel process. That makes it run in the background for the whole time it's on, and it loops automatically. Then in the event commands just put the player's X and Y values into variables (through Control Variables - Game Data), followed by conditional branches to see if the x and y values are the x and y of your exit. If they are, do the transfer.


Make the first event command a Wait 5 Frames, because most parallel process events don't need to run EVERY frame, and adding a wait will reduce the amount of lag the event causes.
 

Solo

Veteran
Veteran
Joined
Jul 26, 2013
Messages
1,104
Reaction score
154
First Language
English
Primarily Uses
RMVXA
Wow, this is good to know! :)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
In fact, you should probably condition it by a switch, and turn that switch on when you enter the airship and off when you exit it. That way the event will only be running while you're in the airship, which is the only time you need it to run. No point having it running when you're on foot or in a boat, as the normal transfer events will handle everything then, without having to be running the whole time.
 

Hunor

Villager
Member
Joined
Jan 1, 2014
Messages
23
Reaction score
5
First Language
English
Primarily Uses
Thank you VERY much for that Shaz.  Now I should be able to make a two or more part world map.  A world map that has a north side map and a south side map and that you go between the two maps with a transfer event.  This should allow me to make a REALLY large world map.  Thank you again.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You're making a huge world map by making a number of smaller ones and "joining" them together via transfers? Do you have transfer points all along the edges of your maps?


Someone else was doing something VERY similar (but wanted to be able to transfer from the left side of one map to the top of another, so a little more complicated) and I wrote up a script that would do it for them without them needing to use parallel process events OR have transfer commands. I just can't find it now (not at my own computer), but if you think it'll be of any use, I can search for it when I get home this evening and post it for you.


It basically lets you "attach" maps to each other so when you reach the edge of one map, it'll take you to the corresponding tile on another map, as if the entire edges were transfer triggers.
 

Hunor

Villager
Member
Joined
Jan 1, 2014
Messages
23
Reaction score
5
First Language
English
Primarily Uses
That script would be very useful.  Thank you very much.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I don't have time to look for it this morning, but I'll see if I can find it tonight. If I haven't responded in 24 hours with the script, just add another post here to remind me and I'll look it up for you first thing tomorrow (yay Saturday - you can't come soon enough this week!)
 

Hunor

Villager
Member
Joined
Jan 1, 2014
Messages
23
Reaction score
5
First Language
English
Primarily Uses
I truly don't mind waiting.  Take your time.  I just greatly appreciate the help.  So, however long it takes it takes.  Thank you again.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Here you go. Post this into a new slot in Materials.

On the map, edit the Note box, and enter one line for each edge, in the following format:

exit direction map sidedirection is left, right, up, down (which edge of the current map will trigger the transfer)map is the map id that you're transferring to (no leading zeros)

side is the side of the new map you want to enter on.

So if you want to join map 2 at the top, map 3 in the middle, and map 4 at the bottom, you'd set up your notes on each map like this:

Map 2 notes:

exit bottom 3 top(says when the player reaches the bottom of the current map [2], to transfer to the top of map 3)Map 3 notes:

exit top 2 bottomexit bottom 4 top(says when the player reaches the top of the current map [3], to transfer to the bottom of map 2; and when the player reaches the bottom of the current map [3], to transfer to the top of map 4)Map 4 notes:

exit top 3 bottom(says when the player reaches the top of the current map [4], to transfer to the bottom of map 2)Now, when you're transferring between the bottom and top of maps, they must have the same width; if you're transferring between the left and right of maps, they must have the same height. You can also transfer from the side of one map to the bottom/top of another map (this was the original request - the person wanted to be able to make a kind of "cube" thing) - and that would require that the top/bottom of one map would have the same number of tiles as the left/right of the other map. I don't think you want to use it this way, so it doesn't become that complicated for you.

Code:
#============================================================================# Map Auto Transfer v1.0# Shaz#============================================================================# This script monitors the player's location, and when the edge of a map# is reached, it auto-transfers to the next map, if an auto-transfer is# set up in map notes#============================================================================# The script works on the assumption that all maps where a transfer is set# up have similar dimensions (transferring right from one map to another,# both maps must have the same height; transferring up/down between maps,# both maps must have the same width; transferring left from one map to the# top of another, the first map's height must be the same as the second# map's width#============================================================================# To set up a transfer between maps, enter a series of exit statements on# the map notes as follows# exit direction map side#  direction = left, right, up, down (will transfer when you reach that edge)#  map = map id to transfer to#  side = left, right, top, bottom (where to transfer to on new map)# # exit right 5 left - go right from current map to left side of map 5# exit up 8 bottom - go up from current map to bottom of map 8# exit left 12 bottom - go left from current map to bottom of map 12# # If exit is not defined for any side of the current map, no auto-transfer# will happen#============================================================================class Game_Map  #--------------------------------------------------------------------------  # * Public Instance Variables  #--------------------------------------------------------------------------  # map exit directions and links for auto-transfers on edge of map  attr_reader   :exit_left  attr_reader   :left_map  attr_reader   :left_side  attr_reader   :exit_bottom  attr_reader   :bottom_map  attr_reader   :bottom_side  attr_reader   :exit_right  attr_reader   :right_map  attr_reader   :right_side  attr_reader   :exit_top  attr_reader   :top_map  attr_reader   :top_side  attr_reader   :map_id  #--------------------------------------------------------------------------  # * Setup  #--------------------------------------------------------------------------  alias shaz_autotransfer_map_setup setup  def setup(map_id)    shaz_autotransfer_map_setup(map_id)    setup_notes  end  #--------------------------------------------------------------------------  # * Setup Notes  #--------------------------------------------------------------------------  def setup_notes    @exit_left = @exit_right = @exit_top = @exit_bottom = false    @map.note.split(/[\r\n+]/).each do |line|      case line      when /exit\s*(\w+)\s*(\d+)\s*(\w+)/i        case $1        when 'left'          @exit_left = true          @left_map = $2.to_i          @left_side = $3        when 'right'          @exit_right = true          @right_map = $2.to_i          @right_side = $3        when 'down'          @exit_bottom = true          @bottom_map = $2.to_i          @bottom_side = $3        when 'up'          @exit_top = true          @top_map = $2.to_i          @top_side = $3        end      end    end  endendclass Game_Player < Game_Character  #--------------------------------------------------------------------------  # * Frame Update  #--------------------------------------------------------------------------  alias shaz_autotransfer_game_player_update update  def update    shaz_autotransfer_game_player_update    update_autotransfer  end  def update_autotransfer    return unless $game_map.exit_left && @x == 0 ||                  $game_map.exit_right && @x == $game_map.width - 1 ||                  $game_map.exit_top && @y == 0 ||                  $game_map.exit_bottom && @y == $game_map.height - 1    # we're transferring, so get new coordinate    if @x == 0      map = $game_map.left_map      old = @y      dir = $game_map.left_side    elsif @x == $game_map.width - 1      map = $game_map.right_map      old = @y      dir = $game_map.right_side    elsif @y == 0      map = $game_map.top_map      old = @x      dir = $game_map.top_side    else      map = $game_map.bottom_map      old = @x      dir = $game_map.bottom_side    end    m = load_data(sprintf('Data/Map%03d.rvdata2', map))    if dir == 'left'      reserve_transfer(map, 1, old, 6)    elsif dir == 'right'      reserve_transfer(map, m.width - 2, old, 4)    elsif dir == 'top'      reserve_transfer(map, old, 1, 2)    elsif dir == 'bottom'      reserve_transfer(map, old, m.height - 2, 8)    end  endend
 
Last edited by a moderator:

Hunor

Villager
Member
Joined
Jan 1, 2014
Messages
23
Reaction score
5
First Language
English
Primarily Uses
Thank you.

So, if I am reading what you wrote about this script correctly.  Then I can link together either just four maps or just about an endless number of maps as long as the measurements are the same. 

For example:  If I want to transfer from map 1 to map 2 by going to the bottom of map 1 and then transfer to map 2.  I just need to have the width and height matching each map.

If I now have let's say 10 maps that I want to string together.  Can I?  I now want to string 10 maps together to create a planet..  Is that possible with this script?  Just double checking.

By the way I have never used a script before.  This is my very first RPG Maker game that I have ever used scripts in and I don't know very much about scripts.  Is there a tutorial that walks you through using scripts step by step?  And thank you again Shaz for the script.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
If you are transferring left/right between two maps, they need to have the same height. If you are transferring top/bottom between two maps, they need to have the same width. If you exit the bottom of the map on tile 138 across, it will take you to tile 138 at the top of the other map.


So your maps could all be 20x17 and it will work, as long as you're only moving horizontally or vertically between them.


Yes, you can string 10 maps together. You can string 100 together if you want. As many as you want - there's no limit.


In the Script editor (F11), scroll down until you see Materials in the column on the left. Click below that and hit the Insert key to insert a new slot. Go down to the Name box and enter a name that will help you identify the script later - call it Linked Maps or something like that. It doesn't force you to enter a name, but you're only inviting trouble if you don't. Then copy the script I gave you, make sure your new script slot is selected, and paste it into the editing area on the right. Make sure you don't make any changes - don't add spaces at the start of lines, don't add extra lines. Try and keep it as close as possible to the original script.


SOME scripts require you to do some configuration - they might want to use switches or variables, and you need to set aside those switches and variables, and then change the script to say which ones you've allocated. THIS script does not require any configuration. But you should always read through the opening comments, because that's where the instructions for using the script, and for configuring it if necessary, will be listed.
 

Hunor

Villager
Member
Joined
Jan 1, 2014
Messages
23
Reaction score
5
First Language
English
Primarily Uses
Alright.  Just double checking that I understand this correctly.  In this example all of the maps are 20x20.  I put this in the map notes:

Example:

# direction = left, right, up, down

# map = 12 to transfer to

#

#exit right 23 left- go right from current map to left side of map 23

#exit up 27 bottom - go up from current map to bottom map 27

#exit left 25 right - go left from current map to right of map 25

#exit bottom 13 up - go down from current map to top map 13

I added that extra line in the that example from the example that you give for the map notes.  Is that correct or am I missing something?

Oh and your script is in my script editor unchanged.  I just copied and pasted the script into it after following your instructions.  And thank you for those instructions.
 
Last edited by a moderator:

LanceGardner

Veteran
Veteran
Joined
Dec 30, 2013
Messages
126
Reaction score
6
First Language
English
Primarily Uses
I just wanted to add my thanks for this script. Just what I needed!
 
Status
Not open for further replies.

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

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
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

Forum statistics

Threads
105,868
Messages
1,017,072
Members
137,578
Latest member
JamesLightning
Top