Page 1 of 1
Doors, directions, etc.
Posted: Tue Dec 03, 2002 4:44 pm
by Ice Cream Jonsey
Not that I am trying to get anyone to do my dirty work for me, but this is one of those things that I think I have just plain forgotten: is there an easy way to get the following to happen:
Code: Select all
You are in a room. There is a door to the north.
>north
(Opening the door first)
North Room.
You are in the north room. There is a door to the south.
Basically, the bit I am concerned with is the whole "go north" and then have the door (which is perfectly accessible through normal door means) routines kick in. This is probably a ridiculously easy effect to get, right? I am having no luck figuring out just how to do it.
Wait
Posted: Tue Dec 03, 2002 7:40 pm
by Kent
Doesn't the basic door class in objlib.h do what you want?
Re: Wait
Posted: Tue Dec 03, 2002 9:17 pm
by Ice Cream Jonsey
Kent wrote:Doesn't the basic door class in objlib.h do what you want?
I took a look at that, and by all rights it definitely should. I basically have a room setup like this:
Code: Select all
LightRoom Store "Store"
{
long_desc
{
"Blah blah. There is a door to the south"
}
s_to
{
Perform(&DoGo,BackOffice_door)
}
}
And I have the door setup like this:
Code: Select all
door BO_Hall1_door
{
nouns "door" "hall" "office"
adjective "hall" "back"
article "the"
between Store, BackOffice
is static, not open, not locked
}
When playing through the game, if I type ">south" in the Store room there I get an out of memory error.
I should come completely correct: in the real code that I am using, I do have some Before routines in the door itself to give a custom message for opening said door which I have not included here. My next step is to rip those out and see what happens. But the whole &Perform DoGo thing ought to punch over to the door and run through it's ">enter door" routine, correct?
I have a feeling this is going to embarassing when I realize what I overlooked or did wrong. If I slink out of this thread with a gimmick handle, you'll know it's me.
Here's what it may be
Posted: Wed Dec 04, 2002 3:46 am
by Kent
Try:
in your room direction and see where it gets you. I think by explicitly calling Perform(&DoGo) you're probably entering a recursive spiral. The door class's door_to property handles messages, opening and closing, and returning a valid room (if applicable), assuming you've set the 'between' property for the door up right.
Re: Here's what it may be
Posted: Wed Dec 04, 2002 1:48 pm
by Ice Cream Jonsey
Kent wrote:Try:
in your room direction and see where it gets you. I think by explicitly calling Perform(&DoGo) you're probably entering a recursive spiral. The door class's door_to property handles messages, opening and closing, and returning a valid room (if applicable), assuming you've set the 'between' property for the door up right.
Just plugged it in -- worked like a charm & was magically delicious. Thanks!