Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: FelixJim on July 26, 2010, 05:09:19 pm

Title: Tentative Idea: when-delay
Post by: FelixJim on July 26, 2010, 05:09:19 pm
I don't know if this sort of thing has been discussed before, which wouldn't surprise me given what I would imagine to be a useful sexp. Essentially this stems from trying to FRED something, and ending up wishing that the logical operators had delay settings like sexps such as is-destroyed-delay have. After some thought however, I realised that a new conditional, called "when-delay" or somesuch, would be far more useful and flexible, with 3+ arguments; the boolean expression, the delay, and then the action to take when condition is true and delay had been waited out.
I don't think there's a simple way to FRED around this (all I've come up with is chained events (only practical in non-repeating events (I think?)) or saving mission time to a variable and then setting up mission time > variable +5 in the next event) which is why I've popped this here rather that in FREDing discussion.

Anyway, just thought I'd throw that out there (regardless of the inevitable feasibility issues).
Title: Re: Tentative Idea: when-delay
Post by: The E on July 26, 2010, 05:19:53 pm
Actually, there are several options to do this using existing sexps. Chain delay settings or the mission-time sexp (in combination with variables), in combination with the "<", ">", and "and" operators can do just what you are asking for.

Also, chained events can be set to repeat just fine, you just have to make sure that all events in a chain are repeatable (via the trigger count and repeat count options).

Oh, and don't forget the ever useful "interval time" field.
Title: Re: Tentative Idea: when-delay
Post by: FelixJim on July 27, 2010, 09:30:29 am
I'm currently using the mission-time and variables trick, but something in me baulks a little at having to set up an a whole extra event just because I want my first one to call a couple of seconds later. Maybe that's just me though.