Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon Nov 22, 2010 8:09 am   

Door commands in Mapper question
 
Normally, the way to open a door in Aardwolf is with 'open <direction>'. Occasionally, there will be a door that requires a name to open, such as 'open trapdoor' or 'open gate'.

I don't see a way I can get both to work unless I start naming all my directional doors, which is a bother because I have to name it twice (one for each side of the door). With configuration settings, I can't use %1 under 'Default door name if %2 is not defined.' because CMUD doesn't recognize it. How can I set it up so that if the door is named, CMUD will open it, but if it is not, it'll open the direction instead?

Or is this a bug that needs addressing?

Charneus
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Nov 22, 2010 1:45 pm   
 
If the door is named "trapdoor", does your mud allow both "open trapdoor" and "open up trapdoor"? Or perhaps "open trapdoor up"? If so, using both %1 and %2 might work.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon Nov 22, 2010 5:39 pm   
 
Sadly, it doesn't.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Nov 22, 2010 6:10 pm   
 
All I can think of off the top of my head is an oninput trigger(s) which handles opening itself, rather than setting the autoopen stuff in the mapper. You can check %doorname() for the name of the door, if present.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon Nov 22, 2010 11:29 pm   
 
Well, for the purpose that I have the autoopen, setting an ONINPUT won't work. I generally use the map to find the shortest path to a room and then execute the run for it, so it's just one press of a button, and I move from point a to point b.

That's why I'm wondering if it should be considered a bug.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Nov 23, 2010 1:47 pm   
 
I'm not sure it should be considered a bug, since nothing in the documentation suggests that you could use %1 under 'Default door name if %2 is not defined.' However, it could be a feature request.

Are you sure the #oninput wouldn't work with commands from speedwalk? As I recall, triggers are run on those commands, or else you couldn't use an alias in a .path.
Reply with quote
Moo
Apprentice


Joined: 10 Apr 2009
Posts: 145

PostPosted: Sun Nov 28, 2010 12:33 pm   
 
You could kind of cheat, and put "open trapdoor;d" etc in the name field of the link, rather than in the door field.
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Tue Nov 30, 2010 12:51 am   
 
I haven't played aard in a while, maybe see how it reacts to open %2 %1 as the door string. If no door name is specified, you will get an extra space between open and the direction otherwise open doorname direction will be sent.
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Tue Nov 30, 2010 1:19 am   
 
If Aard doesn't like the extra space or the direction after the door name, the class below should clean up any of those problems.

Code:
<class name="open" id="12">
  <trigger type="Command Input" priority="100" regex="true" id="10">
    <pattern>open\s?\s?(\w*)</pattern>
    <value>#noinput
#t- open
#send open %1
#t+ open</value>
  </trigger>
  <trigger type="Command Input" priority="110" regex="true" id="11">
    <pattern>open\s?(\w+)\s?(\w+)</pattern>
    <value>#noinput
#t- open
#send open %1
#t+ open</value>
  </trigger>
</class>
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Reply with quote
Erasmus
Wanderer


Joined: 04 Aug 2004
Posts: 82
Location: Philadelphia

PostPosted: Sat Dec 04, 2010 6:07 am   
 
In the Door String put

Code:
open %if(%2,%2,%1)


then (this is a must) delete the 'Default Door name if %2 is not defined' altogether.

In my testing (Kingsholm), if you define a door name for the link then it will send 'open <door name> but if no door name is defined then it send open <direction>.

Haven't played around with locked doors yet, and yes you still have to assign the name to both sides of the link separately.

Inferno
_________________
Erasmus
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Dec 04, 2010 9:00 am   
 
Worked for the most part until it comes to using them in paths, particularly showing %pathfrom().

And yeah, Kingsholm (the altar) was the place that got me writing this post to begin with. Guess I'm going to need to find a way to strip it out in path.
Reply with quote
Erasmus
Wanderer


Joined: 04 Aug 2004
Posts: 82
Location: Philadelphia

PostPosted: Sat Dec 04, 2010 4:56 pm   
 
Yeah, you're right. I tried playing around with it this morning, but couldn't find a simple answer.
_________________
Erasmus
Reply with quote
mose
Novice


Joined: 02 Dec 2010
Posts: 30

PostPosted: Tue Dec 21, 2010 10:21 pm   
 
I have the same problem. There is a gate that is closed. CMUD should send "open gate" followed by "n". Instead, it sends "open n;n". If I put "gate" in for the door name, it sends "open n;gate". I used the trick described above and put "open gate;n" in the name field. CMUD now sends "open n;open gate;n". The first open fails, but the second succeeds. What is the right way to do this, or is this a bug?
Reply with quote
mose
Novice


Joined: 02 Dec 2010
Posts: 30

PostPosted: Tue Dec 21, 2010 11:52 pm   
 
I answered my own question. I was trying to do everything from the room properties. I went to the map properties, instead, clicked on "Strings and Doors" and used "open %2" and left "Only send door command, do not send direction" unchecked. It works like a charm. It now sends "open gate;n" as expected.
Reply with quote
Anaristos
Sorcerer


Joined: 17 Jul 2007
Posts: 821
Location: California

PostPosted: Thu Dec 23, 2010 12:19 am   
 
When I encountered this problem I solved it in a a rather primitive way that has proved effective thus far:
Code:

<alias name="odproc" id="1117">
  <value>open %if( %2 == "door", %1, %2)</value>
</alias>

I substituted the above alias for the open command in the map properties dialog box.

For it to work properly, the name of the door must be inserted in the room properties dialog box. After this is done, the name of the door will be available to the alias. If a door name is provided (something other than "door") it is used as part of the open command, otherwise the direction is used.

To install, click on Edit|Map properties then select Strings and Doors. In the top box insert odproc %1 %2. In the second box insert unlock %1;odproc %1 %2.
_________________
Sic itur ad astra.
Reply with quote
mose
Novice


Joined: 02 Dec 2010
Posts: 30

PostPosted: Thu Dec 23, 2010 2:10 am   
 
That's clever. I like that idea.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net