a while ago, wrinklyninja posted a script in the All Natural thread that would allow a light to be turned off if activated. I recently discovered this post and was very excited by the idea of having an "Extinguish the Lights" type mod that could be easily made for All Natural-Real Lights, so I tried knocking up a quick global script that would add wrinklyninja's script to every non-scripted light reference in the player's current cell. I tested it out, and it worked for the most part. Unfortunately, it seems that if there are multiple lights with the same base object, only one of the lights can be turned off/on. The other references with that base object remain unaffected. I guess this has to do with the script being added to the base object, rather than being added to each unique reference, but both my modding and my programming knowledge are rather limited, so I have no idea how I would fix this problem. Help would be greatly appreciated. Here are the two relevant scripts, the first one being wrinklyninja's light extinguisher, the second one being my global script.
scn aaPapAddScriptsScriptfloat fQuestDelayTimeref lightRefref LightScriptshort iniBegin GameMode if ini == 0 set ini to 1 set LightScript to aaPapLightTest endif let fQuestDelayTime := 1 set lightRef to GetFirstRef 26 Label 10 if ( lightRef ) ; continue until all refs are processed if lightRef.IsScripted == 0 lightRef.SetScript LightScript endif set lightRef to GetNextRef Goto 10 endifend
scn aaPapLightTestarray_var rgbarray_var rgbbaseshort flamesshort waitBegin OnActivatelet rgb := GetLightRGBif Eval (rgb[0] + rgb[1] + rgb[2] > 0) let rgbbase := rgb SetLightRGB ar_List 0 0 0 set flames to 1elseif Eval (rgb[0] + rgb[1] + rgb[2] == 0) SetLightRGB rgbbase set flames to 2endifUpdate3Dprintc "LightTggle"EndBegin GameModeif wait if CanHaveFlames if flames == 1 RemoveFlames else AddFlames endif endif set wait to 0 set flames to 0endifif flames set wait to 1endifEnd
Cheers,
Papierhut