Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
jysmystry
Beginner


Joined: 28 Nov 2012
Posts: 16

PostPosted: Wed Dec 05, 2012 3:41 pm   

Cmud Mapper and #tags
 
Hi,

I'm gonna sounds terribly stupid here but I have been reading and experimenting for hours now and i just nt getting anywhere.

My mud the autoconfigure inst working so im trying to add #tag commands.

Here is my mud output..

Quote:

-= This is a roomname =-
You are strolling through thick bushes trying to find your way out. The sun
is climbing high up in the sky casting its warm rays on you. There's no sign
of rain or storm in the sky. A narrow path is winding from north to south
through the bushes.
A gentle rain is falling, making the ground soft and muddy.
Any mobs or items etc here

Obvious exits are:
North : roomname
South :roomname
West : roomname
@Aura:174/174 Str:175/175 Level: 57308


People say to "add #tags" and triggers so i click on triggers at the top, click new then i select the roomname and delete the words that change and put in %w so i get a matching pattern then i click onto the script window and type #tag name? Is this correct and I have then used a trigger to tag the room name? The xml looks like this then..

Code:

<trigger priority="160" prompt="true" id="16">
  <pattern>-= * =-</pattern>
  <value>#tag name</value>
</trigger>


And then I make another trigger from my prompt and it have a patter like @Aura:%d/%d Str:%n/%d Level: %d and i then type #tag prompt into the script window?

So now i just need to find out how to make it match the room exits and i am done?

Does this sound right because really im totally lost here ad people say things like "make a trigger" but it is the simple thing like this that are hard to me because i dont really understand exactly what a trigger is, nor how to make one and to then say "and tag it" is liek chinese to me but from my readign does this seem like what i should be doing here?
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Dec 05, 2012 4:48 pm   
 
Yes, that trigger should work. It would set the entire line as the Name field for the room. You are not as confused as you fear.

If you wanted to get rid of the "-=" and "=-" at either end of the name, you could try this:
Code:
<trigger priority="160" prompt="true" id="16">
  <pattern>-= (*) =-</pattern>
  <value>#tag name %1</value>
</trigger>

The parentheses in the trigger pattern "captures" the value matched. The value captured by the first set of parentheses in a pattern
can be accessed in the trigger with %1, the second value captured can be accessed with %2, etc. Thus, the #TAG command in
this trigger is setting the Name field in the room to the value captured in the trigger.

Capturing the exits will be a bit harder. Your exits are on multiple lines. One way of doing it would be a multi-state trigger, which can
be a bit tricky. I don't really have time to come up with a trigger for this today, but hopefully someone else can come up with one. If
not, I'll try later on.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4689
Location: Pensacola, FL, USA

PostPosted: Wed Dec 05, 2012 4:51 pm   
 
that looks about right.

although @aura in a pattern will be looking for the value of your aura variable to be in the string the trigger is matching on
if you need a literal @ symbol you should quote it out with a tilde ~@

a trigger is merely a coded attempt to match strings, to perform an action

just remember to reconfigure the mapper after each #TAG trigger, you may not need to tag everything, just the stuff it has trouble understanding
_________________
Discord: Shalimarwildcat
Reply with quote
jysmystry
Beginner


Joined: 28 Nov 2012
Posts: 16

PostPosted: Wed Dec 05, 2012 4:59 pm   
 
Thanks both, that's really helpful. I made the changes you suggested rahab and it pucks out the room name but puts the exits as the description. Ill have to try to find some examples from other people on how to add the description and exits.

i am not sure i understand about the prompt, i just added that in the mud so it would have something easy to latch onto but i cab rrmkve that. Do you think that would be better having the prompt start as "Aura xxxx"?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Dec 05, 2012 5:06 pm   
 
That is basically right, but there are a few considerations to think about.

1)* matches anything your keyboard can print, with the obvious exceptions being keys like backspace, delete, enter, and the various other cursor-control characters. In all cases, you can use [] as a replacement with any wildcards or literal characters between the [] that you want to match on. For example, room names typically only have letters, spaces, and perhaps a very limited set of punctuation (ie, ,.?!-) so such a pattern would be[%w%s,.?!-] (note that because - has a special function inside [] it has to be the first or the last character listed.)

2)make use of ^ and $. These will prevent players from spoofing lines, as well as simply preventing your triggers from firing on stuff innocently show on channels or other speech locations.

3)Some games wrap room names in some sort of unique text to better allow triggers to identify them. This unique text is typically not included in other game features and player abilities that display room names, so it'll be unnecessary to include them in your map info. The way to exclude them is to surround the wildcard portion of the pattern in parentheses and then reference the appropriate %1...%99 variable in your #tag command: #tag name %1.

4)@ is a special character meaning that what follows is a variable name. You probably have an Aura variable, but I'm betting you want your prompt trigger to match on the literal word of "@Aura:". Use ~ (the quote character) to literalize it.

5)room info tends to come in a specific pattern, so you may want to look into the use of multistate triggers. Multistate triggers are basically just a whole set of individual triggers that are locked into a group, with CMud automatically controlling when each state gets activated. They can make matching on several lines easier and cleaner, since you don't have to worry about using commands like #T- and #T+ AND you can use %t1...%t99 to refer to captured elements from previous trigger states (it's almost like being able to reference local variables across separate settings objects).
_________________
EDIT: I didn't like my old signature
Reply with quote
jysmystry
Beginner


Joined: 28 Nov 2012
Posts: 16

PostPosted: Wed Dec 05, 2012 6:43 pm   
 
This is all great into thanks guys, especially the bits on the @ sign in the prompt.

i will now research multistate triggers to try to sort out the exits now.

i also guess that i need to do a new configuration in the mapper so it can forget old config and use the new tags
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4689
Location: Pensacola, FL, USA

PostPosted: Wed Dec 05, 2012 7:08 pm   
 
dont forget to make sure your prompt trigger has 'trigger on prompt' checked and not newline
_________________
Discord: Shalimarwildcat
Reply with quote
jysmystry
Beginner


Joined: 28 Nov 2012
Posts: 16

PostPosted: Wed Dec 05, 2012 9:48 pm   
 
im gonna give up on this, i cant find a way to match the room names without the -= =- despite the tips, i cant match the multiline description - all the mapper pics up for the description is the exits and the exits i dont even know how to start finding a multistated trigger int he options. I think ill have to make do with a crappy workign mapper and leave the tinkering to you guys.

Was interesting though but too complex for me.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net