Warfare Incorporated :: View topic - Alternative for 'Every NN Seconds' condition
Warfare Incorporated Forum Index
 FAQ   Search   Memberlist   Usergroups 
 Profile   Log in to check your private messages   Log in 
 
Alternative for 'Every NN Seconds' condition

 
Post new topic   Reply to topic    Warfare Incorporated Forum Index -> Mission Authoring
View previous topic :: View next topic  
Author Message
ajcross
Very Active User


Joined: 23 Dec 2003
Posts: 113
Location: Kansas City

PostPosted: Tue May 11, 2004 9:28 am    Post subject: Alternative for 'Every NN Seconds' condition Reply with quote

I found an alternative for Every NN Seconds because I had too many apparently. This uses a flag in the condition to tell when to retrigger the condition.

Condition
Mission Loaded
Action:
...
Set persistent variable 'flag' to "0"
...

Condition:
Persistent variable 'flag' is Exactly 0
... other conditions ...
Action:
Set persistent variable 'flag' to 1
Preserve trigger
Wait 10 seconds
...other actions...
Set persistent variable 'flag' to "0"

This starts with the condition active and does the actions after the conditions are ment and after the wait time. This is like Every NN seconds.

You can have the trigger actions fire right away by moving the ...other actions... above the Wait

Condition:
Persistent variable 'flag' is Exactly 0
... other conditions ...
Action:
Set persistent variable 'flag' to 1
Preserve trigger
...other actions...
Wait 10 seconds
Set persistent variable 'flag' to "0"

You can trigger it to fire right away based on other triggers.
Condition:
... other conditions ...
Action:
... other actions...
Set persistent variable 'flag' to "0"
... other actions...

You can have it disabled to start and trigger it as above. This is nice because Every NN triggers every nn seconds based on elapsed time. This will start it from the first time the trigger is set off.
Condition
Mission Loaded
Action:
...
Set persistent variable 'flag' to "1"
...

_________________
Andy Cross
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Warfare Incorporated Forum Index -> Mission Authoring All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2002 phpBB Group