Page 1 of 1

Duplicating triggers

Posted: Mon May 03, 2010 7:51 pm
by Meridian
Before I try it and break something, is it possible to register the same pattern multiple times as a trigger, and have it cause different things to occur? For example:

"You have nausea and paralysis." leads to...

pattern: "You have..."
action: aff.nausea = true, raiseEvent("healThisStuff")

pattern: "You have..."
action: aff.paralysis = true, raiseEvent("healThatStuff")

Thanks in advance.
A

Re: Duplicating triggers

Posted: Mon May 03, 2010 8:39 pm
by Vadi
Yes, even duplicate trigger names are allowed.

Think about it though: why have duplicate triggers when you can have 1 trigger, raise 1 event, and multiple handlers that listen on that one even do do their jobs. It's more efficient than matching triggers multiple times.

Re: Duplicating triggers

Posted: Mon May 03, 2010 10:52 pm
by naftali
The advantage to doing things the way Meridian describes is that it is then easy to make lots of different substring patterns do the same thing. I.e. one trigger for everything that afflicts with stupidity, one for everything that paralyzes, etc. Not efficient, but for bashing triggers definitely the easiest way to go about things.

Re: Duplicating triggers

Posted: Tue May 04, 2010 12:07 am
by Vadi
But then you simply enter the multiple patterns as you'd like:

Image

Re: Duplicating triggers

Posted: Thu Apr 02, 2015 11:51 am
by Martin01
I utilize tables a lot within my system, but I am used to Python's table and dictionary types. Unfortunatly, Lua does not have standard ways to manipulate data in a table the way I am used to. (Or at least, none that I have found yet, natively)