Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: emma_north1 on Thu 16/10/2008 22:08:28

Title: Need Help With "Previous Room" From A Room Accessible From Anywhere [SOLVED]
Post by: emma_north1 on Thu 16/10/2008 22:08:28
I had found a couple of posts which tackled this issue and seemed to solve it, however they were old and used the old AGS. The solutions they provided do not work in the same way now that the scripting has changed so I need new help!

I have a room that is accessible from any other room in the game (via hotspots) and I want to make a hotspot in that one room that will return the player to the previous room. However, it seems the PreviousRoom command doesn't work in this way, or at least I don't know how to script it as whenever I choose the any click on hotspot thing it won't let me use the PreviousRoom option properly any way I try.

Is there anything I can do? If so please help!

Best regards
Emma North
Title: Re: Need Help With Getting To The Previous Room From A Room Accessible From Anywhere
Post by: Daniel_1988 on Thu 16/10/2008 22:56:08
Edit: Nevermind I see what you need.
Title: Re: Need Help With Getting To The Previous Room From A Room Accessible From Anywhere
Post by: emma_north1 on Thu 16/10/2008 23:02:38
Quote from: Daniel_1988 on Thu 16/10/2008 22:56:08
Edit: Nevermind I see what you need.
Sorry I'm not trying to be rude but what does that mean?
Title: Re: Need Help With Getting To The Previous Room From A Room Accessible From Anywhere
Post by: densming on Thu 16/10/2008 23:06:25
The character's Previous Room is automatically set when you use ChangeRoom() for the character, so, as long as the character is the same from room to room, the PreviousRoom attribute should work, by saying:


cCharacter.ChangeRoom(cCharacter.PreviousRoom);
Title: Re: Need Help With "Previous Room" From A Room Accessible From Anywhere [SOLVED]
Post by: emma_north1 on Fri 17/10/2008 00:08:18
Brilliant! Thanks very much, that works fine!