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
Lennya
Newbie


Joined: 19 Oct 2012
Posts: 7

PostPosted: Wed Nov 21, 2012 7:30 pm   

Trigger classes fail to keep working after I restart cMUD
 
I'm having trouble with storing ID spells into a database. The crux is, there's multiple (identical) lines that need to be captured and stored to different variables.

Look at the last three lines:
Quote:

H:253/253 M:329/319 V:230/230 {117712741} [895815] DITY (* *) 1am>cast 'ident' amulet
Ok.
You feel informed:
Object 'amulet crystal glowing', Item type: WORN
Item is: GLOW MINERAL MAGIC BLESS ANTI-CLERIC ANTI-THIEF ANTI-WARRIOR ANTI-BARBARIAN ANTI-RANGER ANTI-PALADIN ANTI-PSIONIST ANTI-MONK ANTI-DRUID
Worn on: TAKE NECK
Weight: 1, Value: 3500, Rent cost: 2700 [RARE] [LIMITED]
Can affect you as :
Affects : MANA-REGEN By 10
Affects : MANA By 10
Affects : SPELLFAIL By -10
You are overcome by a wave of exhaustion.
A wave of nausea overcomes you. You collapse!

H:253/253 M:229/319 V:230/230 {117711241} [895815] DITY (* *) 1am>


Never more than 5 affects, so I've got 5 triggers:
Code:

#trigger {Can affect you as :} {#t+ Aff1;#t- Aff2;#t- Aff3;#t- Aff4;#t- Aff5}
#trigger {Affects : &item.aff1} {#t+ Aff2;#t- Aff1} Aff1
#trigger {Affects : &item.aff2} {#t+ Aff3;#t- Aff2} Aff2
#trigger {Affects : &item.aff3} {#t+ Aff4;#t- Aff3} Aff3
#trigger {Affects : &item.aff4} {#t+ Aff5;#t- Aff4} Aff4
#trigger {Affects : &item.aff5} {#t- Aff5} Aff5


When I wrote this code yesterday, it captured and saved the affects fine.

Then, when opened up cMUD today, the code was still identical, but things are scrambling up:

Quote:

0.0030 | a copywork |Can affect you as :
0.0028 | f copywork | Pattern: Can affect you as :
0.0029 | c copywork | exec : Pattern "Can affect you as :" : #t- Aff2 #t- Aff3 #t- Aff...
0.0132 | a copywork | Affects : MANA-REGEN By 10
0.0032 | f copywork | Pattern: Affects : &Item.Aff1 : (%1="MANA-REGEN By 10")
0.0030 | c copywork | exec : Pattern "Affects : &Item.Aff1" : #t- Aff1 #t+ Aff2
0.0035 | f copywork | Pattern: Affects : &Item.Aff2 : (%1="MANA-REGEN By 10")
0.0031 | c copywork | exec : Pattern "Affects : &Item.Aff2" : #t+ Aff3 #t- Aff2
0.0136 | a copywork | Affects : MANA By 10
0.0033 | f copywork | Pattern: Affects : &Item.Aff3 : (%1="MANA By 10")
0.0031 | c copywork | exec : Pattern "Affects : &Item.Aff3" : #t+ Aff4 #t- Aff3
0.0134 | a copywork | Affects : SPELLFAIL By -10
0.0034 | f copywork | Pattern: Affects : &Item.Aff4 : (%1="SPELLFAIL By -10")
0.0032 | c copywork | exec : Pattern "Affects : &Item.Aff4" : #t+ Aff5 #t- Aff4
0.0169 | a copywork |You are overcome by a wave of exhaustion.
0.0031 | a copywork |A wave of nausea overcomes you. You collapse!


Note how both triggers one and two fire off the first line. Shouldn't happen.

So I rewrote the thing somewhat this afternoon, worked again, but when I quit and relaunched cMUD this night, it's the same thing all over again.

What am I doing wrong?

Thanks in advance,

Lennya
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Nov 21, 2012 7:55 pm   
 
None of your affects triggers actually have names assigned to them. Names go before the pattern, which is fairly clearly shown in the #TRIGGER helpfile (the first line is the syntax).
_________________
EDIT: I didn't like my old signature
Reply with quote
Lennya
Newbie


Joined: 19 Oct 2012
Posts: 7

PostPosted: Wed Nov 21, 2012 9:36 pm   
 
That I agree with, but names aren't mandatory are they?

#trigger {Affects : &item.aff1} {#t+ Aff2;#t- Aff1} Aff1

The last argument in this #trigger I used earlier put each trigger in a class, and the whole class was then turned on or off.

However, I named each of them this time, taking them out of the class, giving each its own name:
#trigger Aff1 {Affects : &item.aff1} {#t+ Aff2;#t- Aff1}

the result is still
Quote:

0.0029 | a copywork |Can affect you as :
0.0029 | f copywork | Pattern: Can affect you as :
0.0030 | c copywork | exec : Pattern "Can affect you as :" : #t- Aff2 trigger #t- Aff3...
0.0064 | a copywork | Affects : MANA-REGEN By 10
0.0031 | f copywork | Pattern: Affects : &Item.Aff1 : (%1="MANA-REGEN By 10")
0.0030 | c copywork | exec : Pattern "Aff1" : #t+ Aff2 trigger #t- Aff1 trigger
0.0032 | f copywork | Pattern: Affects : &Item.Aff2 : (%1="MANA-REGEN By 10")
0.0029 | c copywork | exec : Pattern "Aff2" : #t+ Aff3 trigger #t- Aff2 trigger
0.0066 | a copywork | Affects : MANA By 10
0.0030 | f copywork | Pattern: Affects : &Item.Aff3 : (%1="MANA By 10")
0.0030 | c copywork | exec : Pattern "Aff3" : #t+ Aff4 trigger#t- Aff3 trigger
0.0063 | a copywork | Affects : SPELLFAIL By -10
0.0034 | f copywork | Pattern: Affects : &Item.Aff4 : (%1="SPELLFAIL By -10")
0.0029 | c copywork | exec : Pattern "Aff4" : #t+ Aff5 trigger #t- Aff4 trigger
0.0091 | a copywork |You are overcome by a wave of exhaustion.
0.0038 | a copywork |A wave of nausea overcomes you. You collapse!


Still both aff1 and aff2 trigger off the first pattern line, while aff2 should be turned off.

Lennya
Reply with quote
shalimar
GURU


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

PostPosted: Wed Nov 21, 2012 9:58 pm   
 
Are you sure aff2 was properly disabled?

If aff2 has a priority number that would allow it to fire after aff1, it might simply be turning it on fast enough to still count the same line.

you could try checking the stop further processing option
_________________
Discord: Shalimarwildcat
Reply with quote
Lennya
Newbie


Joined: 19 Oct 2012
Posts: 7

PostPosted: Thu Nov 22, 2012 8:16 am   
 
Hmm that seems to have fixed it. I wonder how I missed that option in the first place :)

Greatly appreciated! Thanks to both of you for the timely replies.

Still, I don't see how this set of triggers worked fine when I write them from scratch, then upon launching cMUD, it goes looney on 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