SKKmods Posted February 26, 2020 Share Posted February 26, 2020 I need game time to pass without player interaction or UI. To avoid adding hours to GameHour which can trip midnight forcing tests for 30/31 day month rollovers and then year rollovers, the function Game.PassTime(int aiHours) looks sweet. But, no matter what INT value is used, Game.PassTime() increments GameDaysPassed by exactly 4 days and 4 hours per call on two separate clean Fallout4.exe 1.10.163 .0 installs. I notice that PassTime is commented out of the two base game scripts it appears in MQ04IrmaReject and DLC03:DLC03_V118_QuestScript (1) Is this a new regression, or a known issue that is not published anywhere google can find ? (2) Any alternatives (that don't involve odd month calculations) ? Link to comment Share on other sites More sharing options...
niston Posted February 26, 2020 Share Posted February 26, 2020 I wanted to use PassTime() for the nuka world glory bus transit, but couldn't get it to work. Didn't work on it in quite a while, but my alternative plan was to adjust the fast travel speed multiplier (bus goes faster than walking) and then use scripted fast travel instead. Link to comment Share on other sites More sharing options...
DieFeM Posted March 6, 2020 Share Posted March 6, 2020 This is the best solution that I found, I tested it and it seems to work fine, probably the timescale value can be better adjusted, but that's the general idea: Function PassTime(int aiHours) GlobalVariable TimeScale = Game.GetFormFromFile(0x0000003A, "Fallout4.esm") As GlobalVariable StartTimerGameTime(aiHours) TimeScale.SetValue(10000) EndFunction Event OnTimerGameTime(int aiTimerID) GlobalVariable TimeScale = Game.GetFormFromFile(0x0000003A, "Fallout4.esm") As GlobalVariable TimeScale.SetValue(30) EndEvent Link to comment Share on other sites More sharing options...
SKKmods Posted March 6, 2020 Author Share Posted March 6, 2020 The good news is that Mod() automatically manages game day, month, year rollover so simply using that: pGameHour.Mod(fTravelGameHours) Link to comment Share on other sites More sharing options...
DieFeM Posted March 6, 2020 Share Posted March 6, 2020 Awesome :laugh: :thumbsup:, thanks SKK50. Link to comment Share on other sites More sharing options...
pra Posted June 24, 2021 Share Posted June 24, 2021 But, no matter what INT value is used, Game.PassTime() increments GameDaysPassed by exactly 4 days and 4 hours per call on two separate clean Fallout4.exe 1.10.163 .0 installs. You don't happen to remember how you called it? Right now, I noticed that while calling it with 5 as argument, and assumed that the function actually tries to pass 5 RL hours. Because 5(irl hours) * 20(scale) = 100(in-game hours), and 100/24 makes 4.1666..., or 4 days and 4 hours. But good to know that changing GameHour handles rollover, thanks for that! edit: I have done more testing.So calling the function with 3 also makes it wait 100 in-game hours. So it is probably always 100 hours, no matter what you give it. On the up side, incrementing GameHour also affects GetCurrentGameTime* and GameTime timers. ____* If you try to measure the time before and after doing that, you have to do Utility.wait(0.1) after incrementing GameHour. It seems to continue with the script before it actually processes the time progressing Link to comment Share on other sites More sharing options...
pra Posted March 24 Share Posted March 24 Thread necromancy! I've been doing some testing yesterday, and, it seems, GameHour does NOT handle rollover properly. It works, if you want to advance the time by one day at most, but not more. This is what I did: debug.TraceUser(LOG_NAME, "Needed time "+timeToPass) debug.TraceUser(LOG_NAME, "GameHour before = "+GameHour.getValue()+", gametime before "+Utility.GetCurrentGameTime()) GameHour.mod(timeToPass) debug.TraceUser(LOG_NAME, "GameHour after = "+GameHour.getValue()+", gametime after "+Utility.GetCurrentGameTime()) And the output was: Needed time 759.229980 GameHour before = 14.640729, gametime before 0.610032 GameHour after = 773.870728, gametime after 1.244614 My code had a bug where it would calculate a way too large value for timeToPass. That number comes to about a month, not just one day. Doing some more math: 14.640729 / 24 = 0.610030375, which is close enough to the gametime before (probably some seconds missing or such) 773.870728 / 24 = 32.24461367. The decimals are similarily close enough to the decimals of gametime after, but the day itself got only advanced by 1, not by 32. What I think is going on is that the game is doing GameHour mod 24, and then, if the result ends up less than what it used to be before, it advances the game by one day. Link to comment Share on other sites More sharing options...
LarannKiar Posted March 24 Share Posted March 24 The only functions I can add to this discussion are the [ Set TimeScale to fValue ] and [ SetGlobalTimeMultiplier fValue ]. Set TimeScale to advance game time and SetGlobalTimeMultiplier to speed up time (latter speeds up character movement, animations and voices too..). Link to comment Share on other sites More sharing options...
Recommended Posts