|
Eowyn Apprentice
Joined: 19 Jan 2001 Posts: 117 Location: Norway
|
Posted: 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 :) |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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 |
|
|
|
Eowyn Apprentice
Joined: 19 Jan 2001 Posts: 117 Location: Norway
|
Posted: 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 |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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 |
|
|
|
|
|