Return trouble

Hey, me again, the guy who asks all the questions.

Okay, this is a frustrating problem.

When the player levels up, I've created a skill tree, so the player can choose what skill they want.

I want to take the player from say, for example, map A, where they are when they level up, to map B, where the skill tree is, then send them back to Map A, where they initially were.

The Common Event I'm using for the Level ups: 1st line has Control Variables [0011: Elf Female level] = [Elf female]'s level
Line 2 is a Conditional Branch Switch for Warrior chosen, so the Common Event knows to take the player to the Warrior tree.
Line 3 is a Conditional Branch Variable [0011: Elf Female level] == 2
Line 4 is a Conditional Branch Switch [Level 2 reached] == Off.
Line 5 is Control Variable [0017: return map ID] = [Map ID]
Line 6 is Control Variable [0018: return x] = Player's Map x
Line 7 is Control Variable [0019: return y] = Player's Map y
Then I fadeout screen and Transfer Player to the Warrior tree map, flip a switch Return = On, and flip the Switch [Level 2 reached] On, then fadein screen.

So, this should save the map and coordinates where the player was when they level up, right?

Trouble is, it's not working correctly. The event in the skill the player selects, once they get to the Warrior tree, after the skill is granted, I have Transfer Player: Variable [0017][0018][0019] and the Return switch is set Off, but when the player is transferred, they are still on the Warrior tree, not where they were when they leveled up.

So, to summarize, I use a Common Event to acknowledge the player has leveled up, it's supposed to remember where they were and on what map they were, then transfer them to the correct level up tree, then when they select a skill, they are supposed to go back to the map they started on. What am I doing wrong?

Thank you,
James
The description of how it works is correct - so you either have made a mistake when implementing it, or the variables are used elsewhere and the correct values overwritten between the moment you store the coordinates and try to use them.
Please make screenshots of the events using alt-prtscrn instead of only prtscrn and post them here, then we can check where you made a mistake.
All right, Common Event that is supposed to take the player to the level up screen [002: Warrior tree] (37,34), and then the Event that's supposed to take them back where they initially were. Instead it deposits the player back in [002: Warrior tree] (37,34)
If it is taking you back to the warrior skill tree, that means you overwrote the values in those variables at some point after you transferred to the skill tree. Make sure you are not accidentally calling the common event when you leave, because if you are, it will do exactly as you are describing.
I don't think I am. Calling it again, I mean. I've used this in a different game before, and it worked perfectly. The only thing I'm doing differently, instead of a portal that the player has to walk on to get them back where they started, I put the same code into the event for the skill they select at level up. Nothing else is different. If I thought I could find a workaround and put a portal where the player transfers, I would, but I'm not sure how to get the player to not be able to select every skill, lol. Mainly, I want to have them get one skill per level up, then go back where they were. It's weird that it's not working. I can't figure out what's going wrong.
The only thing I can see that might throw off your event is the conditional branch that checks a specific level (2 in this case). Maybe you can find a workaround for that?

Otherwise, you could try the "portal exit" method like this: After you learn the skill, transfer the player into a square surrounded by non-passable tiles where there is a portal to click on. Basically forcing the player to exit. There are other ways too, but that might be the easiest to implement.
Otherwise, you could try the "portal exit" method like this: After you learn the skill, transfer the player into a square surrounded by non-passable tiles where there is a portal to click on. Basically forcing the player to exit. There are other ways too, but that might be the easiest to implement.

Ooo, awesome idea!
if you're always going to have that back-and-forth every time you level up, why not set up a common event and SIX variables specifically intended for use in transferring players back and forth?
level up, save position, trigger event (automatically sends to predetermined map), keep the player in map, wait for player input, trigger event again (send to previously saved position), clear reserved variables.
hell, you can even set up an event that would deal with saving and deleting the variables, so you'll only have to worry about *the condition for the triggering of the event* working correctly.
if the individual events work as intended, and the sequence doesn't work, then the problem is in the condition.
if the condition is correct but the sequence doesn't work, then the problem is the transfer event.

problem-solving 101.
@JamesdomusGames
The error is obvious from your events:
You need to disable the common event prior to the transfer and enable it again after the transfer back.
Currently it is running again as soon as you're on the level map, overwriting the values with the special map coordinates again and loosing the original return coordinates.

Additionally I suggest you add a few waitframes to it to reduce lag.
"You need to disable the common event prior to the transfer and enable it again after the transfer back.
Currently it is running again as soon as you're on the level map, overwriting the values with the special map coordinates again and loosing the original return coordinates."

I'm sorry, but that didn't work. I added Elf Female Chosen Switch = Off to the Common Event, since that is the Conditional Switch that allows that Common Event to work, and then added Elf Female Chosen Switch = On in the event where you choose the skill you want and nothing happened. No transfer at all. I added the Off switch prior to transfer and it blacked out the screen but never transferred at all.

I thought what you said would absolutely work, but it hasn't. I've tried placing the Switch Off in various spots in the Common Event, as well as placing the Switch On in various places in the Skill event, but none of those have made it work. It either leaves me on the skill tree, not even trying to transfer back, or I never get transferred there to begin with.

The way I have it here, I think the fadeout screen worked, and then nothing happened. No transfer or anything.

Thanks for your help,
James
Since it's a parallel process common event, it's going to run immediately when you turn on that switch. If you're going to turn it off, don't turn it back on until after you transfer back.
Since it's a parallel process common event, it's going to run immediately when you turn on that switch. If you're going to turn it off, don't turn it back on until after you transfer back.

I did turn the Common Event back on after the return transfer. When I turn off the Common Event before the transfer, like in the thumbnail, the fadeout works, but then nothing else happens. When I turn it off after the transfer & fadein, then when I touch the skill event, which is supposed to send me back, nothing happens.
Since I have 6 different characters to choose from, and have a separate Common Event for each of them (male & female Human, Dwarf and Elf), should I have 6 different Map IDs, Return Xs and return Ys and use a separate one for each?

For example, Control Variables [0020: Elf female Map ID] = Map ID
Control Variables [0021: Elf male Map ID] = Map ID and use them exclusively? I can't see how that would matter, since at the beginning, when the player chooses his/her character, the switch for that character (ie, Elf Female Switch = On) is the only one that is turned on. Would it still matter to have a separate Variable for each race/gender? I'm grasping at straws here, lol.
Nothing's working. The previous idea didn't work. I created a second Common Event, left the map ID and return X & Y in the parallel process CE, and Called Common Event for the second one, which did the transfer. That didn't work, either. No matter what I try, the game won't remember what screen the player was on before the level up. I might have to transfer the player back to a singluar location, (like near the fast travel map in the castle), which will make the game suck, but that's all I can think to do at this point.
I'm sure someone is going to say something about double posting lol... Just edit and add on to your last reply next time.

Anyway, did you try the portal method? Also, @gstv87 recommended assigning 3 more variables to your coordinates. That way you can have 3 to store where you came from, and 3 to store where you're going.
I'm sure someone is going to say something about double posting lol... Just edit and add on to your last reply next time.
My bad. I'm so frustrated that I'm not thinking clearly.

Anyway, did you try the portal method? Also, @gstv87 recommended assigning 3 more variables to your coordinates. That way you can have 3 to store where you came from, and 3 to store where you're going.
And I really didn't understand what gstv87 was talking about. I'm not stupid, just not as good with this kind of stuff, that's why I'm asking for help here. 😉
Your common event is running constantly. And since there seems to be no way for you to stop it without messing up your other events, try this.

Duplicate variables 36, 37, and 38 onto a new set... say 39, 40 and 41. Or whatever is open. Then save your map id and coordinates in 39-41 before you ever run any of those common events. Then, when you are ready to transfer out of the skill tree and back to where you were, use 39-41 as a reference and it should work.
Thanks for all the advice, guys.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/return-trouble.97398/