Jump to content

Photo

Light On/Off due to weather - script

light; switch; weather; script;

  • Please log in to reply
No replies to this topic

#1
Citizenbari

Citizenbari

    Regular

  • Members
  • PipPip
  • 74 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  







Also tagged with one or more of these keywords: light;, switch;, weather;, script;

Page loaded in: 1.018 seconds