 |
faegan2 Newbie
Joined: 30 Nov 2005 Posts: 3
|
Posted: Wed Nov 30, 2005 3:52 pm
A simple way to check if there is a door in a direction |
Hello all,
I am in desperate need of your help!
In the MUD I play, The Great Hunt, we have the following syntax for exits:
[Exits: north east south west up down]
However, a room may show [Exits: north east down] while in fact there is a door to the west. I have succesfully mapped almost the complete MUD, complete with doors, but now I run into the following problem:
I want to be able to automatically open a door if I type a certain direction. Basically the simplest way I say explain is that I want a function like this:
#if (%is_door(south)) {open south}
Does a function like that exist, or is there an easy way to get the information from the DB (it needs to be FAST, I mean fast < 250ms) ?
Any help is appreciated. |
|
|
|
 |
Pseudo Wanderer
Joined: 25 Oct 2005 Posts: 99
|
Posted: Wed Nov 30, 2005 4:45 pm |
We'll need more information for your request. With the mapper open and your position marked, the mapper will substitute the "open door south" command with the south command you've entered automatically. (This can be configured in Map Preferences->Configuration->Strings and Doors). Are you trying to to this manually as you requested above, or are you trying to do this programmatically for a script? Also, will the mapper be open or closed while this action is occuring?
|
|
|
|
 |
Slaem Apprentice
Joined: 20 Sep 2005 Posts: 135
|
Posted: Wed Nov 30, 2005 9:52 pm |
Yeah. If your map contains all the doors, then the open direction command should be sent. Like Pseudo said, you may need to configure this in the Mapper under Config>Configuration Settings>Strings and Doors.
|
|
|
|
 |
faegan2 Newbie
Joined: 30 Nov 2005 Posts: 3
|
Posted: Thu Dec 01, 2005 7:03 am |
Ok, that is not what I meant.
I have all the correct settings in the Mapper. I am using SLOWWALK, so I need every step confirmed. It's for my script. The main point is that I do not want to lose any time when walking. I do not want to run the risk of "bumping" into a wall or door. Ofcourse, I can set the Mapper so that it automatically opens the door after it gets the "is closed" message from the mud, but I want my script to parse the command, prior to executing the command.
Let's say there are 3 rooms, connected like this: X --- Y --- |Z
The X, Y and Z are rooms and the | is a closed door.
In the exits syntax I will get the following:
X: [Exits: east]
Y: [Exits: west]
Z: [Exits: none]
Let's now say I am at position X. I enter the following commands: east east. What I want my script to do is actually send east, open east, east. I've already built in a simple way for a command queue and also it waits for confirmation that a certain command is processed. All I need is a way to script the "open east" when a door is closed (and locked).
Hope this explains it a bit more. |
|
|
|
 |
Slaem Apprentice
Joined: 20 Sep 2005 Posts: 135
|
Posted: Thu Dec 01, 2005 10:44 am |
Maybe I'm too tired to follow, but I'm not sure why you're mapper isn't recognizing a door and automatically openining it for you without an "it's closed" message.
I use slow walk also, and every time I move to an exit that the mapper shows to have a door, it sends "open dir" and opens the door. There's no "it's closed" message needed. In fact, it will send the "open dir" command regardless the door being open or closed. It sees a door in that direction and opens it every time.
Like I said, I may just be too tired to follow, but it sounds like a mapper configuration issue under Strings & Doors. |
|
|
|
 |
faegan2 Newbie
Joined: 30 Nov 2005 Posts: 3
|
Posted: Thu Dec 01, 2005 2:27 pm |
| Slaem wrote: |
Maybe I'm too tired to follow, but I'm not sure why you're mapper isn't recognizing a door and automatically openining it for you without an "it's closed" message.
I use slow walk also, and every time I move to an exit that the mapper shows to have a door, it sends "open dir" and opens the door. There's no "it's closed" message needed. In fact, it will send the "open dir" command regardless the door being open or closed. It sees a door in that direction and opens it every time.
Like I said, I may just be too tired to follow, but it sounds like a mapper configuration issue under Strings & Doors. |
And that is my entire point. I do not want it to send "open door" or ANY open command if the door is already open. This is because this would cause me to perform a void command, which, in a pk mud, can kill you.
I solved the problem though. I made a check between %roomlink and the exit-list I create from the mud Exit line. If the roomlink exists, and the exit is not in the exit-list, it must be a door. It'll automatically send the open command then.
Thanks for your help though. |
|
|
|
 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|