Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: barefoot on Fri 26/03/2010 18:35:59

Title: Returning to Previous / Last Room Player was in
Post by: barefoot on Fri 26/03/2010 18:35:59
Hi

I have a 'Room' (actually a symbols chart) that the player can acess from any room by clicking a text hotpot, so I am trying to find latest Code to return player to the very last room he was in. I don't want to have to create lots of the same room.

I checked out PreviousRoom property etc but thats not whatI'm looking for.

any help would be appreciated.

barefoot

Title: Re: Returning to Previous / Last Room Player was in
Post by: Khris on Fri 26/03/2010 19:03:44
How is it not?
  player.ChangeRoom(player.PreviousRoom);
Title: Re: Returning to Previous / Last Room Player was in
Post by: barefoot on Fri 26/03/2010 19:14:00
Quote from: Khris on Fri 26/03/2010 19:03:44
How is it not?
  player.ChangeRoom(player.PreviousRoom);



Because all I found in manual under PreviousRoom was:


Display("EGO's previous room was %d.", cEgo.PreviousRoom);


just shows a display....

Cheers anyway Khris

barefoot
Title: Re: Returning to Previous / Last Room Player was in
Post by: JD on Fri 26/03/2010 19:17:31
The entry in the manual is just an example of how PreviousRoom can be used. Khris´ code is just what you need  :)
Title: Re: Returning to Previous / Last Room Player was in
Post by: Matti on Sat 27/03/2010 15:21:04
A variable is a variable, no matter which way it's used. Many examples in the manual contain the display command, don't let that confuse you.