Jump to content
target_practice

Regularly repeating trigger

Recommended Posts

Is there a way to make a trigger repeat regularly by itself?

I need a trigger that detects objects within it via thislist to occasionally update the list it creates (which is used by another script).

However it needs to be able to repeat without all objects having to leave its zone first.

Share this post


Link to post
Share on other sites

The trigger assigns the contents of thisList to a variable (which aforementioned script references) within its On Activation field.

Will that be updated too?

Share this post


Link to post
Share on other sites

repeats every one second

this && round (time %1) ==1

repeats every 5 secs ect.

this && round (time %5) ==5

The trigger still needs to be set to repeatable.

  • Like 3

Share this post


Link to post
Share on other sites

Small question, what does the '%' operator actually do/mean?

I haven't been able to find anything on it on the BIKI for some reason.

Share this post


Link to post
Share on other sites

Small question, what does the '%' operator actually do/mean?

I haven't been able to find anything on it on the BIKI for some reason.

https://community.bistudio.com/wiki/a_%25_b

 

Divide or Mod according to the above, after reading it it may also work without the round command but I haven't checked.

Share this post


Link to post
Share on other sites

Since I'm using this on a multiplayer mission, I'd assume it would be a good idea to use serverTime to avoid desync.

EDIT: Also for clarity, I should add that the purpose of me refreshing the listing is in the hope that, coupled with the other script occasionally looping,  it will cause AI to re-use vehicles that have been destroyed and respawned; something which they otherwise seem unable to do.

Share this post


Link to post
Share on other sites
On 11/24/2016 at 7:41 AM, f2k sel said:

repeats every one second


this && round (time %1) ==1

repeats every 5 secs ect.


this && round (time %5) ==5

The trigger still needs to be set to repeatable.

I'm looking for a solution and this does not work.  The trigger does not execute even once.

Share this post


Link to post
Share on other sites
1 hour ago, Sertica said:

I'm looking for a solution and this does not work.  The trigger does not execute even once.

You're hacking an old post. If you need help despite your effort to find a solution, just write a new topic with a clear need.

There are plenty of ways to run a script regularly. But some of them will be more accurate for your aim (if you can tell about it).

Share this post


Link to post
Share on other sites
6 hours ago, pierremgi said:

You're hacking an old post. If you need help despite your effort to find a solution, just write a new topic with a clear need.

There are plenty of ways to run a script regularly. But some of them will be more accurate for your aim (if you can tell about it).

I'm using hints to display data while I play test sequences in the editor.  The text needs to update every x seconds.

Share this post


Link to post
Share on other sites

if you remove  this &&  from the command it should work in your case

 

 

Share this post


Link to post
Share on other sites
5 hours ago, f2k sel said:

if you remove  this &&  from the command it should work in your case

That is what I did.  But I found the problem.  It was set to use timeout.

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

×