Diablo Style Town Portal Scroll

Hi, people! I've got another question. Is there a way to make a character use an item to teleport himself to an specific map and then he can use it again to go back to the place where he was before. Do you guys think it's possible to do it without scripts?
Sure it is possible without scriptt!


You will need just few free variables. Basically - Make two pages, one with condition for variable A is 0 and second for it being 1 (for example).


Than on the first page:


(Edit note - As it's item, not event, in place of pages, place conditional branches checking for variable and the whole thing place into Common Event, than make the item trigger the event)

  • Store players X into variable
  • Store Players Y into another variable
  • Store Maps ID into third variable
  • add item into inventory (scroll)
  • set variable 'A' to 1
  • Transfer player

Then on the second page:

  • add item to inventory (scroll again, if you don't want it to dissappear)
  • set variable 'A' to 0
  • Transfer player to X, Y, and Map ID from the variables

So, that should be it!
Than on the first page:

  • Store players X into variable
  • Store Players Y into another variable
  • Store Maps ID into third variable
  • add item into inventory (scroll)
  • set variable 'A' to 1
  • Transfer player

Then on the second page:

  • add item to inventory (scroll again, if you don't want it to dissappear)
  • set variable 'A' to 0
  • Transfer player to X, Y, and Map ID from the variables



I fixed it up a bit because Araraf was working on the assumption it was an event at first. Here is what I came up with (using Araraf's idea):


Conditional Branch: Variable [0044: TeleUsed] == 1


      Transfer Player: Variable [0043][0041][0042]


      Change Items: [Skill Token], - 1        <---- Set this to whatever item you are using.


      Control Variables: [0044:TeleUsed] = 0


:  Else


      Control Variables: [0043: Map ID] = Map ID


      Control Variables: [0041: Player X] = Player's Map X      <-------- These three variables will capture the spot you used the item from.


      Control Variables: [0042: Player Y] = Player's Map Y


      Transfer Player: [002: Map002] (011, 018)              <--- This is where you want your player to teleport to, like "Town" in Diablo.


      Control Variables: [0044: TeleUsed] += 1


Branch End


You will put all this into a Common Event.


Then on your Item under Consume, mark "No" and make the Item Type "Normal". This little bit of eventing will act just like a Diablo Portal Scroll. You will use your item once and it will teleport you to wherever you set it to (like the Town) and the item will still be in your inventory. When you use the item again, it will teleport you back to the spot and delete one(1) of the items.


Again, credit should go to Araraf, as he had the right idea. 😀  
Folks, you are awesome! Both of your names go into my game's credits <3 . I'm loving you guys too.
Thanks, buddy! A game credit?! Awww, shucks! Thanks so much!
Aw, don't do that to me ;D But thanks ;D

Original thread: https://forums.rpgmakerweb.com/threads/diablo-style-town-portal-scroll.60316/