The following post is in english.
Um den deutschen Beitrag zu sehen, siehe DE 004 on LeoFinance Beta
To see older posts or posts to other topics, have a look on:
Yalunas Blog on LeoFinance Beta
Yalunas Blog in the City of Neoxian
Today we talk about a teleport-system and how the player can teleport back to the position the player used the teleport.
The easy way is to set an event with the funktion transfer player to map X on X,Y and the player will be on the position you want. To go back you can use the same funktion. But I will show you a more complex system if the player can use an item or push a button to open the teleport system and then the point is what to do to teleport the player back to the same positon he used the teleport.
At first we need a Global Event for the teleportation. I have some dungeons in my game and the player should have a choice in which dungeon the player want to go. I used more then one region and separated the dungeons each region. So in my game I neeed conditional branches to ask for 1. region and then 2. which dungeon. I set the event to parallel and set a trigger for it, because my player choice is called by a pressed button. If you like to use only an item you don't need a trigger, because you can set in the item a global event call by using the item. If you want to activate the global event by pressing a special button, you need a second parallel global event which have the condition if button ? is pressed.
I have the conditon, the choice opened by pressing a special button. but my player should not get this choice if the player is in a dungeon. So I have the conditon if the player is in dungeon or not. If the player is in a dungeon nothing will happen, if not the player will get the choise which dungeon the player want to visit. Because of my system, the player don't need to go to the teleporter and can use the teleportation on every place he is and on different maps like some houses. My player should teleport back to the positon the player used the teleporation to a dungeon. For that the game have to know where the player was. We need 3 variables for this. The Map ID, the Position X on the map and the Position Y on the map.
How you get the Map ID:
How to get the Position X and Y:
On my Global Event for the teleportation, the event have a conditional branch, how far is the story progress. My story progress counts in events with main quests. If there are finished, the player gets a bigger choice by using a dungeon. If the player teleports to a dungeon, don't forget to change the trigger for your "is the player in a dungeon conditional branch".
If the player uses the portal, the same Global Event should start.
You should know now the important things how to use a great teleport system. You can also use it, if you like to teleport the player to a map and the player use the choice where to bo by going on a special map position like on Pokemon if you use HM Fly. If the player likes to cancel the teleporation, you will need a system like this one.
See you next time Game Makers^^