|
twillsinc Beginner
Joined: 02 Jul 2018 Posts: 12
|
Posted: Tue Aug 14, 2018 3:04 pm
Cmud mapper |
Hey!
Using purchased version of CMUD. on the mapper my game (elephant mud) has some HUGE areas, 800x1000 rooms sort of thing. Is there anyway to automatically link the exits rather than manually adjusting or going through each one?
Also a way to colour the room based on the title? All the forests share the same name for eg
"Forest near Aerdy" - colour green ?
Spent a while in the how-to's guides and other people's post and still cannot see if this is possible.
Thanks in advance |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4662 Location: Pensacola, FL, USA
|
Posted: Tue Aug 14, 2018 10:34 pm |
Unfortunately not, you can however walk around while not connected to the game, since the rooms already exist it should link them up substantially faster than doing so on the server where you might run into things.
The coloring aspect we can do though
#ALIAS mapColor {
#WAIT
$name=%1
$color=%2
$rooms=%mapquery(%concat("[Name] LIKE '%",$name, "%'"))
#CALL %maplocked(0)
#FORALL $rooms {#CALL %roomcolor(%i, $color)}
#CALL %maplocked(1)
}
Then to run it type: mapcolor "Forest near Aerdy" green |
|
_________________ Discord: Shalimarwildcat |
|
|
|
twillsinc Beginner
Joined: 02 Jul 2018 Posts: 12
|
Posted: Wed Aug 15, 2018 2:04 pm |
Thanks again Shalimar,
I am all for copy pasting stuff but I need to understand it so I can adjust to accomodate other things.
So if I paste all the first section it will create it all as an alias. Then in the game command line box "mapcolor (based on the alias just created) "<title of room groups>" <colour required> for every title of room to colour it all in? is that right?
Thank you! |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4662 Location: Pensacola, FL, USA
|
Posted: Wed Aug 15, 2018 5:23 pm |
That is correct.
You can input that block of code on the command line as well.
As for a step by step explanation of what the code is doing...
Code: |
#ALIAS mapColor {
#WAIT //Pushes the contents of the alias into a separate thread as %mapquery tends to lock CMUD up for a few moments while it runs otherwise.
$name=%1 //Assigns the first paramater passed to a local variable for increased legibility.
$color=%2 //Assigns the second parameter passed to a local variable.
$rooms=%mapquery(%concat("[Name] LIKE '%",$name, "%'")) //Searched the database for a list or rooms and assigns them to a local variable.
#CALL %maplocked(0) //Unlocks the map so it can be edited by code.
#FORALL $rooms {#CALL %roomcolor(%i, $color)} //loops through the list, coloring each room in turn.
#CALL %maplocked(1) //Locks the map afterward to prevent from making any mistakes.
} |
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4662 Location: Pensacola, FL, USA
|
Posted: Wed Aug 15, 2018 5:49 pm |
The local variable truly are only there for legibility, if you want compact code:
#ALIAS mapColor {
#WAIT
#CALL %maplocked(0)
#FORALL %mapquery(%concat("[Name] LIKE '%",%1, "%'")) {#CALL %roomcolor(%i, %2)}
#CALL %maplocked(1)
} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
twillsinc Beginner
Joined: 02 Jul 2018 Posts: 12
|
Posted: Wed Aug 15, 2018 10:10 pm |
Thank you so much Shalimar, I will take a look at that this weekend :) saves manually colouring 10,000 rooms.....
|
|
|
|
|
|