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
Eowyn
Apprentice


Joined: 19 Jan 2001
Posts: 117
Location: Norway

PostPosted: Thu Aug 05, 2004 8:31 am   

Script to rename all unnamed doors?
 
I need a script that renames all my _unnamed_ doors (i.e. door connection made but no specific door name given) to woodendoor. Any suggestions?

Thx :)
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Aug 05, 2004 9:31 am   
 
Set a default doorname in your mapper configuration. Then the mapper will automatically use this when the name is blank. It can be set in the section "Strings and Doors".
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Eowyn
Apprentice


Joined: 19 Jan 2001
Posts: 117
Location: Norway

PostPosted: Sat Aug 07, 2004 12:54 am   
 
I'm using this script to quickly open and close doors. However it only works on doors I've named. This is why I want to give ALL the doors a specific name.

#var doorn %doorname( , n)
#var doors %doorname( , s)
#var doorw %doorname( , w)
#var doore %doorname( , e)
#var dooru %doorname( , u)
#var doord %doorname( , d)
#if (@doorn!=%null) {open @doorn}
#if (@doors!=%null) {open @doors}
#if (@doorw!=%null) {open @doorw}
#if (@doore!=%null) {open @doore}
#if (@dooru!=%null) {open @dooru}
#if (@doord!=%null) {open @doord}

Is it doable to make a function that flips through the vnums, checks for doors, if doors present, check that they all have a name, if not, call em door?

Thx!

E
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Aug 07, 2004 11:41 am   
 
There really isn't a check for doors beyond the check for doorname's. It is a small flaw in the scripting system. In order to overcome it a script would have to ask the mapper to generate a %walk string through each exit of a room and then examine that string for the 'open' command. The complexity of such a script is the reason why I said use the default system, however %doorname doesn't pickup the default. If you have Access on your system I would suggest you tinker about with it to produce a query that can update all your links appropiately. Barring that a pseudo-script would be something like:

#LOOP %numrooms {
#FORALL %roomexit(%mapvnum(%i)) {
#IF (%begins(%walk(%mapvnum(%i),%roomlink(%mapvnum(%i),%j),"open")) {#NOOP %doorname(%mapvnum(%i),%j,"woodendoor")}
}
}
_________________
The only good questions are the ones we have never answered before.
Search the Forums
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