Return room player loop

Started by Slasher, Thu 05/10/2017 09:06:36

Previous topic - Next topic

Slasher

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...


Khris


Matti

Yep, just store player.Loop in room_leave..

Crimson Wizard

#3
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:
Code: ags

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:
Code: ags

function on_event (EventType event, int data) 
{
    if (event == eEventLeaveRoom)
    {
        // Save necessary parameters here
    }
}

SMF spam blocked by CleanTalk