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
Alexiel
Novice


Joined: 05 Mar 2007
Posts: 33
Location: Paulsboro,NJ

PostPosted: Thu Apr 23, 2009 12:50 am   

Help with a trigger
 
I had this running, and it worked great when I was taking the tokens out of a container, but refused to work when I would loot a token from a corpse, any ideas on where I went wrong?


Code:

#TRIGGER {^You take a crystal token from the corpse of %1, the Archon Hunter.} {#math @crystal+1} "stats"
#TRIGGER {^You take an admantite token from the corpse of %1, the Archon Hunter.} {#math @admantite+1} "stats"
#TRIGGER {^You take a copper token from the corpse of %1, the Archon Hunter.} {#math @copper+1} "stats"
#TRIGGER {^You take an obsidian token from the corpse of %1, the Archon Hunter.} {#math @obsidian+1} "stats"
#TRIGGER {^You take a platinum token from the corpse of %1, the Archon Hunter.} {#math platinum+1} "stats"
#TRIGGER {^You take a golden token from the corpse of %1, the Archon Hunter.} {#math @golden+1} "stats"
#TRIGGER {^You take %1 of a crystal token from +The Corpse of a Fallen Angel+.} {#var crystal %1} "stats"
#TRIGGER {^You take %1 of an admantite token from +The Corpse of a Fallen Angel+.} {#var admantite %1} "stats"
#TRIGGER {^You take %1 of a copper token from +The Corpse of a Fallen Angel+.} {#var copper %1} "stats"
#TRIGGER {^You take %1 of an obsidian token from +The Corpse of a Fallen Angel+.} {#var obsidian %1} "stats"
#TRIGGER {^You take %1 of a platinum token from +The Corpse of a Fallen Angel+.} {#var platinum %1} "stats"
#TRIGGER {^You take a golden token from +The Corpse of a Fallen Angel+.} {#var golden %1} "stats"
#TRIGGER {^You take a crystal token from +The Corpse of a Fallen Angel+.} {#var crystal 1} "stats"
#TRIGGER {^You take an admantite token from +The Corpse of a Fallen Angel+.} {#var admantite 1} "stats"
#TRIGGER {^You take a copper token from +The Corpse of a Fallen Angel+.} {#var copper 1} "stats"
#TRIGGER {^You take an obsidian token from +The Corpse of a Fallen Angel+.} {#var obsidian 1} "stats"
#TRIGGER {^You take a platinum token from +The Corpse of a Fallen Angel+.} {#var platinum 1} "stats"
#STAT {Quest Points: @qptotal ~(@questsdone completed~) Practices: @practices Till Next QP Item ~(@qpitem~): @qpneeded Tokens: Crystal:@crystal | Admantite:@admantite | Copper:@copper | Obsidian:@obsidian | Platinum:@platinum | Golden:@golden} "stats"
#var {crystal} {}
#var {admantite} {}
#var {copper} {}
#var {obsidian} {}
#var {platinum} {}
#var {golden} {}


Thanks in advance :)
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Thu Apr 23, 2009 2:25 am   
 
I can't tell the difference between the containers and the corpses there. Which triggers work and which don't, and what text should set them off?

I suspect the problem stems from %1 not being a proper wildcard, but it could really be any number of things.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Alexiel
Novice


Joined: 05 Mar 2007
Posts: 33
Location: Paulsboro,NJ

PostPosted: Thu Apr 23, 2009 3:26 am   
 
#TRIGGER {^You take a crystal token from the corpse of %1, the Archon Hunter.} {#math @crystal+1} "stats"
#TRIGGER {^You take an admantite token from the corpse of %1, the Archon Hunter.} {#math @admantite+1} "stats"
#TRIGGER {^You take a copper token from the corpse of %1, the Archon Hunter.} {#math @copper+1} "stats"
#TRIGGER {^You take an obsidian token from the corpse of %1, the Archon Hunter.} {#math @obsidian+1} "stats"
#TRIGGER {^You take a platinum token from the corpse of %1, the Archon Hunter.} {#math platinum+1} "stats"
#TRIGGER {^You take a golden token from the corpse of %1, the Archon Hunter.} {#math @golden+1} "stats"

These are the corpses, and the ones not working =(
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Thu Apr 23, 2009 3:40 am   
 
First of all, the correct syntax would be:

#MATH golden %eval(@golden+1)

Second, like Fang said, %1 is not a proper wildcard, and is actually a bug. You should change it to at least *, or %w if it's a single word, or %n if it's a number.

Charneus
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Thu Apr 23, 2009 3:41 am   
 
Check that the triggers are firing first by adding a #say to them. If they're firing, there's something wrong with the script - for example, it might be having trouble locating the right variable. If it's not firing, then it's a problem with the pattern, and to help you there we'll need to see some examples of lines those triggers are meant to match.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Alexiel
Novice


Joined: 05 Mar 2007
Posts: 33
Location: Paulsboro,NJ

PostPosted: Thu Apr 23, 2009 5:35 am   
 
Its not firing from the looting at all, I changed the %1 to %w.
The line when an I loot an archon hunter looks like:


You take 10,464 gold coins.
You take an obsidian token from the corpse of Taitana, the Archon Hunter.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Thu Apr 23, 2009 5:54 am   
 
Did you fix the #MATH part like I said? It won't work if you keep doing it that way.

If the corpse of (whatever) is always just one word, you can use %w. Otherwise, use *.

Charneus
Reply with quote
Alexiel
Novice


Joined: 05 Mar 2007
Posts: 33
Location: Paulsboro,NJ

PostPosted: Thu Apr 23, 2009 8:23 am   
 
Did the math as you said, and its always <name>, the archon hunter
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Thu Apr 23, 2009 9:07 am   
 
Show us some real text from the MUD; the problem's not going to be obvious until we see it.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Thu Apr 23, 2009 6:04 pm   
 
Out of curiosity why do you have "stats" as part of them all? That looks like the old (pre v5) way of doing classes.... though I could be wrong since that has been sooo many years ago. What version are you using?
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
Alexiel
Novice


Joined: 05 Mar 2007
Posts: 33
Location: Paulsboro,NJ

PostPosted: Thu Apr 23, 2009 9:57 pm   
 
Aravan bashes Tawaite, the Archon Hunter over the head with a typhoon shield.
Tawaite, the Archon Hunter has been slain!
Aravan's bash slams Tawaite, the Archon Hunter's head into a rock with such force that it kills her.
Your blood freezes as you hear Tawaite, the Archon Hunter's death cry.
You receive 21 archon points.
Tawaite, the Archon Hunter collapses lifeless to the ground.
The sliced leg of Tawaite, the Archon Hunter falls to the ground.
You take a crystal token from the corpse of Tawaite, the Archon Hunter.


This is how it looks when I loot. The "stats" is for folders.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Fri Apr 24, 2009 3:10 am   
 
What exactly is not firing about it? The variables not getting added? They should, though...

Try using this as a trigger:

#TRIGGER {^You take a crystal token from the corpse of %w, the Archon Hunter.} {#ADD crystal 1}

You could also simplify your triggers to the following:

#REGEX {^You take an? (\w+) token from the corpse of \w+, the Archon Hunter.} {#ADD %1 1}

But we need to know what it's not doing. As a debug, add a #SAY Fired! to the script to see if it fires each time you loot a corpse.

One thing that it might be is making sure check boxes are checked properly on the options panel. The following two boxes should be checked: Trigger on Trigger and Trigger on Newline.

Good luck.

Charneus
Reply with quote
Alexiel
Novice


Joined: 05 Mar 2007
Posts: 33
Location: Paulsboro,NJ

PostPosted: Fri Apr 24, 2009 10:32 pm   
 
I got this working Very Happy
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