Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: miguel on Sun 15/06/2003 12:47:02

Title: last room visited variable?
Post by: miguel on Sun 15/06/2003 12:47:02
hi there,
 I have a central room where all other rooms are acessed from there,
 what I want to know is if there's a way I can know what was the last room EGO visited,
 "If player has been to room" doesnt work because after a while the player has been to every rooms so if I make a "if" sequence it just counts the last one,

  I think I'll have to assign global ints to all the rooms and have them checked when EGO enters the central room, (the reason I need to know where EGO was is of positioning matters(x,y)),
   Is there an easier way or a diferent way of doing it?
thanks
   
Title: Re:last room visited variable?
Post by: Scorpiorus on Sun 15/06/2003 13:05:43
There is character[CHARID].prevroom variable you can apply.

if (character[EGO].prevroom == 4) {......}

-Cheers
Title: Re:last room visited variable?
Post by: miguel on Sun 15/06/2003 13:09:13
great, thanks again Scorpioros! :)
Title: Re:last room visited variable?
Post by: TerranRich on Mon 16/06/2003 16:15:18
Yes, I too have such a central room (an elevator, in my case), and if it weren't for the prevroom variable, I would've had to code it myself.  :o

:)
Title: Re:last room visited variable?
Post by: miguel on Mon 16/06/2003 23:42:33
yep, I was getting a bit frustrated but that "simple" variable will solve the case!!! :)