Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Mpez on March 20, 2011, 07:02:40 am
-
I've been working on a cutscene in slow-mo and I need events to happen in, for example, a half of a second, or less so I've been wondering if there is a way to control time more efficiently. Has-time-elapsed and the majority of other sexps have a delay in seconds. Are there sexps that let you do sth after a number in milliseconds?
-
Recent builds, accessible via the nightly builds forum, have mission-time-msecs.
-
Are there any workarounds using the standard builds? Also, I would be very grateful if you would post a basic example of using the mission-time-msecs sexp.
-
Workarounds for standard builds include having a stealthed ship far off in the distance travelling a set of waypoints at a known speed and using its progress as a timing method.
mission-time-msecs works just like mission-time, it returns a numeric value that you can store in a variable and compare against. Say you have an event A and an event B. You want B to start 500 ms after A started, so what you'd do is store what mission-time-msecs returns when A is evaluated in a variable, and have B's start trigger be something like
( when
(>
(mission-time-msecs)
(+
(variable_that_holds_the_stored_timeindex)
(500)
)
)
)
-
Workarounds for standard builds include having a stealthed ship far off in the distance travelling a set of waypoints at a known speed and using its progress as a timing method.
I'm using that already. Problems occur when I want to change the camera's position in a time shorter than a second.
EDIT: Oh, wait. Didn't understand that correctly at first. That's a great idea. Thanks!
mission-time-msecs works just like mission-time, it returns a [...]
Thanks :) I'll download one of the recent builds and try it tomorrow.