Jump to content

[Script] Advance Time


Recommended Posts

I did a custom function for this end :

Bool Function PassGameTimeHours(Int iHours) Global
	Game.FadeOutGame(true, true, 0.0, 2.5)
	GlobalVariable GameHour = Game.GetFormFromFile(0x00000038, "Fallout4.esm") As GlobalVariable
	Int i = iHours
	While i > 0
		GameHour.Mod(1.0)
		Utility.Wait(2.5/iHours)
		i -= 1
	EndWhile
	Return True
EndFunction

It worked right in my tests, if you find problems let me know.

Link to comment
Share on other sites

Note that forcing time to advance faster than the system can finish processing updates can lead to sequencing issues. Scripts running GameTime timers, AI travel packages current positon sort of thing. Which is why wait and sleep can take variable amounts of real time to pass to allow those updates to process.

Link to comment
Share on other sites

I've just read that a plugin for F4SE that executes console commands from papyrus was recently published for Fallout 4, Console Util.

So the safest way (due to the potential problems described by SKK) could be calling passtime command.

 

ConsoleUtil.ExecuteCommand("PassTime 72");72 hours (3 days)

Link to comment
Share on other sites

On the subject of Timers:

 

They do not fire during sleep/wait/fasttravel at all. Instead, they will fire once after. And if normal operation would have fired them multiple times during the timespan covered by sleep/wait/fasttravel, they will still only fire once. This may or may not be a problem, depending on use case - But if it is, it must be accounted for by the script that uses the timer.

 

I assume if you advance the time by script, timers will fire during that manipulation, in stark difference to how sleep/wait/fasttravel works.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...