Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

How do i make like a "Recall Potion"?

Like some games there are some items that allows you to return to the nearest town and afterwards return to the spot you were currently at, like in a dungeon. From The Dungeon to Town and then return to the same spot back in the dungeon. Is it possible?

And where it returns only to the nearest town and not a town from like 100 miles away. But only to the nearest town.
 
Make a recall potion item and link it to a common event. When you enter a town, set 3 variables called player x and player y and map id to those specifics. Then in your common event set the item to transfer player to those variables. That way, what ever town you entered most recently will have the variables set, and will automatically be the one you jump to.

The event to set the variables should look like this.

Event Name - Set Recall Coordinates
Parallel Process
@>Control Variables: [0001: MAP ID] = Map ID
@>Control Variables: [0002: PLAYER X] = Player's Map X
@>Control Variables: [0003: PLAYER Y] = Player's Map Y
@>Erase Event

Put this event in every town. You want to use erase event so it will only set them once each time you enter this map. This event will respawn every time you enter the map, but it will set no matter where on the map you enter, so if you go in and out of buildings with seperate maps in that city, it will keep resetting the coordinates. If you want to avoid this, you could tie the event to an action, like staying at the local inn, or speaking to the town priest.

The recall common event should look like this.

Common Event - Recall Potion
Trigger None

@>Transfer Player:Variable [0001][0002][0003], Down

Then just make sure your item is linked to your common event. This should work just fine. If not, let me know.


-Rob
 
You're missing something though. He wants to return back to the dungeon, like a scroll of town portal.

Set up a few vars: [0001: d.Map ID], [0002: d.X], [0003: d.Y], [0004: inn.Map ID], [0005: inn.X] and [0006: inn.Y]. Also, make a switch [0001: Recalled?].

Now make an item called Recall Potion, non consumable. Link it to a common event.

http://img116.imageshack.us/img116/4361/recallio8.gif[/img]

You must make the item non consumable, so that it's only consumed when you return back to the dungeon. You can impose a few restrictions using the Recalled? switch, such as not being able to use inns/talk to NPCs/leave town or whatever else you choose do.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top