Making teleport item that checks for visited towns?

Hi, here is how the item works.


As you explore the game, entering any town activates a switch for that town.  This allows you to view that town's name as a teleport option via use of a teleport item.


If you have towns A, B, C.  You can visit them in any order, but you can't teleport to any until you've "visited" them before(or activated their switch).


I know for sure this would use a common event to be called by the teleport item, but when I try using multiple conditional branches to check for each of the specific switches for all towns and possible visited orders, it gets extremely complicated and makes the item not function properly.


This is where I am kinda stuck with creating this item.


It works fine when a player has visited all 3 towns already since that's the first conditional branch I set(to check for town A, B, and C).  But not when a player visited only town B, or Town C and A only, etc.


I know I can do this easily where it  lists all the town names, and if you try teleporting to that town it checks for the switch being activated, the problem with this is it "spoils" the town's names, which I want to avoid.  I'm not sure if there's something I may be doing wrong with the conditional branches since I put them in the order from all towns' switches being activated first, as mentioned above.
While I don't know anything about teleporting to different towns with one item, I know plenty about teleporting to many places with a map.


You could have an item with a common event that teleports you to a map labeled as NEXUS, wherein you see multiple objects/portals that teleport you to specific towns.


For each place you visit, do an autorun where it activates a switch, like TOWN 1 VISITED, whereupon an event with that switch will appear as a portal to teleport your character to that town.
With just eventing, I believe conditional branches are the way to go... which is really uncomfortable.


Diretooth's idea is great, but instead of a "Portal Room-Nexus-thing", you could have a map?


You know, like when you use Fly in Pokémon.


areanavmap.jpg



You can set so you can only visit and see the name of the places you visited and you might want to change the player's graphic to a pointer or something similar.


And if you decide to cancel, you'd need to have the initial X, Y and map ID saved to variables before you activate the item, so you can get teleported back.


Edit: Wavelength has just the correct way out, however, things might get more complicated if you need more than 3 teleports.


My suggestion was more suitable if you need a high quantity of them.
If Visited Town A


..If Visited Town B


....If Visited Town C


......Show Choices: A, B, C


....Else


......Show Choices: A, B


....End Branch


..Else


....If Visited Town C


......Show Choices: A, C


....Else


......Show Choices: A


....End Branch


..End Branch


Else


..If Visited Town B


....If Visited Town C


......Show Choices: B, C


....Else


......Show Choices: B


....End Branch


..Else


....If Visited Town C


......Show Choices: C


....Else


......Show Message: You haven't visited any towns yet


....End Branch


..End Branch


End Branch
With just eventing, I believe conditional branches are the way to go... which is really uncomfortable.


Diretooth's idea is great, but instead of a "Portal Room-Nexus-thing", you could have a map?


You know, like when you use Fly in Pokémon.


areanavmap.jpg



You can set so you can only visit and see the name of the places you visited and you might want to change the player's graphic to a pointer or something similar.


And if you decide to cancel, you'd need to have the initial X, Y and map ID saved to variables before you activate the item, so you can get teleported back.


Edit: Wavelength has just the correct way out, however, things might get more complicated if you need more than 3 teleports.


My suggestion was more suitable if you need a high quantity of them.

Yes, I actually have over 15 locations to be teleported to so this is a much better idea.  I created the map, variables, etc. now I have 2 issues.


One is when the player selects "cancel" the game acts as if they just choose not to teleport thereby keeping them stuck on the map until they select a town.  I made the variables of the player's x/y and map id, however, I'm not sure exactly how to "save" it, so the game knows to return the player to their original position when using the item(if canceling). 


The other is that I selected a random location on the map for the player to start looking where to "teleport", except I think it'd be better if they appear on the map "near" where they activated the item.  I'm guessing this involves the map id, etc., so


Aside from that, everything is fine.  The autorun events I have set in each town work with the conditional branches, etc.


Alright, so I figured out I needed to add the following to the "cancel teleport" option.


*transfer player by variables X,Y, and map id that were previously saved via the common event, and other stuff like changing the player's graphic, etc.


Still wondering how to set specific teleport locations to "match" the world map.  For example if I use the item outside town B, on the world map, when I use the item to teleport it puts me right outside town B.
Still wondering how to set specific teleport locations to "match" the world map.  For example if I use the item outside town B, on the world map, when I use the item to teleport it puts me right outside town B.

You could set so every time you enter a map, an event sets a variable to a certain number. Each number represents one tile on your "map".


There should be a buuunch of conditional branches to check for that number and assign to the correct spot.


Okay, that sounds bad, so I decided to dedicate 5 seconds into a concept:


ccDtp95.png



Here you see the real maps in HD. Once the players enter Depressive Town, an event sets "variable E" to 4. If he uses the item there, it'll have conditional branches with all needed values. Once he hits 'If "variable E" is 4', that'll be true and he'll be set to teleport to the corresponding tile in the smaller map. Depending on the size of your "TP-map", it'll be a lot of branches, but this way you could also set so when "variable E" is "0", you can't TP at all (maybe inside a dungeon). I hope you can understand this mess. Also, please tell me if there are any more efficient ways to do this.
You could set so every time you enter a map, an event sets a variable to a certain number. Each number represents one tile on your "map".


There should be a buuunch of conditional branches to check for that number and assign to the correct spot.


Okay, that sounds bad, so I decided to dedicate 5 seconds into a concept:


ccDtp95.png



Here you see the real maps in HD. Once the players enter Depressive Town, an event sets "variable E" to 4. If he uses the item there, it'll have conditional branches with all needed values. Once he hits 'If "variable E" is 4', that'll be true and he'll be set to teleport to the corresponding tile in the smaller map. Depending on the size of your "TP-map", it'll be a lot of branches, but this way you could also set so when "variable E" is "0", you can't TP at all (maybe inside a dungeon). I hope you can understand this mess. Also, please tell me if there are any more efficient ways to do this.

Hmm yes I see how this could work.  I'll have to have all of the info. on the variable set on the common event page. Thanks for the graphic btw.


So while on the common event page, that is where all of the conditional branches are to check for the variables. THEN it teleports the player to the map to select where to teleport based on their specific location/variable. I think I've got this understood? I'm working on multiple things at the moment.  I'll check on this sometime later.

Original thread: https://forums.rpgmakerweb.com/threads/making-teleport-item-that-checks-for-visited-towns.66072/