Problem with walkable area and door.

Started by , Sat 01/05/2004 20:48:33

Previous topic - Next topic

Michael

Howdy. I'm very new to AGS and I'm having a slight problem. I have a door object that swings open revealing a hallway when interacted with. The hallway is a walkable area, but my character can walk through the door even when it's closed. I'm just wondering how I could make the area behind the door not walkable until the door is open. Thanks in advance.

Farsight

What you have to do is have one walkable area in front of the door that is turned on and behind the door is another walkable area which is turned off. When you open the door put some code or an interaction in to turn on the back walkable area and you are fine. Then you just turn on and off the walkable areas to get your effect. Hope it helps!
Guess who's back??

goodcleanfun

#2
Hey. Thanks. I understand everything you're saying, but I have no idea how to do it. My scripting skills are very low.  :-\

Okay I made it so that when I interact with the door it runs a scipt and in the script i put:

RestoreWalkableArea(2); //2 being the number of the walkable area.

But my problem is I don't know how to start the game with the walkable area turned off.

Ishmael

Player enters screen -> run script -> DisableWalkableArea

do check if the door is open, so you don't disable the wa when it is...
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

goodcleanfun

#4
Quote from: TK on Sat 01/05/2004 22:13:14
Player enters screen -> run script -> DisableWalkableArea

do check if the door is open, so you don't disable the wa when it is...

I can't find anything that says "player enters screen". And what script would I put that in? The door object script? and Would I put it under "interact object"?

Nevermind. I got it. Sorry for being an idiot and thanks!

Ashen

The command is RemoveWalkableArea(), not Disable, and the 'player enters screen' script is in the room script ('Settings' window, button with a red 'i').

You'll also need to put it in the object interaction, if you can close the door again.
I know what you're thinking ... Don't think that.

Ishmael

#6
Player enter screen can be found in the room interactions, the I button in the room editor, I think. The Player enters screen (you can chooose either one, befofe fadein or after fadein, as it doesn't matter in this case) script would be:

if (isdooropen == 0) {
Ã, Ã, RemoveWalkableArea(1); // replace 1 with the correct wa number
}

and the object interaction code would be:

if (isdooropen == 0) {
Ã, Ã, // door opening animation/whatever code here
Ã, Ã, RestoreWalkableArea(1);
Ã, Ã, isdooropne = 1;
} else {
Ã, Ã, // door closing code here
Ã, Ã, RemoveWalkableArea(1);
Ã, Ã, isdooropen = 0;
}

and add to the start of the room script (the "{}" button in room editor):

int isdooropen;

that should work... hope I didn't miss anything.

----- EDIT -----

fixed it a bit, thanks Ashen.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

SMF spam blocked by CleanTalk