Jump to content
Sign in to follow this  
Impavido

Repeating detection trigger

Recommended Posts

Having some problems with an area trigger that detects when one side is present. When that side is present the trigger activates a script with the "foreach thislist" command. It is supposed to add to a scoring variable that will add a score for each solfier in the area.

For example: the team will get 1 point per minute for 1 soldier in the area, or 2 points per minute for 2 soldiers in the area.

However this dosent seem to work. The trigger modifies the score only once, but then not again while the soldier is still in the area. It only works if the soldier leaves and ren-enters.

Any suggestions on how to get it to continuously accrue a score variable within the trigger?

Share this post


Link to post
Share on other sites

That is how repeating triggers work. They only activate when the condition is true and the trigger is not active, and only deactivate when the condition is not true and the trigger is active.

I'd try using a looping script that does something like this :

while trigger active then addscore (foreach...);

sleep Time

repeat

Share this post


Link to post
Share on other sites

But then how would that scoring script stop when the character was killed or exited the trigger area?

Could I use some command to take a tally or total of the characters present in the trigger?

Share this post


Link to post
Share on other sites

Use list - an array of the units within the trigger area that satisfy the trigger's condition. If they die or leave the area, they won't appear in the list.

eg, (forEach...) would be something like forEach (list myTrigger)

You may need multiple triggers and scripts on the same location, depending on what you are trying to achieve.

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  

×