Today, I’m going to show you how to create an Anchor Teleport Spell. What does that mean? Basically, its a spell that teleports you to a specific place, but when you leave that place it takes you directly back to where you were.
To illustrate this concept, we are going to have our Default Sage Hero Noah learn a spell allowing him to teleport to his sanctuary in a small pocket dimension. When he leaves this dimension, we want him to come right back to where he started.
Techniques we will learn in this tutorial:
- Storing Game Data as variables.
- Making a Skill call a Common Event.
- Transferring a Player using stored Variables.
The first thing we will do is create the skill.
The Skill itself is relatively simple. All you need to do is create a skill that has the effect of Common Event (on the Other tab in Effects). Common Events are basically events that are not tied to a map, found in the Database. The Common Event (select an unused one, and we will fill it in in the next section) will be what memorizes the player’s location and transfers them to the Sanctuary map. Also make sure you have the Occasion set to Only from the Menu. You don’t want Noah to be creating portals in the middle of battle!
Scope should be set to None, as it doesn’t require a target. You can set the cost as you like, but I left it at zero for my demonstration.
Now, on to the Common Event Tab!
To have the game memorize the players location, we will need to use the Control Variables command three times, using three different variables to store the Player’s X, Player’s Y, and the Current MapID.
To do this, use the “Set” Operation to put the Game Data into the selected Variable. The Player Map Y and Player Map X is under the Character selection. The MapID is under the Other radial button. By storing this information in variables, we can call it back again at a later time, specifically in this case, to take the player back to where he started.
Once you’ve done all three Control Variables commands, its just a quick simple transfer player to send them to the Sanctuary. Do this the way you would any other transfer player command, just select the space on the sanctuary map you want the player to go.
So how are we going to get back? Let’s create a transfer player event to the entrance of the Sanctuary. It should look something like this:
Instead of using the Direct Designation, select Designation with variables. This will let us use the information we stored earlier to transfer the player. Select the three variables you saved in the common event, and it will send your player right back to where he started. It really is as simple as that.
From here, you can fancy it up a bit. Maybe add some sound effects. Or even a door appearing for him to walk through. You could even use another Game Data Control Variables and a conditional branch to have the spell send the player back if he casts it while in the other dimension. Can you figure out how this would work?
There are a lot of other applications for these techniques. Can you think of any? Have any questions about the tutorial? Join us in the comments section below.