Zmud Maps & follow the leader
Posted: 15 Mar 2010 13:53
There is a command in zMud that allows you to change your position on the map by one room.
#MOVE
So typing #move east in the command line will move the blue dot on the map one room east.
Same works for all your directions even custom ones like board ship, aft, fore, disembark etc.
I use this to update the map for example if I was blocked by moving east by a guard etc.
So when I try to enter the camp a few north of the crossroads outside Minas Morgul for the first time.
You send the direction west to try and move in and the map blue dot moves west
But you get a message from the mud saying something like
"Are you sure you want to enter the camp, theres nasties in there that might hunt you down" and you
stay where you were until you send west for a second time.
So to keep the map position correct you can use a trigger to move the blue dot back to the correct room.
ie
Hopefully you get the idea.
Now will go into how to keep the map up to date when you are being led.
This is a little more complicated that the previous example trigger because you will include "Pattern matching" and a "Variable".
Helps to create an alias to set a variable, will call it "teamleader".
This will create the variable "teamleader" or overwrite it if it already exists.
the @ sign is used before variables when you want to use the value stored in the variable.
the %1 is how to refer to the input you type following an alias.
so if you type <setleader big blue goblin>
big = %1, blue = %2, goblin = %3 each white space creates a new chunk
but if you use a - sign it all goes into one chunk ie %-1 = big blue goblin
This is necessary so the setleader alias you just created should be able to cope with people who have not introduced being your leader.
For now we will assume your friend called skilgannon is leading.
"Teamleader now set to skilgannon" should appear in blue writing in the zMud window
Now you need to create the trigger to catch the text from the mud when Skilgannon moves and turn it into #MOVE commands to keep your map up to date.
Here you are using a trigger to look for the value stored in @teamleader
^ means that that has to be at the start of a line
and using (%w) to store the direction in %1 and also to ignore the . at the end
So to explain further usign "(%w)east." instead would have %1 = to "north" if they left northeast.
Whats that you say, How do you know all this sh1t?!?
It justs comes straight out of the zmud help files.
Alias used to set a variable teamleader and a trigger to catch their movement and update the map.
You will need to set teamleader to something nonsense like "666BlakBlam" or disable the trigger when you leave the team or the map will keep following the set leader in the direction they leave even though you will not be.
You will need to take it further to cover all the weird and wacky exit descriptions for Ogres, Mounted, limpers, bow legged etc.
Just make a new trigger for each one you encounter.
Could also expand it to auto set teamleader var when you join a team or team changes leader.
#MOVE
So typing #move east in the command line will move the blue dot on the map one room east.
Same works for all your directions even custom ones like board ship, aft, fore, disembark etc.
I use this to update the map for example if I was blocked by moving east by a guard etc.
So when I try to enter the camp a few north of the crossroads outside Minas Morgul for the first time.
You send the direction west to try and move in and the map blue dot moves west
But you get a message from the mud saying something like
"Are you sure you want to enter the camp, theres nasties in there that might hunt you down" and you
stay where you were until you send west for a second time.
So to keep the map position correct you can use a trigger to move the blue dot back to the correct room.
ie
Code: Select all
#TR {Are you sure you want to enter the camp} {#MOVE east}
Now will go into how to keep the map up to date when you are being led.
This is a little more complicated that the previous example trigger because you will include "Pattern matching" and a "Variable".
Helps to create an alias to set a variable, will call it "teamleader".
Code: Select all
#ALIAS {setleader} {#var teamleader %-1;#say Teamleader now set to @teamleader}
the @ sign is used before variables when you want to use the value stored in the variable.
the %1 is how to refer to the input you type following an alias.
so if you type <setleader big blue goblin>
big = %1, blue = %2, goblin = %3 each white space creates a new chunk
but if you use a - sign it all goes into one chunk ie %-1 = big blue goblin
This is necessary so the setleader alias you just created should be able to cope with people who have not introduced being your leader.
For now we will assume your friend called skilgannon is leading.
Code: Select all
setleader skilgannon
Now you need to create the trigger to catch the text from the mud when Skilgannon moves and turn it into #MOVE commands to keep your map up to date.
Code: Select all
#TR {^@teamleader leaves (%w).} {#MOVE %1}
^ means that that has to be at the start of a line
and using (%w) to store the direction in %1 and also to ignore the . at the end
So to explain further usign "(%w)east." instead would have %1 = to "north" if they left northeast.
Whats that you say, How do you know all this sh1t?!?
It justs comes straight out of the zmud help files.
So really that is a lot of explanation for something quite simple.zmud help topic 'Pattern Matching' wrote: Patterns can contain several special character for wild-card matching.
* match any number of characters or white space
? match a single character
%d match any number of digits (0-9)
%w match any number of alpha characters (a-z) (a word)
%a match any number of alphanumeric characters (a-z,0-9)
%s match any amount of white space (spaces, tabs)
%x match any amount of non-white space
[range] match any amount of characters listed in range
^ force pattern to match starting at the beginning of the line
$ force pattern to match ending at the end of the line
(pattern) save the matched pattern in a parameter %1 though %9
~ quote the next character to prevent it to be interpreted as a wild card.
{val1|val2|val3|...} match any of the specified strings
{^string} do not match the specified string
In specifying a range, you can list specific characters such as [abc] or you can use a range [a-c]. To use a wild card character in the string itself, preceed the special character with the ~ quote character. For example, the pattern ~[test~] will match the string [test] rather than being interpreted as a range wild-card pattern. Note that the quote character can be changed in the Preferences section.
You can also include variables in your pattern, and the name of the variable will be replaced with its value before the pattern match is performed.
Alias used to set a variable teamleader and a trigger to catch their movement and update the map.
You will need to set teamleader to something nonsense like "666BlakBlam" or disable the trigger when you leave the team or the map will keep following the set leader in the direction they leave even though you will not be.
You will need to take it further to cover all the weird and wacky exit descriptions for Ogres, Mounted, limpers, bow legged etc.
Just make a new trigger for each one you encounter.
Could also expand it to auto set teamleader var when you join a team or team changes leader.