Script for Lighting automatically turning off?

Post » Tue Jan 11, 2011 11:29 am

Hi,

Very new to modding but getting on ok, building a player home and have some nice lamps, inside and out. I'm using lighting objects and at night it looks very good. During the day it looks silly though as the area is over lit and too bright. Is there a simple way, a script maybe, that will turn the lights on and off when it is night and day?

Also if it is a script I need, and I add it to the object will that effect all instances of those lights in the game?
User avatar
Doniesha World
 
Posts: 3437
Joined: Sun Jan 07, 2007 5:12 pm

Post » Tue Jan 11, 2011 6:47 pm

Since there are multiple lights you want on the same timer, it would be best to set ParentLightREF as the enable parent all of the others so they don't have to be persistent.
Spoiler
scn AutoLightingQuestSCPT Begin GameMode	If (GameHour >= 19.5) ; 7:30pm		If ParentLightREF.GetDisabled			ParentLightRef.Enable		EndIf	ElseIf (GameHour >= 6) ; 6am		If ParentLightREF.GetDisabled		Else			ParentLightREF.Disable		EndIf	EndIfEnd
I'd have a quest running with the above script and set the quest delay to 60 or so. Having only one persistent reference to check every once in a while will keep it 'cheap' while using object script(s) is more 'expensive' as they would run every frame.

For a lamp activator:
Spoiler
scn SwitchLightingObjectSCPT Ref rLightBegin OnReset	If rLight		rLight.Disable		rLight.MarkForDelete		Set rLight to 0	EndEnd;==================================Begin OnActivate	Set bLightsOn to (bLightsOn == 0)	If bLightsOn		If rLight			If rLight.GetDisabled				rLight.Enable				End		Else			Set rLight to PlaceAtMe LIGH		EndIf	Else		rLight.Disable	EndIfEnd

User avatar
Roddy
 
Posts: 3564
Joined: Fri Jun 15, 2007 11:50 pm


Return to Fallout: New Vegas