Jump to content

[LE] Game time passes on Activator Trigger Script?


Recommended Posts

If you're still trying to figure this out, here's a function I made recently to pass game time:

Function AdvanceGameTime(int HoursToPass)
	if (HoursToPass <= 0)
		HoursToPass = 1
	EndIf
	GlobalVariable GameHr
	GameHr = Game.GetForm(0x00000038) as GlobalVariable
	float t = GameHr.GetValue()
	GameHr.SetValue(t + HoursToPass)
	Debug.Notification(HoursToPass + " hours have passed")
EndFunction

The form 0x00000038 is the GameHour global variable. You should reference it properly with a property in the script, I used the GetForm function out of laziness (didn't feel like adding a property then having to set the value on near 600 forms).

Edited by NeonfireModding
Link to comment
Share on other sites

Awesome!! Thank you for helping me! So to advance the game hours by 6, I would set HoursToPass = 6?
And should I add this line to my teleport script? or add this as a second script to my activator?

This is the teleport script I was given....

Scriptname whatevernameScript extends ObjectReference

ObjectReference Property TargetLocation Auto
;TargetLocation is Xmarker on boat being sailed to

Event OnActivate(ObjectReference akActionRef)
Game.GetPlayer().MoveTo(TargetLocation)
Game.EnableFastTravel()
Game.FastTravel(TargetLocation)
EndEvent



Thank you for taking time to help me!

Link to comment
Share on other sites

  • 3 weeks later...

Hey there internets :D I thought I would end this thread with good news. Thanks to NeonfireModding for the end product! And of course anyone who was kind enough to take time and help me. :smile: If you find this script useful, give NeonfireModding a shout ;P Or at least have a browse of his mod offerings :smile:

So, here is the script..

Teleport to XMarker Heading with time passing value of 8 hours

 

 

Scriptname whatevernameScript extends ObjectReference
ObjectReference Property TargetLocation Auto
;TargetLocation is Xmarker on boat being sailed to
Event OnActivate(ObjectReference akActionRef)
Game.GetPlayer().MoveTo(TargetLocation)
AdvanceGameTime(8)
EndEvent
Function AdvanceGameTime(int HoursToPass)
if (HoursToPass <= 0)
HoursToPass = 8
EndIf
GlobalVariable GameHr
GameHr = Game.GetForm(0x00000038) as GlobalVariable
float t = GameHr.GetValue()
GameHr.SetValue(t + HoursToPass)
Debug.Notification(HoursToPass + " hours have passed")
EndFunction


Thanks again everyone!
Edited by SaulieSaul
Link to comment
Share on other sites

  • 2 years later...

Refined Script Version : Activator To X Marker Heading With Game Time Passing Teleport Script (Adjust Values in Properties)

 

 

 

Scriptname MYSCRIPT extends ObjectReference
Actor Property Player Auto
ObjectReference Property TargetxMarkerHeading Auto
Float Property TimeToPass Auto
GlobalVariable Property GameHour Auto
Event OnActivate(ObjectReference AkActionRef)
if AkActionRef == Player
GameHour.Mod(TimeToPass)
Player.MoveTo(TargetxMarkerHeading)
Game.EnableFastTravel()
Game.FastTravel(TargetxMarkerHeading)
endif
EndEvent
Link to comment
Share on other sites

I do something similar with my Super Fast Input Wait Menu mod. You can use GlobalVariable.Mod instead:

 

GlobalVariable Property GameHour Auto 

Function AdvanceTime(Int Days, Int hours)
    If Days > 0 
        Int I = 0 
        While I < Days 
            I += 1 
            GameHour.Mod(24) ;advance time by 1 day 
        EndWhile 
    Endif 
    
    If Hours > 0 && Hours <= 24 ;cannot mod game hour by more than 24
        GameHour.Mod(Hours)
    EndIf 
EndFunction 

Event OnActivate(ObjectReference akActionRef)
    AdvanceTime(2, 6) ;Advance time by 2 days and 6 hours
Endevent
Link to comment
Share on other sites

  • Recently Browsing   0 members

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