View Single Post
  #3  
Old 05-17-2012, 01:26 PM
moggel moggel is offline
Approved Member
 
Join Date: Mar 2011
Posts: 70
Default

Quote:
Originally Posted by Smokeynz View Post
I'm trying to solve a similar(maybe the same objective) with real time at the moment to be able to reset a mission without reloading it. As you mention mostly we are dealing with Time.current() from the start of mission to cycle or run timers. It is not in game realtime.

In old IL2 it was tod (time of day) and you could just send a new time of day to the server or host by console or script.

I have found the following, I'm not sure if they are the same as Time.current()
ITime()
GamePlay.gpTime()
GamePlay.gpTime().current()

But up to now I haven't been able to parse them to a "reporting" hud or serverlog to see what they report. They wont convert to a string, int or double. (I think I'm just doing it wrong at present due to not knowing syntax).
Once we know what it is by type, in theory we should be able to alter gpTime()

Another way I have been considering is to create a section file of the "TIME" set out in the mis file under [MAIN] (I already do this with a number of other things). However this may not work as new sub missions ignore sections of sub missions including the Time value.
Because of this battle may need to be stopped to invoke a time change. In which case just reloading the main mission with an altered TIME may work, the catch is the CS itself, you can't run 2 occurances of the same CS and if you destroy the CS you are in you can't restart unless you monitor externally, like with clod commander....but this is clumsy just to reset the time!

I'm sure it is realtively simple once we identify the syntax and gameplay code to work with.

Might need help from the experienced coders on this one.
In my little experiment I've been reading those values. They are all of type 'double' and reflects the number of seconds elapsed since the mission started. So far I haven't been able to find any way to figure out the in-game time (what the pilot reads from the dashboard clock). If only there was a way to get the mission start time it would be a simple matter of adding the GamePlay.gpTime() value to the start time to get the in-game time. But I have not been able to find a way to obtain the mission start time and that's where I'm stuck at the moment.
__________________
Core i7 3930K @ 4.8GHz; 16Gb DDR3 (Vengeance); nVidia GTX580; OS disk: 150Gb 10000rpm; SIM disk: 300Gb 10000rpm; Windows 7 x64 Ultimate
Reply With Quote