World map teleport Scene

Discussion in 'RGSS3 Script Requests' started by FAGC54, Sep 20, 2017.

Thread Status:
Not open for further replies.
  1. FAGC54

    FAGC54 What was that variable for? Veteran

    Messages:
    48
    Likes Received:
    2
    Location:
    dotNET Productions
    First Language:
    Spanish
    Primarily Uses:
    RMVXA
    Hello people!

    Today i come to you asking for help! I need to create an event that opens up and scene window (more like a menu). For sure i know how to get to there, but i want that scene window to be a World Map, and be able to chosse locations on the map to telepor by moving a cursor, a very good example is how the move Fly works in pokemon. How can i do this? Is there a script for this?

    Thanks in advance,
     
    #1
  2. readydotexe

    readydotexe Low class wizard Veteran

    Messages:
    91
    Likes Received:
    158
    First Language:
    Spanish
    Primarily Uses:
    RMVXA
  3. Heirukichi

    Heirukichi Veteran Veteran

    Messages:
    1,044
    Likes Received:
    381
    Location:
    Italy
    First Language:
    Italian
    Primarily Uses:
    RMVXA
    There are few ways you can do it without scripts, just using "Show Picture". The question is: are you using a mouse script or just the vanilla engine? If you are using the vanill engine then it is easier, if you want the let the player pick a destination using the mouse then we need to know which mouse script you are using.

    That said you can do something like this:

    1. Open your world map image using an image manipulation program
      Once you open it you have to check the exact position (be VERY accurate when doing this, a single pixel might do the difference) of every single location you want as a possible destination and take note. You can write them on a notebook, a sheet of paper, a text file...anywhere is just fine but take note of those coordinates and which location every one of them is pointing to.
      NOTE: I would recommand you to check the coordinates of the central pixel of every location, it will be much easier later on.

    2. Open RPG Maker VX Ace and check EVERY map you want to add as a possible destination
      You have to take notes like in the previous point. For every map you want to include as a possible destination you need the following informations:
      • Map ID (you can see them in the bar at the bottom of your project window once you select the map. Write the number without leading zeroes)
      • Where you want to transfer the player (X and Y coordinates)
      • The direction the player should be facing (write them as numbers: 0 - do not change direction, 2 - down, 4 - left, 6 - right, 8 - up)

    3. Create your cursor image
      Using any image manipulation program you have to create your cursor image. This image wil be displayed on the map when the player opens it. It can be litterally anything: a star on the location currently pointed, a dot of a different color, a circle that surrounds the pointed location and so on. Just remember that since we are going to place this image ABOVE the map you have to use transparency in EVERY zone that does not contain a part of the cursor itself. If it is a square the central part has to be transparent, if it is a dot the outside part has to be transparent...and so on. If you followed my instructions and took note of the central pixel of every location in the map image you don't have to do any calculation to place it later.

    4. Create your event
      Now you have everything you need, it is time to create the event itself. In the first page of this event you have to setup everything you need for the actual scene. Since we don't want the player to be able to open the menu it is better to seal access to it while the map is displayed on the screen. In the 3rd page of your event commands there is an option for that. You probably don't want the player to be able to move while the map is displayed as well. That can be done using passability, you need a tileset that is TOTALLY unpassable. What is in the tileset is not important since you can either freeze graphics until the map is displayer or tint the screen (I am going to use this last one). What is important is that your tileset is unpassable. Tint your screen black and change map tileset (both of them are event commands).

      Now your player cannot move, cannot open the menu and cannot see. What you need is to fix its direction to prevent any kind of movement. You can either store the player direction and move it once the event is completed or set a direction fix using a move route. Up to you, just remember your choice.

      You only lack images right now and your event setup is completed. Using show picture select your map image and show it as picture 1. If your image size doesn't fit perfectly in your game window then show it using the top left corner as starting point and take note of its X and Y coordinates (I assume you want to adjust them to centre your image).

      Using Control Variables store your map image X and Y (if they are not 0) in two variables and continue to the next part. If your map image X and Y are 0 you don't need to store them (which is the best option in my opinion).

      Decide one of the locations you took note of and set it as starting potision for your cursor. Show your cursor using show picture and set the starting point to be the centre of your image then set X and Y according to what you wrote for that location.

      After that change your event Self Switch A and set it to be ON (true if you are using a script call instead of the event command).

      Create a second page for your event. Unlike the previousone this will be a Parallel Process. Set the page condition to be "Self Switch A is ON" and start addin commands to this page too.

      Here is what you need: a variable to store your location order (like location A is number 1, location B is number 2 and so on), many different conditional branches.

      First of all set up a conditional branch to check if the B button is being pressed (this means the player wants to exit the scene). Don't forget to check "set handling when conditions do not apply", you will need it. In the first part of the conditional branch you have to turn on Self Switch B. We will use this one to tell the game we want to exit the scene.
      In the second part (the Else one) of the conditional branch you have to put another conditional branch to check if the UP button is being pressed. As in the previous one you want the option "set handling when conditions do not applu" active. It is not something really needed but without it it is possible to press both DOWN and UP button and move the cursor twice in the same event. I personally think it is better to give some sort of priority to input buttons so that it still moves only once.

      In the first part of this new conditional branch you have to increase a variable (the one you decided to use to store your location order) by one and turn Self Switch C ON. In the second part of this new conditional branch (the Else one) you have to put another conditional branch (yes, another one...) to check if the DOWN button is being presed. This time you don't have to check the option "set handling when conditions do not apply". This conditional branch is the same as the previous but instead of increasing your variable by 1 you have to decrease it.

      After that, in the Else part of the very first conditional branch you have to create a new conditional branch to check if the C Self Switch is ON. If yes turn it off and set up a condition al branch for every location you have (a different one for each location). In every one, according to your location index (remember that the 1st location index is 0), you hve to set a Move Picture command to move your cursor (picture 2) in the right position. You should have them noted if you followed my instructions. Create as many conditional branches you need to do that.

      In the second part of the very first conditional branch (again the one to check if B button is being pressed) place a new conditional branch below the one to check if the DOWN button is being pressed and outside it. This time you have to check if the C button (it should be the one for Z key) is being pressed to transfer the player. You don't need an else branch so you can uncheck the "set handling when conditions do not apply" option.

      Almost done (I know, this explaination is kinda boring...It took me more than 1 hour to write it until this point. Please forgive me if I make mistakes when typing but I am super tired). In the conditional branch to check if the C button is being pressed (the last one you created) you have to set up the map transfer. You can do this part using many different conditional branches or using a script call...honestly a script call is much easier here so I am going to use that one. Before this remember to set off Direction Fix for the player if you set it on before and set map tileset back to normal. After that use a flag to tell the game you are operatin a transfer turning Self Switch C ON then just copy/paste this code in your script call and modify it to fit your needs.

      Code:
      case $game_variables[your_variable_id]
      when 0
        $game_player.reserve_transfer(location0_map_id, location0_x, location0_y, location0_direction)
      when 1
        $game_player.reserve_transfer(location1_map_id, location1_x, location1_y, location1_direction)
      when 2
        $game_player.reserve_transfer(location2_map_id, location2_x, location2_y, location2_direction)
      # you can add more locations using the same format and increasing the value after "when"
      end
      #locationN_map_id is the map id for your location with index N
      #locationN_x is the x coordinate for your location with index N
      #locationN_y is the y coordinate for your location with index N
      #locationN_direction is the direction the player should fac eonce arriving in your location with index N
      #N is the value after the"when" keyword (note that the 1st one is 0)
      
      After this you have to turn on Self Swith B ON.

      One last thing before the second page is gone: at the bottom of your event (not in a conditional branch) add a Wait command (5 frames are usually enough) so it will be possible to select locations one by one. If you don't it will be very hard to pick the right destination since the cursor will move every frame and you need to be crazy fast to not move it more than once.

      Finally done. All you hve to do is create a third page for your event. This one will have Self Switch B is ON as condition and will trigger as Autorun. The first thing to do is turn OFF Self Switch B, if we don't we might forget it later. After that we have to dispose of the two pictures (both map and cursor) using the Erase Picture command. The screen is now black and the player still cannot access his game menu. Enable menu access and add a conditional branch to check Self Switch C status (do you remember this one? We ussed it to tell the game we were operating a transfer). If the switch is OFF it means the player decided to exit the scene without teleporting to another map. If so you have to set map tileset back to normal. In the else branch just turn Self Switch C OFF. Now the player can access menu, can move but still cannot see a thing because the screen is still pitch black. OUTSIDE the conditional branch you can now finally tint your screen back to normal (the value for every color should be 0).

      Done. Your event is ready. Go and test it. I am sorry if I missed something. I hope this helps you a bit. Now (After typing for 2 hours) I deserve some rest :)
     
    #3
    FAGC54 likes this.
  4. mlogan

    mlogan Global Moderators Global Mod

    Messages:
    13,607
    Likes Received:
    7,520
    Location:
    Texas
    First Language:
    English
    Primarily Uses:
    RMMV
    I've evented something like this before, granted on a very small map. It doesn't need to be so complicated. Basically, for each transport spot, I created an a transfer event with the graphic as whatever icon I wanted for that location. Then, I created a character sheet that was an arrow. And when I triggered the event to transfer me to that world map, I changed the player graphic to the arrow. Then you can move the arrow around to the different points on the map.

    At any rate, if you are not wanting to event it, and want a script that will do the job, please say so and we can move this topic to Script Requests.
     
    #4
  5. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,513
    Likes Received:
    323
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    #5
    FAGC54 likes this.
  6. FAGC54

    FAGC54 What was that variable for? Veteran

    Messages:
    48
    Likes Received:
    2
    Location:
    dotNET Productions
    First Language:
    Spanish
    Primarily Uses:
    RMVXA
    Thanks to all of you, i will use the script that Roninator2 suggested on both forums.
     
    #6
  7. mlogan

    mlogan Global Moderators Global Mod

    Messages:
    13,607
    Likes Received:
    7,520
    Location:
    Texas
    First Language:
    English
    Primarily Uses:
    RMMV
    Sounds good. Gonna move this to Script Requests and close it.
     
    #7
Thread Status:
Not open for further replies.

Share This Page