bwins95 Posted August 22, 2015 Share Posted August 22, 2015 (edited) I can't seem to get a loop looking for traps to work. the loop adds a shader to the found items, but it doesn't apply the shader. Here's how it works. This script is on a pair of glasses. putting them on or taking them off turns the global variable on or off. scn aaaaGlowingItems ref rCurrentRef Begin OnEquip player set aaaaGlowingitemsglobal to 1 End Begin OnUnequip player set aaaaGlowingitemsglobal to 0 EndThe global is used in this script to turn the loop on or off. scn aaaaGlowingitemsquestscript ref rCurrentref Begin GameMode if aaaaGlowingitemsglobal == 0 call aaaaglowingitemsshutoff endif if aaaaGlowingitemsglobal == 1 call aaaaglowingitemstrapF {rCurrentRef} call aaaaglowingitemsarmorF {rCurrentRef} call aaaaglowingitemsweaponF {rCurrentRef} call aaaaglowingitemsbooksF {rCurrentRef} call aaaaglowingitemsclothingF {rCurrentRef} call aaaaglowingitemscontainersF {rCurrentRef} call aaaaglowingitemsmiscF {rCurrentRef} call aaaaglowingitemsammoF {rCurrentRef} call aaaaglowingitemsalchemyF {rCurrentRef} call aaaaglowingitemscapsF {rCurrentRef} call aaaaglowingitemsbobbypinsF {rCurrentRef} call aaaaglowingitemsStarcapsF {rCurrentRef} call aaaaglowingitemsplantsF {rCurrentRef} call aaaaglowingitemsmineF {rCurrentRef} call aaaaglowingitemsPrewarF {rCurrentRef} call aaaaglowingitemsCigaretteF {rCurrentRef} call aaaaglowingitemsFactionF {rCurrentRef} call aaaaglowingitemsModF {rCurrentRef} call aaaaglowingitemsStimpakF {rCurrentRef} endif EndWhen the global is turned on it runs through the functions. all of them work except for the trap one. the script is a quest script and is processed every 0.85 seconds. scn aaaaglowingitemstrapF ref rCurrentRef Begin function {rCurrentRef} set rCurrentRef to GetFirstRef 21 1 0 if aaaaGlowingItemstrapNormal == 1 Label 63 if rCurrentRef if aaaaGlowingItemstrap == 1 if rCurrentRef.isinlist aaaaGlowingItemstrapForm == 1 if aaaaGlowingItemstrapGreen == 1 rCurrentRef.PlayMagicShaderVisuals aaaaGlowingItemsShaderGreen 1 elseif aaaaGlowingItemstrapRed == 1 rCurrentRef.PlayMagicShaderVisuals aaaaGlowingItemsShaderRed 1 elseif aaaaGlowingItemstrapBlue == 1 rCurrentRef.PlayMagicShaderVisuals aaaaGlowingItemsShaderBlue 1 elseif aaaaGlowingItemstrapWhite == 1 rCurrentRef.PlayMagicShaderVisuals aaaaGlowingItemsShaderWhite 1 elseif aaaaGlowingItemstrapYellow == 1 rCurrentRef.PlayMagicShaderVisuals aaaaGlowingItemsShaderYellow 1 elseif aaaaGlowingItemstrapPink == 1 rCurrentRef.PlayMagicShaderVisuals aaaaGlowingItemsShaderPink 1 elseif aaaaGlowingItemstrapPurple == 1 rCurrentRef.PlayMagicShaderVisuals aaaaGlowingItemsShaderPurple 1 endif set rCurrentRef to GetNextRef Goto 63 endif endif endif elseif aaaaGlowingItemstrapBright == 1 Label 64 if rCurrentRef if aaaaGlowingItemstrap == 1 if rCurrentRef.isinlist aaaaGlowingItemstrapForm == 1 if aaaaGlowingItemstrapGreen == 1 rCurrentRef.PlayMagicShaderVisuals aaaaGlowingItemsShaderGreenBright 1 elseif aaaaGlowingItemstrapRed == 1 rCurrentRef.PlayMagicShaderVisuals aaaaGlowingItemsShaderRedBright 1 elseif aaaaGlowingItemstrapBlue == 1 rCurrentRef.PlayMagicShaderVisuals aaaaGlowingItemsShaderBlueBright 1 elseif aaaaGlowingItemstrapWhite == 1 rCurrentRef.PlayMagicShaderVisuals aaaaGlowingItemsShaderWhiteBright 1 elseif aaaaGlowingItemstrapYellow == 1 rCurrentRef.PlayMagicShaderVisuals aaaaGlowingItemsShaderYellowBright 1 elseif aaaaGlowingItemstrapPink == 1 rCurrentRef.PlayMagicShaderVisuals aaaaGlowingItemsShaderPinkBright 1 elseif aaaaGlowingItemstrapPurple == 1 rCurrentRef.PlayMagicShaderVisuals aaaaGlowingItemsShaderPurpleBright 1 endif set rCurrentRef to GetNextRef Goto 64 endif endif endif elseif aaaaGlowingItemstrapDim == 1 Label 65 if rCurrentRef if aaaaGlowingItemstrap == 1 if rCurrentRef.isinlist aaaaGlowingItemstrapForm == 1 if aaaaGlowingItemstrapGreen == 1 rCurrentRef.PlayMagicShaderVisuals aaaaGlowingItemsShaderGreenDim 1 elseif aaaaGlowingItemstrapRed == 1 rCurrentRef.PlayMagicShaderVisuals aaaaGlowingItemsShaderRedDim 1 elseif aaaaGlowingItemstrapBlue == 1 rCurrentRef.PlayMagicShaderVisuals aaaaGlowingItemsShaderBlueDim 1 elseif aaaaGlowingItemstrapWhite == 1 rCurrentRef.PlayMagicShaderVisuals aaaaGlowingItemsShaderWhiteDim 1 elseif aaaaGlowingItemstrapYellow == 1 rCurrentRef.PlayMagicShaderVisuals aaaaGlowingItemsShaderYellowDim 1 elseif aaaaGlowingItemstrapPink == 1 rCurrentRef.PlayMagicShaderVisuals aaaaGlowingItemsShaderPinkDim 1 elseif aaaaGlowingItemstrapPurple == 1 rCurrentRef.PlayMagicShaderVisuals aaaaGlowingItemsShaderPurpleDim 1 endif set rCurrentRef to GetNextRef Goto 65 endif endif endif endif Endit was working fine a few days ago and then it stopped working. I'm not sure if it was before or after I changed it to use a form list. the form list contains all the traps that have models. I tried changing it back to looking for a single item and it still didn't work. A terminal or MCM can be used to turn the shader loop on or off.I loaded up a save from when it was working and it still didn't work. I tried stating a new game and it didn't work. I tried disabling the mod and saving then turning it back on and it didn't work. I can't see anyhting wrong with the script. it looks just like all the others that work, but tweaked for the item type ID, form list, and Globals. Edited August 22, 2015 by bwins95 Link to comment Share on other sites More sharing options...
bwins95 Posted August 23, 2015 Author Share Posted August 23, 2015 It's got something to do with the form list part.. Link to comment Share on other sites More sharing options...
Recommended Posts