Jump to content

Light On/Off due to weather - script


Recommended Posts

Hi,

 

i need help again... The following script does not work (compile) for Fallout 4. I tried to get a script that turns on/off lights due to weather conditions. Rainy weather should turn on the lights and no more raining turn off the lights. If someone knows how this script should look like or has an funtioning script that turns lights on/off depending on weather conditions -> very happy!!!!

 

 

 

Scriptname CBJE_LightOnWeather extends ObjectReference

ObjectReference Property MainLight Auto

Event OnInit()
Self.StartTimer(1, 0)
EndEvent

Event OnTimer(int aiTimerID)
If (Weather.GetCurrentWeather().GetClassification() == 2)
GoToState("LightsOn")
Else
GoToState("LightsOff")
EndIf
Self.StartTimer(1, aiTimerID)
EndEvent

Event OnLoad()
Self.StartTimer(1, 0)
EndEvent

Event OnUnload()
Self.CancelTimer(0)
EndEvent

State LightsOn

Event OnBeginState()
MainLight.Enable()
EndEvent

EndState

State LightsOff

Event OnBeginState()
MainLight.Disable()
EndEvent

EndState

Link to comment
Share on other sites

  • Recently Browsing   0 members

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