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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
solitha
Newbie


Joined: 07 Dec 2002
Posts: 1

PostPosted: Sat Dec 07, 2002 11:26 am   

Triggers and line breaks
 
I sent this as a feedback, but haven't managed to get the answer the work.

On the mud I play, word wrap is set by the mud itself; I think it's 80 characters. Items in a room are appended to the end of the room description in the same paragraph. So you may have...

Room name.
This is a room, that big X where you happen to be, and it looks like what I am telling
you it looks like. A creature stands here, doing something amusing. An item that you
want to trigger a pattern on lies here, frustratingly. You see exits in all
directions.

So here I am trying to set a trigger to fire on that item lying on the floor. Due to the variable length of the room description and the possibility of other people/things in the room, there could be a hard line-break in the middle of the pattern I want, and it could end up anywhere in the pattern, or the pattern could be on a single line complete.

so far, my only solution has been to make two triggers, one that says...
"An item that you want to trigger a pattern"
and
"pattern on lies here, frustratingly."
...and set the same value for both. It's bulky and sloppy.

zuggsoft tells me to use $ for line breaks, but after playing with it, I'm unable to figure out exactly what it is I'm supposed to do with the $ in the pattern.

I *have* tried making the trigger pattern to look for a variable amount of white space between each word, and that didn't work. Apparently the incoming line break in the text is recognized by zMud.
Reply with quote
Castaway
GURU


Joined: 10 Oct 2000
Posts: 793
Location: Swindon, England

PostPosted: Sat Dec 07, 2002 2:39 pm   
 
Hmm.. Sounds like fun ;)

A solution could be to automatically capture the entire room description in a variable when you enter the room, and then trigger on or search in this variable for the item. For example with an expression trigger with the pattern: %pos("Item", @roomtext).

To capture the text you need to do somthing like capturing all text that appears after you type in a direction, and append it to a variable with something like: roomtext = %concat(@roomtext, " ", "%1")

Theres no prefect way of capturing text thats broken up on more than one line at the moment .(

Lady C.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Dec 07, 2002 3:27 pm   
 
In cases like this, it's best to keep your patterns as SHORT as possible. If you can trigger on a single word, it won't matter where the line breaks.

$ is used in patterns to represent the line-break itself, but that's only useful when you have a good idea of where the line will break.

LightBulb
Senior Member
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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