Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Wed 02/03/2005 17:53:50

Title: Doors and Walkable Areas
Post by: on Wed 02/03/2005 17:53:50
 ???

I have read a lot of info on the forums about opening/closing doors and turning on/off the walkable areas after the door has opened/closed so the character can/can't get to another room. I understand the walkable areas part, found what I was looking for for the door animating and have almost got that down...BUT...I'm having a little trouble with something else.

Let's say that the now open door covers part of the original walkable area of the room when the door was closed. When I want to walk to that area, my character passes through the door. Do I need to make the walkable area behind the now open door a separate walkable area so that if the door is open, he will walk around it instead of passing through it? And then, if he closes the door again, restore the walkable area that the open door now no longer covers?

Thanks in advance.
Title: Re: Doors and Walkable Areas
Post by: Scummbuddy on Wed 02/03/2005 21:02:18
is it possible to not have that area walkable to begin with? that would make this problem very easy. by not having the swinging area walkable then it would bypass your problem. Whatever you have behind that door, it may not be realistically placed there. Say if you have a store, you may not have items to purchase behind where an open door would be, for saftey reasons, for fear-of-breaking reasons, and so on.
Title: Re: Doors and Walkable Areas
Post by: on Wed 02/03/2005 21:18:11
Well actually, I solved the problem... I just created 3 walkable areas. When the door is closed you can walk in the area behind it. After it opens, I disable the little walkable aread behind it and enable the new area in the doorway. This keeps my character from passing through the door but now allows him to enter the doorway to the next room.

NOW I am having the problem of getting the door to close again. I got the door to open easily using no manual scripting just the drop down menus in the interact with object window. So when the character clicks on the door, it opens. But I want the player to have the option of closing it too! Someone please help me with this - this is the first thing I have really been stumped on!

I have object 0 (named "door" which is the closed door sprite), over a doorway in my very first room. You click on it, it runs my 8th loop, in view 2, and opens up (just 3 simple frames - closed, halfway open, all the way open). Now how do I make it so that when you click on it in the open position, it will close? I've searched high and low in the manual - which is terrible by the way about "getting to xxx later" and then never does; and searched the message boards but cannot find a solution that will work for me.

Help!
Title: Re: Doors and Walkable Areas
Post by: on Mon 05/02/2007 22:09:26
would you be able to make two different outcomes for interation with door object by making one for one variable (0=closed) and one for the other variable (1=open)?

like when the door becomes opened, it sets doorvariable to 1, when it is closed it is set to 0, and each reference it's opposite? I'm not sure if I'm making clear sense.
Title: Re: Doors and Walkable Areas
Post by: Scummbuddy on Mon 05/02/2007 22:34:44
Are you wanting to do some sort of "If statement", as if

If (dooropenvariablename) returns a certain value
{
Let a character say something different. - or -
be able to pick up an inventory item - or -
something else
}
-----------------
If so, take a look in the ags manual/help file for if and if else statements.