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.

help with a random teleport

ok i know it sounds simple and probably is but here it goes. i have a quest that when you sleep it will at random teleport you to a dream world.  the tough part is this world can be accessed by any means of sleeping. whether they are safe at a bed in the inn or no a quest already and used a tent. what i need is for it to remember exactly where you were and put you back when you finish the quest. what would be the easiest way to do this?
 
One way is to assign a variable to each location. For example, if you're at an inn you can assign the variable to a value of 1, or if you're in a tent set it to 2.

When you're done with the dream world, just use conditional branches to check the variable, and transfer the player to the appropriate map. You'll have to remember each variable, though, but that's probably the easiest way.

Good luck with it.
 
lol thanx again regi. i kinda figured thats what i had to do but i though maybe there was a better way. Ive noticed when you say good luck its usually when its a complicated event or quest design lol. well its a good thing i asked now and not when i was almost done cause them id have to go back and edit every place you could sleep at!
 
Perhaps this would be simpler:  Make a common event for the teleport, and have it assign the map #, Player X, and Player Y to variables.  (This can be the same event that any sleeping thing can call, saving you a lot of trouble.)  Then, in the dreamworld, have whatever wakes you up just send you back to the variables that you already have stored-- it's an option in Player Transfer.

Warning:  I only own RMXP.  I have no idea if you can do this in VX.
 
Well im not home to try that but i dont think that would work. i dont think you can specify a map outside of the one you set the x y on. example. if you set the x y before you go to sleep when its time to wake up it will send you to the x y in the dream world instead of where you went to sleep.
 
No, it's a little tricky, but it works fine.  You can specify any map, and you can set the map number for the transition to be equal to a variable-- and you can make that variable the map number that you started with.

The one thing to watch out for is to make sure that it doesn't keep updating the map number after you transfer, or it'll be a one-way trip.  Precise use of switches will solve this problem, though.

This is how I'd construct a common event to send you to another room while remembering where you were.  The switch is necessary because it's parallel process-- if it was another kind of event, I don't think that you'd need it.

http://i234.photobucket.com/albums/ee10 ... rking1.png[/img]

Now, here's the event that sends you back to wherever you came from.  I've tested it, and it works just fine.

http://i234.photobucket.com/albums/ee10 ... rking2.png[/img]

So that should work just fine for you.
 
Wow... looks good... never thought about applying the map NAME to a variable... thanx!  Ill try that out but this isnt for a LONG time into my game.  Just a great idea I had and wanted to work out the bugs before I got into it.  Thanx again to you both!
 
lol well I pointed it out cause I seen sometimes where you havent posted it and other times you do.  The times you do... the issue seems to be somewhat of a complicated event system and others its just ehh.  Heck... a while back I was working on what I called The Architect which was a city building system based off events only.  Sounds crazy and the only reason I scrapped it was cause too many events on one map = big time LAG.  Otherwaise I had the whole thing pretty much built.  But again thanx for the advice!
 

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