Hi
I have Return to Previous Room player's x y...
Now I need to Return the loop of player as it was when he left Room.
Help appreciated...
variable
Yep, just store player.Loop in room_leave..
I am not sure about actual situation you have, but if you are moving character from room A to room B with ChangeRoom command and want to keep the facing direction, since AGS 3.4.0 you can also define the direction character will have in the next room as an additional parameter. Direction ID matches loop ID, so you may do:
player.ChangeRoom(ROOM_NUMBER, player.x, player.y, player.Loop);
If it is something else you are doing, then storing parameters in room_Leave, as others suggested above.
If you need this for multiple rooms, instead of implementing room_Leave functions in every room you could write global on_event function:
function on_event (EventType event, int data)
{
if (event == eEventLeaveRoom)
{
// Save necessary parameters here
}
}