 |
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: Thu Jan 23, 2003 9:10 pm
changing room attributes |
I'm working on a complicated script but I'm stuck on the usage for the new mapper commands for changing the room attributes.
For part of this script, I want an alias that loops through all rooms in the map and if the room has (only 1 exit AND still have the default color) then this room is a dead end room and I want to change its color to black.
Part 2.
For this second alias, again I want to loop through all rooms on my map, if (a room has unexplored exits -- exit links in a direction, but no room has been created in that direction) AND (the room still has the default color -- has not been manually changed to any other color) then I want to change the room color to blue.
The third script is an alias that will loop through all rooms looking for blue colored room. IF the room is blue AND all exits are now explored, then I want to change the room color back to the default grey.
Can anybody help me with these scripts. I'm not really sure where to begin, I'd like each of these in seperate alias so I can execute them at various times.
Oh, one more question.
If I have a room number, how can I get a list of the room numbers linked to this room.
For example, If room number 11 has exits going north, south, west, and east. The room to the north is numbrt 12, south is 13, west is 14,east is 15. How can I create a function, or what function can i use to get a list of these rooms...12|13|14|15. I've looked at the roomexit command that returns the directional exits, but I want the room number in these directions.
I know I'm asking for a lot here, any help on any of these will be greatly appreciated.
Talahaski
Processor PIII 1000
Memory 265MB
Video NVIDIA 64MB
Windows XP
Zmud Version 6.50
Zmapper Version 1.14 |
|
|
 |
TonDiening GURU

Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Thu Jan 23, 2003 10:09 pm |
Use Charbal's loop concept from here.
Then instead of renumbering, make the check
and set what needs to be set.
Gotta run!
Ton Diening |
|
|
 |
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: Fri Jan 24, 2003 1:32 am |
The main problem I am having is that I have no idea how to use the zmapper com commands for room attributes like color to test the color value and set the color value.
If somebody could give me an example with a test for room color and an example of changing the room color that would help
[edit]
As far as I can tell, there is no simple zmud command to get or set the room color so I would need to use a COM call. I have no idea how to go about this.
Talahaski
Processor PIII 1000
Memory 265MB
Video NVIDIA 64MB
Windows XP
Zmud Version 6.50
Zmapper Version 1.14 |
|
|
 |
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: Fri Jan 24, 2003 1:47 am |
ok, I found the command %roomcol but I can't seem to figure out how to work the syntax correctly.
I've tried the following:
#sh %roomcol( 2,'')
#sh %roomcol( 2,"")
#sh %roomcol( 2,#echo)
The above ones do nothing.
Then I tried
#sh %roomcol( 1,[red])
This displays 65280 but appear to have NOT changed the room color on the map.
So any help on how to return the room color and set the room color.
Talahaski
Processor PIII 1000
Memory 265MB
Video NVIDIA 64MB
Windows XP
Zmud Version 6.50
Zmapper Version 1.14 |
|
|
 |
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: Fri Jan 24, 2003 2:03 am |
Syntax: %roomcol( room, [color])
is room the ID or the Vnum?
Talahaski
Processor PIII 1000
Memory 265MB
Video NVIDIA 64MB
Windows XP
Zmud Version 6.50
Zmapper Version 1.14 |
|
|
 |
Kjata GURU

Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Fri Jan 24, 2003 3:21 am |
What the number room means depends on the value you have set for %roomode. Look up this function in the function wizard to find out which value is which.
Also, remember that the map is locked by default when not in Map mode. This means that you can't change the map either manually or using the mapper functions. You can either put the map in Map mode or use %maplocked to unlock by code.
Kjata |
|
|
 |
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: Fri Jan 24, 2003 3:50 pm |
Perhaps I'm blind, but I connot find either of those 2 commands anywhere in the help files.
Can anybody else help me with constructing these alias?
Talahaski
Processor PIII 1000
Memory 265MB
Video NVIDIA 64MB
Windows XP
Zmud Version 6.50
Zmapper Version 1.14 |
|
|
 |
TonDiening GURU

Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Fri Jan 24, 2003 7:30 pm |
A WORK IN PROGRESS - Use at own risk :P
I changed the places where it will set changes to a #SHOW so you can double check if
what I propose is correct. I may have gotten room vnum and map vnum confused will
try and check it later with a map when I get home. Anyhoo it should give a basis to
start from. Recommend you back up your map first.
quote:
For part of this script, I want an alias that loops through all rooms in the map and if
the room has (only 1 exit AND still have the default color) then this room is a dead end
room and I want to change its color to black.
#LOOP 1,%numrooms() {
#IF ((%numitems(%roomexit(%mapvnum(%i))) == 1) AND (%roomcol(%mapvnum(%i)) == 536870911)) {
#SH MapVNum %mapvnum(%i) to be black "#NOOP %roomcol(%mapvnum(%i),black))"
#NOOP a grey coloured room with one exit called a dead end is now black
}
}
quote:
Part 2.
For this second alias, again I want to loop through all rooms on my map, if (a room has
unexplored exits -- exit links in a direction, but no room has been created in that
direction) AND (the room still has the default color -- has not been manually changed to
any other color) then I want to change the room color to blue.
Checks for link stubs not untested links. Working on it.
#LOOP 1,%numrooms() {
#IF (%roomcol(%mapvnum(%i)) == 536870911) {
#VARIABLE CurrentMapVNum %mapvnum(%i)
#FORALL %roomexit(@CurrentMapVNum) {
#IF (%roomlink(@CurrentMapVNum,%i) == -2) {
#SH MapVNum @CurrentMapVNum to be blue "#NOOP %roomcol(@CurrentMapVNum,blue)}"
#NOOP a grey coloured room with an untested link is now blue
}
}
}
}
quote:
The third script is an alias that will loop through all rooms looking for blue colored
room. IF the room is blue AND all exits are now explored, then I want to change the room
color back to the default grey.
#LOOP 1,%numrooms() {
#IF (%roomcol() == 16711680) {
#VARIABLE FoundUntestedLink 0
#VARIABLE CurrentMapVNum %mapvnum(%i)
#FORALL %roomexit(@CurrentMapVNum) {
#IF (%roomlink(@CurrentMapVNum,%i) == -2) {#VARIABLE FoundUntestedLink 1}
#IF (!@FoundUntestedLink) {
#SH MapVNum @CurrentMapVNum to be grey "#NOOP %roomcol(@CurrentMapVNum,536870911)"
}
#NOOP a blue coloured room with no untested links is now grey
}
}
}
quote:
If I have a room number, how can I get a list of the room numbers linked to this room.
For example, If room number 11 has exits going north, south, west, and east. The room to
the north is numbrt 12, south is 13, west is 14,east is 15. How can I create a function,
or what function can i use to get a list of these rooms...12|13|14|15. I've looked at
the roomexit command that returns the directional exits, but I want the room number in
these directions.
#VARIABLE LinkedRooms ""
#VARIABLE CurrentMapVNum %mapvnum(%i)
#FORALL %roomexit(@CurrentMapVNum) {#ADDITEM LinkedRooms %roomlink(@CurrentMapVNum,%i)}}
#NOOP Contains -1 and -2 values for loop and unlinked
Ton Diening
Edited up to around 3:51pm for typos etc.
Edited at 5:28pm for mapvnum vs absolute vnum; I think I got it all right. Not tested though or checked with syntax editor.
FYI:
quote:
mapvnum
Syntax: %mapvnum( number)
Convert an absolute room number to a virtual room number. The absolute number for rooms ranges from 1 to %numrooms. All of the other %room commands require a virtual room number, rather than the absolute number.
mapvnum Example
#LOOP %numrooms {#ECHO %roomname(%mapvnum(%i))}
This will loop through each room on the map and display the room name.
|
|
|
 |
Kjata GURU

Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Fri Jan 24, 2003 7:52 pm |
You are not blind, the helpfile is just a little behind with respect to these functions. You can always find any function or command in the Function Wizard or Command Wizard respectively, under the Help menu.
Kjata |
|
|
 |
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: Fri Jan 24, 2003 9:06 pm |
Ton Diening, Thanks a bunch for the help. I'll try these out tonight. Its really going to help me with mapping.
Talahaski
Processor PIII 1000
Memory 265MB
Video NVIDIA 64MB
Windows XP
Zmud Version 6.50
Zmapper Version 1.14 |
|
|
 |
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: Sat Jan 25, 2003 12:58 am |
I've done some testing with the first alias. It appears to be working correctly and selecting the right room but i did notice one thing. Its only picking up rooms in the current zone, its not picking up all rooms in the map. I want these alias to run for every room in every zone i have.
Thanks very much for the help so far though. It's got me started with something that works.
Talahaski
Processor PIII 1000
Memory 265MB
Video NVIDIA 64MB
Windows XP
Zmud Version 6.50
Zmapper Version 1.14 |
|
|
 |
TonDiening GURU

Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Sat Jan 25, 2003 1:06 am |
Can you loop through all the zones 1 to %numzones()
quote:
numzones
Syntax: %numzones()
Return the number of zones in the map
And
quote:
Syntax: #TE room [zone]
teleport to that zone do the check loop?
Ton Diening |
|
|
 |
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: Sat Jan 25, 2003 1:14 am |
hmm, sounds like an idea.
I'll test it out later.
Again thanks for all the help.
Talahaski
Processor PIII 1000
Memory 265MB
Video NVIDIA 64MB
Windows XP
Zmud Version 6.50
Zmapper Version 1.14 |
|
|
 |
|
|