Open door command when more than one door in game?

OurJud
11 Dec 2016, 21:42

My game starts with the player at home. I have a front door called door which is set as object and/or room because I want the features tab. On the features tab I make it a container which can be opened then run a script when opened.

All this works fine.

But the next location also has a door, and I want to do the exact same thing. Trouble is I can't call it door as I already have one. I set this one up just like the other, but give it the alias of door and also stick door in the other names tab too for good measure. But when I type open door I'm told the game can't see it.

Even if call the room/object door2 and then type open door2 (just as a test, of course) the game still fails to see it.

It's like the player isn't there, but I've tested it and they are.


OurJud
12 Dec 2016, 03:49

Resolved, only I can't remember how.


XanMag
12 Dec 2016, 03:54

Ewww. =) I would make the door NOT a container. Make the door an object and just put the open verb and close verb on the door (and door1) and place a flag named 'ajar' on both 'door' and 'door1' when you open it. If necessary, you would also place an unlock (open) exit or lock (close) exit on each door object. Use an 'If' 'flag' combo in the description box for both 'door' and 'door1' and remove the flag for the close verb for both doors.

I assume both doors are actually the SAME door, right?

I do this method a lot when I have the 'same' visible door in different rooms.


XanMag
12 Dec 2016, 03:54

Dang it! Too late!


OurJud
12 Dec 2016, 16:00

No, different doors in different locations.

My head gets so fuzzled when I'm trying to get something to work, that when - or indeed if - I ever resolve it myself I have no idea what steps I took to get there.

My scripts are littered with all manner of hacks and workarounds, most of which I'm guessing wouldn't need to be there if I properly understood the workings of Quest's syntax.

I think I managed to establish that suffix such as 1, 2, 3 on subsequent doors is ignored by Quest, so long as they're not in the same room. Meaning that open door will work on objects named door, door2, door3, door4, etc, so long as they're in different rooms.

Another mistake that always trips me up is making the parent of an object another object and then wondering why I get Can't see that when I try to take it. Like last night when I placed a wooden pole in a cupboard, when the cupboard was also an object. Of course the player doesn't actually move to the cupboard, so they can't see the pole, even though I tell them they can in the description.


XanMag
13 Dec 2016, 04:10

I feel you. When I go back and work on X1, I have a hard time finding anything and wonder what I was thinking when I coded it. With practice I've gotten a bit better at organizing stuff and eliminating the weird hacks that are ALL over X1.