Every-time-argument

From FreeSpace Wiki
Revision as of 09:47, 31 July 2007 by Shade (talk | contribs) (New page: every-time-argument Every-time-argument (Conditional operator) This is a version of "when-argument" that will always evaluate its arguments. It's useful in situations where you ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
every-time-argument
    Every-time-argument (Conditional operator)
    This is a version of "when-argument" that will always evaluate its arguments. It's useful in situations where you need to
    repeatedly  check things that may become true more than once. Since this sexp will execute every time it's evaluated,
    you may need to use it as an  argument to "when" (not "when-argument") if you want to impose restrictions on how it's called.

    Takes 3 or more arguments...
    1: The arguments to evaluate (see any-of, all-of, random-of, etc.).
    2: Boolean expression that must be true for actions to take place.
    Rest: Actions to take when the boolean expression becomes true.

Comments

When using this, be careful that the conditions for it to trigger will not cause it to accidentally trigger indefinitely. Also, unlike a standard repeating event, there is no simple way to set a delay between triggerings when using every-time, though this can be hacked using a combination of variables and the mission-time SEXP to measure the desired delay - See the Stealthing Ships To Force Target Loss page in FRED_Examples for how this can be done.