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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
mj_cole
Wanderer


Joined: 19 Apr 2001
Posts: 59
Location: USA

PostPosted: Mon Jul 14, 2003 3:14 pm   

Detecting if an exit is already open.
 

Is it possible to easily detect if an exit is already open, and then not send the open command.

Speciffically there is an exit in sneezy that has the same command to open as close "pull branch" so if it's open, I close it, and have to then open it again.

The exit line dosn't show exits that are closed.

eg
Exits [N S E] - with the door to the west closed.
Exits [N S E W] - with the door open.

Secondly, I have to raise a port cullis, my work around is to set the door name to "; raise port" and I always get the error (from the mud) open what. Any fresh ideas.

Regards
Marts
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Mon Jul 14, 2003 11:01 pm   
 
I suggest using the door name field for special exits like the branch and portcullis. By changing the open commands in the "Strings and Doors" page of the mapper configuration to:
#IF ("%2"!="") {%2} {open %1}
you can simply enter the appropiate command as the door name.

Detecting whether a door is open is extremely simple, because your mud simply leaves that exit out of the when when it is closed.
#TR {^Exits ~[(*)~]$} {#VAR ExitLine %replace("%1"," ","|"}
now we revisit the open command within the mapper and see if the exit was present when entering the room.
#IF (%ismember(%1, @ExitLine)=0) {#IF ("%2"!="") {%2} {open %1}}
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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