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
geosmith
Wanderer


Joined: 23 Apr 2005
Posts: 57

PostPosted: Fri Aug 12, 2005 10:50 pm   

Expression Trigger Question
 
This is a little frustrating actually, because I'm sure I'd managed to do this last week, but now can't for the life of me remember how...

Expression triggers.

I'm trying to create one such that when @currenthealth is less than or equal to @maxhealth minus 40, and when a couple of other variables equal 1, the trigger fires.

I seem to remember whatever I'd worked out made use of %eval, but I'm struggling to get it working again.

Any advice on this particular example would be appreciated, as would any advice on writing expression triggers generally, as the help file seems somewhat lacking in that respect.

Thanks.
Reply with quote
geosmith
Wanderer


Joined: 23 Apr 2005
Posts: 57

PostPosted: Sat Aug 13, 2005 2:43 am   Solution?
 
Okay, I think I've worked this out, but could still do with a second opinion...

#TRIG {(%eval(@currenthealth<=(@maxhealth-40)) AND (@variable1=1) AND (@variable2=1))} {response}

One other question though... because expression triggers are checked every time any variable is changed, would relying upon a number of them for something complicated like an affliction-curing script slow things down considerably?
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sat Aug 13, 2005 3:51 am   
 
The Pattern in an expression trigger is formated like this

#TR () {}
not
#TR {} {}
_________________
Zmud Support Library
Zmud Knowledge Base
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