Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Wed 10/11/2004 21:29:18

Title: doors
Post by: on Wed 10/11/2004 21:29:18
may sound silly but ive read through the basic manual but how do you 'lock' doors
Title: Re: doors
Post by: Scummbuddy on Wed 10/11/2004 21:43:12
dont allow the object to be turned on/off, nor allow the person to pass through or go to the next room? you can turn off walkable areas too, but without any information about the room design, or exactly what you mean, we can't help.
Title: Re: doors
Post by: on Fri 12/11/2004 18:01:33
sorry
the room is just a simple corridor but theres no fun in just walking to the next room i want them to gain acess by entering a code they have found out from another charecter
Title: Re: doors
Post by: Edwin Xie on Fri 12/11/2004 19:31:26
Ok.... it has to be something like this:
Include in the dialog in where you find out the code from another player:

set-globalint 27 1

Door script:

if (GetGlobalInt(27) == 1){ //If you know the code display a message and go through the next door
Ã,  Display("You type in the code in the keypad at the right and you go through the next door");
Ã,  NewRoom(THEROOMOFTHENEXTDOOR);
Ã,  }
else if (GetGlobalInt(27) == 0){ //You don't know the code and you can't get past the door
Ã,  Display("The door is locked and you don't know the code");
Ã,  }

Note: Since I don't know which room is the room you go through when you entered the passcode, you change "THEROOMOFTHENEXTDOOR" to the room you want to go to when you entered the code.
Title: Re: doors
Post by: on Fri 12/11/2004 21:03:36
thanks its my first game so i wasent sure