Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: killface on November 01, 2008, 04:23:13 pm

Title: Random times
Post by: killface on November 01, 2008, 04:23:13 pm

Hey all,

Fairly certain this is simple, but as usual my puttering in Fred is not quite working.  I'm putting together a mission where the sensors are to "scramble" at somewhat random intervals.  Like in a nebula storm, but with longer periods of sensors being clear.  Is there a SEXP strategy I can use to generate a "random" time interval (say 5-15 seconds) at which sensors switch from scrambled to non-scrambled and vice versa?  I'm picturing two chained events with an infinite repeat count, basically just flipping the sensors from one status to the other at a randomized interval.

Thanks,

Seth
Title: Re: Random times
Post by: Mobius on November 01, 2008, 04:29:17 pm
http://www.hard-light.net/forums/index.php/topic,57118.0.html

;)
Title: Re: Random times
Post by: killface on November 01, 2008, 04:39:35 pm

But how do I make it cycle randomly?  Rand-multiple seems like it should be useful, but what I really want is a random INTERVAL before the sexp repeats itself.
Title: Re: Random times
Post by: Mobius on November 01, 2008, 04:58:30 pm
In that case create multiple events with various repeat times to make sure that the effect occurs randomly...or nearly randomly.

The numbers in bold are repeat delays. If the events do the same thing you should get relatively "random" delays between one effect and another. You may use different values.

30, 60, 90, 120...
18, 36, 54, 72...
48, 96, 144, 192...
25, 50, 75, 100...
Title: Re: Random times
Post by: killface on November 01, 2008, 05:13:55 pm

Nice.  Thank you.
Title: Re: Random times
Post by: Mobius on November 01, 2008, 05:16:12 pm
Let us know about the result... :)