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
Loto
Apprentice


Joined: 05 May 2003
Posts: 194

PostPosted: Tue Dec 23, 2003 4:06 am   

Subtracting with triggers...
 
I have this:

#CLASS {reset}
#ALIAS treset {T=0}
#VAR Ttreset {0}
#TRIGGER {You get A gold quest piece from the crushed corpse} {#COLOR gold;#add T 1}
#STAT {Treasure: @T}
#CLASS 0

I need to add one more trigger to make it when it says "You sell A gold quest piece to Edward for (random number)" it subtracts 1 from T.
I don't know if it's possible to make it subtract. Also, on the statbar instead of saying "Treasure: (variable)" it says "Treasure: (variable) Treasure: (variable)"
Reply with quote
musishun00
Wanderer


Joined: 16 Dec 2003
Posts: 77
Location: USA

PostPosted: Tue Dec 23, 2003 5:58 am   
 
You can use the #ADD command to subtract. I just recently had a similar problem where I needed to subtract exp that I was using for something. Modifying it to your situation, it would look something like this:

#CLASS {reset}
#ALIAS treset {T=0}
#VAR Ttreset {0}
#TRIGGER {You get A gold quest piece from the crushed corpse} {#COLOR gold;#ADD T 1}
#TRIGGER {You sell A gold quest piece to} {#COLOR gold;#ADD T -1}
#STAT {Treasure: @T}
#CLASS 0

As far as having the status bar there twice, just look somewhere outside the class folder and see if there's another status effect that's causing it to show up twice. I've had so many triggers duplicate things, I know it gets hazy pretty often. Razz Hope this works for you.
Reply with quote
SolReapr
Beginner


Joined: 03 Sep 2003
Posts: 13
Location: USA

PostPosted: Tue Dec 23, 2003 5:59 am   
 
1. #ADD T -1
From the help file: To subtract a value, use a negative amount.

2. You may have a duplicate #STAT {Treasure: @T} command in another class
Reply with quote
musishun00
Wanderer


Joined: 16 Dec 2003
Posts: 77
Location: USA

PostPosted: Tue Dec 23, 2003 6:01 am   
 
Wow... we responded 8 seconds apart from each other, SolReapr.... that's crazy. *boggle*
Reply with quote
Loto
Apprentice


Joined: 05 May 2003
Posts: 194

PostPosted: Tue Dec 23, 2003 6:04 am   
 
I checked... I don't have a different class folder or a trigger for it... but thanks for the T -1 Sol and Mushi
Reply with quote
SolReapr
Beginner


Joined: 03 Sep 2003
Posts: 13
Location: USA

PostPosted: Tue Dec 23, 2003 6:46 am   
 
If you click on Menu:Show|Status Bars, then the 'All Classes' button it will show you all of the Stats Bars you have. If it isn't a duplicate status bar then i'm not sure what's causing that to appear.
Reply with quote
Loto
Apprentice


Joined: 05 May 2003
Posts: 194

PostPosted: Tue Dec 23, 2003 6:58 am   
 
Thanks! I don't know how it got there, but I had a status thingy not in a class folder. Thankee kindly, good sir! :D
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