Author Topic: has-time-elapsed in miliseconds?  (Read 1011 times)

0 Members and 1 Guest are viewing this topic.

Offline Mpez

  • 27
has-time-elapsed in miliseconds?
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?

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: has-time-elapsed in miliseconds?
Recent builds, accessible via the nightly builds forum, have mission-time-msecs.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Mpez

  • 27
Re: has-time-elapsed in miliseconds?
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.

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: has-time-elapsed in miliseconds?
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
Code: [Select]
( when
    (>
       (mission-time-msecs)
       (+
            (variable_that_holds_the_stored_timeindex)
            (500)
       )
    )
)
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

  

Offline Mpez

  • 27
Re: has-time-elapsed in miliseconds?
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.
« Last Edit: March 20, 2011, 07:50:47 am by Mpez »