Player Transfer limited to 3 options

Hello, I need variables to track MAP ID, X, Y & Direction my character his facing, however, you can only choose 3, I'm missing direction. Can someone help me with the script needed? I found this: $gamePlayer.reserveTransfer(mapId, x, y, direction);

But, when putting it into my map it crashes saying the map id is not defined. Thank you in advance as always.
Player Direction can be grabbed from "Control Variables >Game Data>Character"
Not sure if I fully follow, sorry!
1718662716001.png
I may have misunderstood. Sounded like you were looking to put direction into a variable.

Setting direction by variable isn't needed. You can set the direction directly using the "Direction" drop down box in your screenshot.

Just fyi:
The screen you posted has nothing to do with tracking any of those variables. That window is for doing the actual transfer command and is using those variables to determine destination, not putting those values into variables.

IF, you need to set direction via variable, you'll need to use control variable as per my first reply, and conditional branches after the transfer is done.
Or Google the script call for Transfer Player and incorporate the variables' values into that.

But I think you'd be better off sticking to event commands as much as possible.
Thank you both! I need to save the direction because 'retaining' doesn't work, since the map that they transfer to is a scene where they are walking, meaning the direction will always be 'right' unless I save that info in a variable like I did with the x,y,map ID.

So, I have a var to go off when something happens, then a common event plays, saving the characters exact position, then they are transferred to another map, where a scene plays & then the 'transfer player designated with variables' is used to put them back where they were only now, lol they are always facing right!

I would love love love to stick with the event commands 100% but since it's limited to 3 vars, I can't save the direction the character was originally facing before they we're transferred.

I already googled the script, first thing I did, I just struggle with implementing it. For example: $gamePlayer.reserveTransfer(mapId, x, y, direction);

I believe with this script...if I put any number in the mapID area it's just the map id, not the one saved by the variable. I'll try to add some more screenshots to show what I'm talking about! Thank you guys again. Apologies for struggling with this.

1718716105732.png
1718716134448.png
1718716299928.png
I believe with this script...if I put any number in the mapID area it's just the map id, not the one saved by the variable.
I don't really understand what you're saying you're confused by, and none of the screenshots in your last post show how you're trying to use the script call.

If you Google the script call for a variable's value, it's $gameVariables.value(ID) (no leading zeros on the ID).

So you would put that for each of the four numbers in the reserveTransfer() call, using the appropriate variable ID each time.
I'm not using the script call because I don't know how to, I'm trying to place the script call to replace: Transfer Player : {Map ID} ({Player X}, {Player Y}) which you'll see in the screenshot.

I think I understand what your saying now though! Thanks for trying to help me understand. So something like this:

$gamePlayer.reserveTransfer($gameVariables.value(2), $gameVariables.value(3), $gameVariables.value(4),$gameVariables.value(26));

Or like this?

$gamePlayer.reserveTransfer(2, 3, 4, 26);

Oh, gosh or maybe like this???

$gamePlayer.reserveTransfer_$gameVariables.value(2, 3, 4, 26);
JavaScript:
let mapId = $gameVariables.value(4);
let x = $gameVariables.value(5);
let y = $gameVariables.value(6);
let dir = 2;
let fade = 0;
$gamePlayer.reserveTransfer(mapId,x, y, dir, fade);
like this as scriptcall.
You guys are wonderful, thank you! My best friend helped me too! I didn't want to originally ask her for help since I'm making the game for her lol and I don't want her to have any spoilers!

But I was so confused I caved. These things are very confusing for me but I do my best.

This is the code she provided which does the same thing you did ShadowDragon, only it also saves the direction variable too. I'll share it here to hopefully help someone else who might be struggling with this!

var mapId = $gameVariables.value(2);
var x = $gameVariables.value(3);
var y = $gameVariables.value(4);
var direction = $gameVariables.value(26);

$gamePlayer.reserveTransfer(mapId, x, y, direction, 0);
1718720220910.png
1718720274546.png
This is the code she provided which does the same thing you did ShadowDragon
You don't need any of those extra lines and variables. That's doing the exact same thing that you typed the first time in your previous post (which is what I told you to do in my previous post).

So you would put that for each of the four numbers in the reserveTransfer() call, using the appropriate variable ID each time.
Code:
$gamePlayer.reserveTransfer($gameVariables.value(2), $gameVariables.value(3), $gameVariables.value(4),$gameVariables.value(26));

None of the other things you got anxious and spouted out in that post are following my instructions. (and you apparently never tested it? I dunno 😛 )

You do need to specify the last value for fade type, so adding the , 0 after the last variable.

Good luck with your project!

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/player-transfer-limited-to-3-options.169594/