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

● ARCHIVED · READ-ONLY
Started by Bloodmorphed 10 posts View original ↗
  1. 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.
  2. 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.
  3. 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.
  4. 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
  5. Bloodmorphed said:
    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.
  6. Zoltor said:
    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.
  7. Bloodmorphed said:
    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).
  8. 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.
  9. Bloodmorphed said:
    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).
  10. Perhaps the script, exit event proc. works just fine though so no biggy.