Duplicating triggers

Post Reply
Meridian
Posts: 6
Joined: Thu Dec 10, 2009 11:57 pm

Duplicating triggers

Post 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

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Duplicating triggers

Post 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.

naftali
Posts: 138
Joined: Wed Jan 20, 2010 8:42 pm

Re: Duplicating triggers

Post 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.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Duplicating triggers

Post by Vadi »

But then you simply enter the multiple patterns as you'd like:

Image

Martin01
Posts: 1
Joined: Thu Apr 02, 2015 11:46 am

Re: Duplicating triggers

Post 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)
HyBriDe TEkkEN

Post Reply