ZMUD crashing

by Celina

Back to Mechanic's Corner.

Celina2009-10-05 09:17:14
So I'm no coder, but I've been modifying my system and adding in rune lines, but I'm encountering a major problem. The triggers for the runes make ZMUD crash every time. I've basically borrowed the glamours curing that already existed in the system and changed the lines to reflect runes. The glamours curing works fine and doesn't make ZMUD crash.

Ignore that they are incomplete, and some of the triggers may be incorrect. I haven't bothered to fix them as they just keep crashing zmud.

#CLASS {Runelore}
#TRIGGER {^(%w) slings {a|an} (%w) rune and (a|an) {a|an} rune at you, hitting you in the chest.$} {#T+ runes;#alarm +.5 {#T- runes}}
#TRIGGER {^{A|An} (%w) rune and {a|an} (%w) rune whiz in from the (%w) and hit you in the chest.$} {#T+ runes;#alarm +.5 {#T- runes}}
#TRIGGER {^(%w) slings {a|an} (%w) rune at you, hitting you in the chest.$} {#T+ runes;#alarm +.5 {#T- runes}}
#TRIGGER {^{A|An} (%w) rune whizzes in from the %w and hits you in the chest.$} {#T+ runes;#alarm +.5 {#T- runes}}
#CLASS 0
#CLASS {Runelore|runes}
#TRIGGER {ur} {aff_gluttony=1;lastaff=gluttony;purgqueue}
#TRIGGER {nyd} {aff_sensitivity=1} "" {disable}
#TRIGGER {cen} {aff_stupidity=1;lastaff=stupidity;herbqueue}
#TRIGGER {beorc} {aff_shyness=1;purgqueue}
#TRIGGER {gyfu} {aff_paralysis=1;lastaff=paralysis;herbqueue}
#TRIGGER {wynn} {aff_stupidity=1;lastaff=stupidity;herbqueue}
#TRIGGER {isa} {#if @def_fire=1 {def_fire=0} {aff_chills=1;lastaff=chills};purgqueue}
#TRIGGER {ger} {impatiencecheck}
#TRIGGER {eoh} {aff_clumsiness=1;lastaff=clumsiness;herbqueue}
#TRIGGER {peorth} {aff_hallucinations=1;lastaff=hallucinations;focusqueue}
#TRIGGER {eohl} {aff_peace=1;focusqueue}
#TRIGGER {sigil} {}
#TRIGGER {tiwaz} {aff_justice=1;lastaff=justice;herbqueue}
#TRIGGER {feoh} {aff_masochism=1;lastaff=masochism;smokequeue}
#TRIGGER {eh} {aff_reckless=1;lastaff=reckless;herbqueue}
#TRIGGER {manna} {aff_disloyalty=1;purgqueue}
#TRIGGER {lagu} {aff_dementia=1;lastaff=dementia;herbqueue}
#TRIGGER {ing} {aff_loverscurse=1;lastaff=loverscurse;herbqueue}
#TRIGGER {daeg} {}
#TRIGGER {ansuz} {aff_hypochondria=1;herbqueue}
#TRIGGER {othala} {focusqueue}
#CLASS 0

What's odd is that when I enable the rune folder just to test each rune, I can say Gyfu and it'll fire, then zmud will promptly crash. Rune lines do not exist anywhere else in the system, so I'm lost as to what is causing the crash.

Here's the glamours crap I built it from. No crashing here.

#CLASS {Afflictions|Glamours}
#TRIGGER {^The maelstrom of rainbow colours whips violently around, slamming*into you.$} {#T+ Colours;#alarm +.5 {#T- Colours}}
#TRIGGER {^%w weaves a glamour of radiant prismatic colours, dazzling you with} {#T+ Colours;#alarm +.5 {#T- Colours}}
#TRIGGER {^%w spreads {his|her} hands wide and weaves a vibrant spray of prismatic colours that dance and swirl through the air in a riotous pandemonium of hues.$} {#T+ Colours;#alarm +.5 {#T- Colours}}
#CLASS 0
#CLASS {Afflictions|Glamours|Colours}
#TRIGGER {bright yellow flashes} {#cw yellow,silver,bold;aff_dementia=1;lastaff=dementia;herbqueue}
#TRIGGER {deep indigo whorls} {#cw blue,purple}
#TRIGGER {emerald green iridescence} {#cw green,bold;aff_epilepsy=1;lastaff=epilepsy;focusqueue}
#TRIGGER {incandescent blue striations} {#cw blue,bold;aff_reckless=1;lastaff=reckless;focusqueue}
#TRIGGER {lustrous violet swirls} {#cw purple;aff_dizziness=1;lastaff=dizziness}
#TRIGGER {scarlet red light} {#cw red;aff_paralysis=1;herbqueue}
#TRIGGER {vibrant orange hues} {#cw orange,bold;aff_stupidity=1;lastaff=stupidity;herbqueue}
#CLASS 0

If anyone knows why, or has a suggestion on how to do it better, I'd be very appreciative.
Esano2009-10-05 10:20:42
But I liked you not being able to cure runes. sad.gif

OK. Firstly you need to make what zMud calls a record to store the runes and their affs, it should look like this:



Then, you make this trigger (regex trigger because I prefer regex):
CODE
#REGEX {^\\w+ slings an? (\\w+) rune and an? (\\w+) rune at you, hitting you in the chest.$} {aff1 = %string( @runeaffs.%1);aff2 = %string( @runeaffs.%2);#if (@aff1) {aff1 = %concat( "aff_", @aff1);#VAR @aff1 1} {#ECHO Do not recognize aff for rune %1};#if (@aff2) {aff2 = %concat( "aff_", @aff2);#VAR @aff2 1} {#ECHO Do not recognize aff for rune %2}}


I'm sure you can work it out from there, just duplicating that trigger's script, pretty much.

Here's the .zsc file with that in it, it won't let me upload it under its normal extension so just drop the .txt extension so it's called runestuff.zsc then import it. Yes, I give this to you at the end of the post, after all the instructions on how to make it. On purpose.

Unknown2009-10-05 11:29:12
You're trying to enable triggers to fire on the same line as the trigger that enabled them, which may be problematic, since the line has already been checked against your triggers by that point. The difference between your runes and glamours curing is that the initial glamours trigger is only the first part of the line and the colors are in the second part. It's a little wonky the way zMUD matches triggers in this way, but that's how it works.

Personally, I go for a solution more like Esano's, where you capture everything in just that one trigger and do a lookup table for the afflictions.
Celina2009-10-05 21:09:20
I'll fiddle around with it after I get off work.

Thanks for helping to coding challenged!
Charune2009-10-05 23:46:23
QUOTE (Celina @ Oct 5 2009, 05:17 AM) <{POST_SNAPBACK}>
#TRIGGER {^(%w) slings {a|an} (%w) rune and (a|an) {a|an} rune at you, hitting you in the chest.$} {#T+ runes;#alarm +.5 {#T- runes}}

We don't have "a" or "an" runes in Lusternia. You probably want {a|an} (%w) in there instead of (a|an) {a|an}