Teleporting to a Map on a key press and saving for a BACK command?

Bloodmorphed

Dungeon Fanatic
Veteran
Joined
Sep 17, 2012
Messages
1,466
Reaction score
144
First Language
English
Primarily Uses
I had an idea about a game... Well... I'm not going to go into deeeeep details, but...

I want to have the player Push a button, lets say "H" to teleport to a pre-defines Map, have that save the data from where you teleported from, and by pushing "H" again you go back to where you were.

I though this could be done by a common event but... well... IDK really.
 

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
well you can just put the char's location into variables, as well as the map its self, so you can return to that exact location, just by using those variables in the transfer event command.

If you're using the same proc to return, you'll need a condition branch beforehand.

To be exact, this:

If switch is on, turn off switch, and transfer char based on variable.

After the entire condition branch put, the char locations, and map into variables., turn on switch, transfer char to pre-defined map.
 
Last edited by a moderator:

Bloodmorphed

Dungeon Fanatic
Veteran
Joined
Sep 17, 2012
Messages
1,466
Reaction score
144
First Language
English
Primarily Uses
Hm, I'll have to try this later, Right now I'm compiling scripts I'm wanting to use. Sigh....

EDIT:

Okay, so I don't know how to save a players previous location to a variable. I also don't know how to call when the person presses a key. I'm assuming it's a script but, I have no clue.
 
Last edited by a moderator:

Bloodmorphed

Dungeon Fanatic
Veteran
Joined
Sep 17, 2012
Messages
1,466
Reaction score
144
First Language
English
Primarily Uses
Okay so I'm using yanfly's script to use a common event on pressing a key. However It doesn't have a key I want to be pressed, sadly. But oh well. 

Also, it does transfer to the hub, then without me pressing A again it tries to go to map ID 007, I don't even have a map 007, lol.

So If you press A this common event is triggered:

http://i.imgur.com/zx7QJD5.png

EDIT:

Apparently I can't use img tags on imgur no more :(

EDIT 2: NVM I just used Exit Even processing a=to do that. But still can;t seem to save the data correctly, at least the MapID
 
Last edited by a moderator:

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
Okay so I'm using yanfly's script to use a common event on pressing a key. However It doesn't have a key I want to be pressed, sadly. But oh well. 

Also, it does transfer to the hub, then without me pressing A again it tries to go to map ID 007, I don't even have a map 007, lol.

So If you press A this common event is triggered:

http://i.imgur.com/zx7QJD5.png

EDIT:

Apparently I can't use img tags on imgur no more :(

EDIT 2: NVM I just used Exit Even processing a=to do that. But still can;t seem to save the data correctly, at least the MapID
You need to turn on the switch, before you transfer the char. A transfer event command, effectively exits the event, so the switch wont be turned on.

Also you forgot to turn off the switch in the second condition branch, right before the transfer command.
 
Last edited by a moderator:

Bloodmorphed

Dungeon Fanatic
Veteran
Joined
Sep 17, 2012
Messages
1,466
Reaction score
144
First Language
English
Primarily Uses
You need to turn on the switch, before you transfer the char. A transfer event command, effectively exits the event, so the switch wont be turned on.

Also you forgot to have the switch turned off in the second condition branch, rith before the transfer command.
Uhm, doing that didn't work.

Also that didn't help my MAPID issue. It is not storing the right MapID, for some reason it is trying to send me to Map008, and I don't even have a Map008 right now. Only 001 and 002. I'm on 002 and transfer 001.

EDIT:

Never mind. I fixed all of it. Thank you for your help.
 
Last edited by a moderator:

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
Uhm, doing that didn't work.

Also that didn't help my MAPID issue. It is not storing the right MapID, for some reason it is trying to send me to Map008, and I don't even have a Map008 right now. Only 001 and 002. I'm on 002 and transfer 001.

EDIT:

Never mind. I fixed all of it. Thank you for your help.
Why do you even have 2 condition branches anyway, your event should look like this:

Condition Branch if switch on

turn switch off

transfer char based on variable

else

end

Set variable player map Y

Set Variable Player map X

Set Variable Map ID

Turn on switch

Transfer char to crafting hub map.

Recording map IDs, and such work just fine, I have a system almost exactly the same as this in my game, and there's no problems whatso ever with the map ID variable command(or any of the other commands for that matter).
 
Last edited by a moderator:

Bloodmorphed

Dungeon Fanatic
Veteran
Joined
Sep 17, 2012
Messages
1,466
Reaction score
144
First Language
English
Primarily Uses
Mine works just fine, that will just confuse me for no reason. Anyway thank you.

EDIT:

Actually doing it your way, after I transfer back to the map I was in, it then automatically transfers me back to the hub again without stopping.
 
Last edited by a moderator:

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
Mine works just fine, that will just confuse me for no reason. Anyway thank you.

EDIT:

Actually doing it your way, after I transfer back to the map I was in, it then automatically transfers me back to the hub again without stopping.
It shouldn't, but assuming you have triggured that weird thing how some commands carry over after transfering to a new map thing(I thought this only effected map events), after the transfer char command, put exit event proc.

However it still shouldn't be doing that, since your common event Isn't a autorun common event. It's most likely that blasted script your using, that's causing it to loop(either that or your keyboard is screwed up).
 
Last edited by a moderator:

Bloodmorphed

Dungeon Fanatic
Veteran
Joined
Sep 17, 2012
Messages
1,466
Reaction score
144
First Language
English
Primarily Uses
Perhaps the script, exit event proc. works just fine though so no biggy.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,072
Members
137,578
Latest member
JamesLightning
Top