Need Help With "Previous Room" From A Room Accessible From Anywhere [SOLVED]

Started by emma_north1, Thu 16/10/2008 22:08:28

Previous topic - Next topic

emma_north1

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
Emma North

Daniel_1988

Edit: Nevermind I see what you need.

emma_north1

Emma North

densming

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:

Code: ags

cCharacter.ChangeRoom(cCharacter.PreviousRoom);

emma_north1

Emma North

SMF spam blocked by CleanTalk