Jump to content
Sign in to follow this  
Gil Galvanti

Trigger Activation Each Time?

Recommended Posts

Hey,

Is it possible to have a trigger activated each time the condition is satisfied, even if it has already been satisfied? For example, say the trigger is tripped by the presence of civilians. If one civilian walks into it and trips it, is there a way to set it to be activated again by any subsequent civilians walking into it, while the others that originally activated it remain in the trigger area?

Share this post


Link to post
Share on other sites

Yes,

Click one of the options that says Continues activations... Or whatever it says... I don't know it off the top of my head.

Share this post


Link to post
Share on other sites

Activation ===== Once - Repeatedly in the trigger screen.

Share this post


Link to post
Share on other sites

Quote from the wiki

If an activation is set to "repeatedly" the trigger first has to be 'deactivated' before it can fire again (e.g. if a unit activated the trigger by entering it, it will first have to leave it, before the trigger can become active again.)

So I doubt that this will work.. If you however tell us what your up to then we could probably find a solution for it.

Share this post


Link to post
Share on other sites

You can deactivate a trigger with use of a variable.

create a variable in an object or game logic init datrig=true

set your trigger to repeat

in the condition of the trigger it would be datrig or this and datrig

in the on act put datrig = false

on dea put datrig = true

A trigger only repeats every 0.5 secs so if you need to check anything faster than that then you need to use scripting.

There is another way of doing a true repeating trigger but I always forget how to do it, I think it has something to do with a time check.

Edited by F2k Sel

Share this post


Link to post
Share on other sites
So I doubt that this will work.. If you however tell us what your up to then we could probably find a solution for it.

Depending on his condition it will work just fine. It's only for conditions that won't deactivate that it won't work for.

Share this post


Link to post
Share on other sites

No, I have it set to repeated. It only reactivates after it is deactivated. I'll have to play around with deactivating it with a trigger, but not sure that would work either.

What I'm trying to do specifically is detect when someone is "trespassing" on someone else's property. It only works when the owner of the property is home though, so since the trigger is set to activate in the presence of a civilian, it automatically trips to start with since he is a civ, even though it's his own property. But in my scripts, I have ignoring the trigger if the owner is the only one in the trigger list. But then if a civ runs onto the property, it isn't detected because the trigger isn't reactivated since it's already activated by the owner himself being home.

Edited by Gil Galvanti

Share this post


Link to post
Share on other sites

Try using this condition:

{_X != owner} count thislist > 0

Where owner is the civ who owns that property. This will be active while there is someone other than the owner in the trigger area, and will deactivate when nobody or just the owner is present. If you want it to repetedly activate regardless if the first guy leaves or not:

First set: intruders = 0

Condition:

{_X != owner} count thislist != intruders

On Act:

intruders = {_X != owner} count thislist

This will fire every time an intruder enters AND exits the area. If you ad an if statement before you reassign intruders, you can check whether someone entered or if someone left:

On Act:

if({_X != owner} count thislist > intruders)then{hint "New intruder!"}; intruders = {_X != owner} count thislist

Share this post


Link to post
Share on other sites
Try using this condition:

{_X != owner} count thislist > 0

Where owner is the civ who owns that property. This will be active while there is someone other than the owner in the trigger area, and will deactivate when nobody or just the owner is present. If you want it to repetedly activate regardless if the first guy leaves or not:

First set: intruders = 0

Condition:

{_X != owner} count thislist != intruders

On Act:

intruders = {_X != owner} count thislist

This will fire every time an intruder enters AND exits the area. If you ad an if statement before you reassign intruders, you can check whether someone entered or if someone left:

On Act:

if({_X != owner} count thislist > intruders)then{hint "New intruder!"}; intruders = {_X != owner} count thislist

Ok, I'll try that out, thanks :). I'm confused though, what is _X? It's never defined...is it like thisList where it's an automatically set variable?

EDIT: Hmmm...not working, maybe because I'm not understanding what _X is?

Edited by Gil Galvanti

Share this post


Link to post
Share on other sites

did you name the civ owner and set the variable intruders = 0 in an init.

Share this post


Link to post
Share on other sites

I changed owner to the unit name, and I was trying the first one that didn't use intruders. Any idea what _X is though? Does it need to be defined?

---------- Post added at 12:04 AM ---------- Previous post was Yesterday at 11:30 PM ----------

Ah, got it working, turns out I was already defining the trigger statements in a script which was overwriting what I was putting in the editor :). I'd still like to know what "_X" variable holds though.

Share this post


Link to post
Share on other sites

Well I suck at explaining stuff but it kind of extracts all the variables from a list or group.

It gets an element of an array

It doesn't need defining.

if you had say 5 units in a trigger

then in the on act you can do things like this.

{_x setdamage 1} foreach thislist

That would kill all the units it finds when the conditions are meet _x would be the unit.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×