zMUD multi-line trigger capture

by Unknown

Back to Mechanic's Corner.

Unknown2004-11-28 23:14:18
To set a multi-line trigger, you create a new state, within lines, parameter 1, correct?

I tried to capture the message you get when someone teleports to you and have it echo back "Teleport incoming" to me after the second line, but it never picks up the second line. I moved the message to echo after the first line is triggered, and it works, but not the second. I typed in the message exactly as I saw it, on both lines. Any help?
Unknown2004-11-29 03:08:35
QUOTE (Mox @ Nov 29 2004, 12:14 PM)
To set a multi-line trigger, you create a new state, within lines, parameter 1, correct?

I tried to capture the message you get when someone teleports to you and have it echo back "Teleport incoming" to me after the second line, but it never picks up the second line. I moved the message to echo after the first line is triggered, and it works, but not the second. I typed in the message exactly as I saw it, on both lines. Any help?

I'm not sure why your multi-state trigger doesn't work, but another way you can do multil-line triggers is to use a $ within one pattern, e.g.:
CODE
#TRIGGER {1st_line_pattern$2nd_line_pattern} {#ECHO Teleport incoming.}

Post the code of your multi-state trigger and I might be able to help you with that.
Unknown2004-11-30 20:31:21
#TRIGGER {You feel a slight tug within your chest and the air around you sparkles with} {#echo Incoming teleport.} "Triggers|Alerts"
#COND {motes of bright light.
} {#echo Incoming teleport.} {within|param=1}

The first echo is because my second one didn't work, so I wanted at least one in there.

EDIT: Does anyone know how to quickly convert zMUD settings (triggers, aliases, etc.) to text without doing File --> Export?
Kaelar2004-12-01 03:23:35
CODE
#TRIGGER {You feel a slight tug within your chest and the air around you sparkles with $motes of bright light.} {#echo Incoming teleport.}


The $ character works for multilines in zMUD triggers. If what I mentioned above doesn't work, try removing the space before $motes (so it would then read: with$motes), since it varies depending on if the game outputs a space or not.

EDIT: Yeah, I have a bad habit of posting before I read peoples responses. rolleyes.gif Basically just a repeat of what Zaltan said.
Unknown2004-12-02 11:05:26
Multiline triggers will slow down your system. Use trigger states.
Unknown2004-12-02 11:09:13
That linebreak beween "motes of bright light" and "}", is that in your trigger too?

If so, make sure there's no ansi linebreak in there, zMud likes to do that for some reason. (Ansi linebreak as in, there'd be two black bits at the end of the trigger pattern, if you view it in the "states" table)

Also, note that if you have a within lines multi trigger and echo something on the first matched state, you can end up with preventing the other States from firing because your echo "pushed" the following lines further down.
However, that doesn't seem to happen if you only echo one line of text, for some reason. Within lines=1 still fires. It doesn't if trigger state 1 echos two lines.
Unknown2004-12-02 12:01:10
The reason I echo the first is because my second line didn't work. I don't think there's an ansi break on the second, either. That "}" is just pushed down by zMUD.
Dumihru2004-12-02 14:47:48
I think David is right. If zmud is automatically adding a linebreak after the second, then there is probably one in the trigger pattern. If I export my conditionals as text, the last } comes out on the same line.

Go to States. Stick your cursor "light.". Hit right arrow to scroll all the way to the end of the pattern. If it "falls off" at the end (pattern disappears), you hit the linebreak. So backspace it, save, and retry.

If you're going to leave the echo in the first state, then set the second one to within 2 or 3 instead of 1.
Unknown2004-12-02 18:05:04
generally, if you want to create triggers from text you've copied out of the mud output, it's a good idea to take care of linebreaks before you paste anything into the trigger pattern.

Like, paste it into a text editor or just into the code area of the trigger's first state, so you can add all the ^s and $s.

If you just select one complete line and paste it into the pattern area in the trigger editor, you'll end up with zmud adding linebreaks for some reason. Really annoying but that's how it is.