|
geosmith Wanderer
Joined: 23 Apr 2005 Posts: 57
|
Posted: 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. |
|
|
|
geosmith Wanderer
Joined: 23 Apr 2005 Posts: 57
|
Posted: 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? |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Sat Aug 13, 2005 3:51 am |
The Pattern in an expression trigger is formated like this
#TR () {}
not
#TR {} {} |
|
|
|
|
|