Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: alec.ritchie on Mon 10/08/2009 13:52:05

Title: Setting conditions for leaving a room.
Post by: alec.ritchie on Mon 10/08/2009 13:52:05
Hello,

I'm pretty new at this whole AGS thing. I think its great that I've found a community as dedicated to old school adventure games as I am.

I'm having trouble setting conditions for my character to leave a room. I want him to only be able to leave the room if he participates in some dialogue.

All help would be greatly appreciated.

- Alec.
Title: Re: Setting conditions for leaving a room.
Post by: Mazoliin on Mon 10/08/2009 14:07:11
A simpel way would be to use a bool/int.

Create a bool in the global variables.


//And before the player leaves the room, check the bool
if (CanLeave){ //Here the bool is called "CanLeave"
  //The code to leave the room
  player.ChangeRoom(X);
}
else player.Say("I'll have to talk to the guy!");


And in the right place in the dialog, simply press tab and write CanLeave = true;