Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: iamlowlikeyou on Thu 27/01/2011 12:55:52

Title: LastRoomWas or something similar?
Post by: iamlowlikeyou on Thu 27/01/2011 12:55:52
I have a room that is reachable from several other rooms, but I'd like to to set different actions in function room_load() depending on which room player came from...

Is there a way to get which room player left to get to the current room?
Title: Re: LastRoomWas or something similar?
Post by: Gilbert on Thu 27/01/2011 13:11:45
You can use the player.PreviousRoom (http://www.adventuregamestudio.co.uk/manual/Character.PreviousRoom.htm) to check the player's last visited room.
Title: Re: LastRoomWas or something similar?
Post by: Gudforby on Thu 27/01/2011 13:13:13
You can use the Character.PreviousRoom command

if (cEgo.PreviousRoom == 1)
{
 //action
}

EDIT: arghh... beaten... :P
Title: Re: LastRoomWas or something similar?
Post by: iamlowlikeyou on Thu 27/01/2011 13:35:52
Ah, I couldn't find it...
That's exactly what I was looking for, thanks! :D