Gw Temp

Menu

Tutorial - 'Unknown Location Teleportation' by Toad008

An item about RPGMaker 2000 posted on

Blurb

Toad008 explains how to create a system in RM2K3 games that teleports the player to a location on the map that s/he specifies! Pretty neat!

Body

Hello Fellow RPG Makers.
I am a fairly new RPG maker who hit a great problem when trying to put one of his ideas into motion. I wanted to make an item/skill that teleported the player to a location that they specified, regardless of if they've been there or not. As soon as I set out on this, it looked much tougher and longer than I though was possible. But then I found a way to make it super easy! I still haven't quite worked all the features, but this is a fully functionable basic system!

First note: I am using RPGMaker 2K3, and I am not certain this works on earlier versions. However, from my memory of RPGMaker 2K most of the commands I use are present, if not all.

Step 1: Create the item or skill.
I decided to modify the default teleport skill, as this was the easiest. All you have to do is change the skill's type to Switch and set it to activate a switch, I called it Teleport_On. Make sure it can only be activated in field, for I don't know how it would react in battle (plus you don't want people teleporting out of battles)

Step 2: Make a common event.
I called it Teleport for obvious reasons. Make sure it's Auto Start when the switch Teleport_On is activated. For my game the world map is map id 1 (check by properties on map) so first set a variable to Map id. Then I asked the user to input the X and Y coordinates, and stored them into 2 variable locations. Following so far? Here's what the code should look like up to date.

<>Variable Oper: [0001:Map ID] Set, 1
<>Message: Please enter the X coordinate:
<>Input Number: 2 Digit, [0002: Teleport X]
<>Message: Please enter the Y coordinate:
<>Input Number: 2 Digit, [0003: Teleport Y]

Now when you use the skill, if you set a sound to it, It plays it immediately, which was kinda weird for me. It would play the sound, then ask all these things and not play it while you actually teleported. So now I added a play sound event, just so it sounds like your actually teleporting. Now I faded the screen black, just so I could have some privacy for the following things, and to make it tougher to explore the map just by systematically teleporting around.

Make it recall the hero to location stored by your 3 variables for map and X,Y coordinates. Tada! You just teleported the hero where he specified. But now there's a problem. what if he teleported himself to the ocean? Or a mountain top? or some other impassible terrian? This is where it gets tough....... But not my way!

Now stored terrain id of your X,Y variables into a new variable. This stores just some number that connects to the terrian type your standing on. Now to make some changes. In the database editor choose terrain. Create a terrian called Impassable or bob, or whatever. Make sure you take note of the id number beside it. you'll need that later. Now change to tileset and change all the tiles you don't want them to teleport on to this new terrian type Impassable. My Impassible was ID 0010, so I set all the oceans, walls, mountains to terrian type 10. Basically anything that shows an X when you look at its passability. It's pretty easy and quick. Now why have you done this? Read on!

Go back to your common event programming. It should look something like this:

<>Variable Oper: [0001:Map ID] Set, 1
<>Message: Please enter the X coordinate:
<>Input Number: 2 Digit, [0002: Teleport X]
<>Message: Please enter the Y coordinate:
<>Input Number: 2 Digit, [0003: Teleport Y]
<>Play Sound: revive3
<>Tint Screen: (R000, G000, B000, S000), 1.0 Sec (Wait)
<>Recall to Location: V[0001](V[0002], V[0003])
<>Store Terrian ID: (V[0002], V[0003]), [0004:Terrain_ID]

Now add a Branch condition. make it check if your Terrain_ID variable is equal to your new made Impassable Terrian ID. If it is, show a message that says "YOU DIE!!!!!!" and add a game over event (No mercy here suckers!) then end the branch (no need for an else statement. It will just go to whatever we write afterwards.) Now fade the screen back in, so they can see again, and turn the teleport switch off to reset the process so they can teleport again. There you go! Teleporting anywhere made easy!

Here's how your final code should look:

<>Variable Oper: [0001:Map ID] Set, 1
<>Message: Please enter the X coordinate:
<>Input Number: 2 Digit, [0002: Teleport X]
<>Message: Please enter the Y coordinate:
<>Input Number: 2 Digit, [0003: Teleport Y]
<>Play Sound: revive3
<>Tint Screen: (R000, G000, B000, S000), 1.0 Sec (Wait)
<>Recall to Location: V[0001](V[0002], V[0003])
<>Store Terrian ID: (V[0002], V[0003]), [0004:Terrain_ID]
<>Branch: Var[0004:Terrain_ID] is 10
<>Message: You Have teleported to your death
<>Game Over
<>
: End
<>Tint Screen: (R100, G100, B100, S100), 1.0 Sec (Wait)
<>Message: Sucessfully Teleported
<>Switch Operation: [0001:Teleport] OFF
<>


Now some other specifics that are optional. If you don't want all your impassible terrain to be classified as one type, you can make as many as you want. (for example a class for towns, and oceans) for each Terrain distinction you want, just create it under Terrain, and add a new branch in your common event code. easy!

<>Branch: Var[0004:Terrain_ID] is ## <-- change to whatever terrian ID is!
<>Message: You Have teleported to your death
<>Game Over
<>
: End

Also using this method you can customize messages. If you want them to know they drowned, you can tell them.

I also found a side effect I never planned in. If you try to teleport outside of the map, it still gives you the death event, assuming you set the void chip in the bottom right of the chip screen to one of your Impassable terrains.

There you have it! A system where the player can teleport his party anywhere in the world (assuming he/she remembers the coordinates) instantly! I'm also working on implementing an required item to allow you to teleport to different world maps. I don't think that would be very tough, and as all my annoying teachers say "is elementary, and left to exercise".

Tutorial by:
Toad008
Email: Toad_008@hotmail.com

Hope this tutorial works okay for you, it's my first.