Scaling GetSecondsPassed

Post » Fri Jun 17, 2011 3:26 am

Has anyone already done the footwork on scaling GetSecondsPassed to modified timescales, and accounting for slowmo (such as during slowmo kill cam kills)? Actually for that matter, GetSecondsPassed is affected by modified timescales, isn't it?

Basically, I'd like to be able to get the passage of real time accurately; GetSecondsPassed is pretty flawed for this, using it ''as-is.''

Queue
User avatar
Horse gal smithe
 
Posts: 3302
Joined: Wed Jul 05, 2006 9:23 pm

Post » Fri Jun 17, 2011 7:32 am

(Edited: It's been a long day, I misread your post before posting...)

Right, GetSecondsPassed scales along with modified time as the "virtual" time passed. It's not affected by the TimeScale global, but is changed by SetGlobalTimeMultiplier and the multipliers in the CameraShot forms. For getting real time passed, you can use the Script Processing Delay for Quest scripts to create a metronome of sorts, as long as the value is higher than the frame rate, by setting variable to variable + Script Processing Delay. (Or setting a variable to some arbitrary value as a switch, which is reset once the time check is done.)
User avatar
Big Homie
 
Posts: 3479
Joined: Sun Sep 16, 2007 3:31 pm

Post » Fri Jun 17, 2011 6:17 am

Oh, that's a good idea, using another quest with a (relatively, like 1 second) high delay. What I need it for isn't highly precise, so that should work just fine. Two ideas cross my mind:
- start a secondary quest that has a delay I want to check for, and when it fires, have it shut itself down and set a variable in my main quest
- have a second quest running continuously, where it sets a variable every time it fires, that my main quest (that's running every frame) checks, then unsets

Is there no way to read back whatever value is set by SetGlobalTimeMultiplier? Because that's what I'd prefer for a couple GetSecondsPassed spots, just to normalize things. Assuming there's not, I suppose I could run a timed quest script and compare the time I have it set to to the time result of GetSecondsPassed.

Queue
User avatar
Sebrina Johnstone
 
Posts: 3456
Joined: Sat Jun 24, 2006 12:58 pm

Post » Fri Jun 17, 2011 7:41 am

It does not matter what you have 'timescale' set to, GetSecondsPassed always returns the amount of 'real' time that has passed since the last iteration of the script.

This was easily tested by having a script that plays a sound every '5' seconds, calculated with GetSecondsPassed.
No matter what I set the 'timescale' to, it always played every 5 seconds of real time.
User avatar
Tanya Parra
 
Posts: 3435
Joined: Fri Jul 28, 2006 5:15 am

Post » Fri Jun 17, 2011 12:56 am

I think you've misread.

Right, GetSecondsPassed scales along with modified time as the "virtual" time passed. It's not affected by the TimeScale global, but is changed by SetGlobalTimeMultiplier and the multipliers in the CameraShot forms.

User avatar
Melanie Steinberg
 
Posts: 3365
Joined: Fri Apr 20, 2007 11:25 pm


Return to Fallout: New Vegas