|
daftshiva Beginner
Joined: 09 Jul 2002 Posts: 11 Location: United Kingdom
|
Posted: Thu Jun 16, 2005 9:23 am
Door variables |
Hi and thanks for any help before I get going.
I sometimes use a macro that allows me to hit CTRL+numpad or ALT+numpad to open or close doors in a certain direction.
At the moment I use this :
ALT+KEY1
open %doorname ( ,d)
And CTRL+KEY1
close %doorname ( ,d)
The problem I have is that it uses %doorname as a variable (I think). This works fine on doors that have a different name to just plain 'door', as I assume it takes it from the room properties.
If there's a default doorname then nothing is actually entered in room properties, as I have 'door' set to default value.
This results in no value being retrieved when I try to open a door that I haven't actually manually entere the name of.
The map is big, and this would take me days to go around every default door and enter the value 'door', so is there any way to capture this?
Not sure how much sense I made there, but hope someone can understand what I'm trying to get done, and once again thanks for any help :) |
|
|
|
malikai3k Beginner
Joined: 24 Dec 2004 Posts: 14 Location: Brisbane, Australia
|
Posted: Thu Jun 16, 2005 11:14 am |
i'd use an if to check if %doorname is nul
if it is set a var to 'door'
if it's not null set the var %doorname
then open or close that var.
make sense? |
|
|
|
daftshiva Beginner
Joined: 09 Jul 2002 Posts: 11 Location: United Kingdom
|
Posted: Thu Jun 16, 2005 3:39 pm |
i'm a total newbie in regards to zmud scripting, so please correct me if i'm wrong
would this work?
If %doorname = nul
then %doorname = $door
open %doorname
I told you I was a newbie ;-) |
|
|
|
Private Adept
Joined: 10 Jan 2002 Posts: 264 Location: USA
|
Posted: Thu Jun 16, 2005 10:22 pm |
#KEY ALT-KEY1 {#IF (%doorname(,d) = "") {this_door = door} {this_door = %doorname};open @this_door}
#KEY CTRL-KEY1 {#IF (%doorname(,d) = "") {this_door = door} {this_door = %doorname};close @this_door} |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Thu Jun 16, 2005 11:36 pm |
This should work without thee need for a variable
#KEY ALT-KEY1 {#IF (%null(%doorname(,d))) {open door} {open %doorname(,d)}}
#KEY CTRL-KEY1 {#IF (%null(%doorname(,d))) {close door} {close %doorname(,d)}}
Or alternativly strip the first group of {}'s to get the value if using the settings editor instead of command line creation
#IF (%null(%doorname(,d))) {open door} {open %doorname(,d)} |
|
|
|
Private Adept
Joined: 10 Jan 2002 Posts: 264 Location: USA
|
Posted: Fri Jun 17, 2005 5:16 am |
i only use the variable caase i ran into a situation of getting trapped in a room while fighting once, so i store door names for use with a flee script, just some future thinking.
|
|
|
|
malikai3k Beginner
Joined: 24 Dec 2004 Posts: 14 Location: Brisbane, Australia
|
Posted: Fri Jun 17, 2005 7:57 am |
nexela for the win
|
|
|
|
daftshiva Beginner
Joined: 09 Jul 2002 Posts: 11 Location: United Kingdom
|
Posted: Fri Jun 17, 2005 6:20 pm |
Wow, thanks all. :)
|
|
|
|
|
|