bwins95 Posted November 7, 2013 Share Posted November 7, 2013 I'm not really sure how to describe what I want, so I'll use skyrim as an example since I know what I'm doing in it. Is their a way to attach a script to an item that would play a shader on it when it is hit by anything. in skyrim I use a quest with reference aliases looking for a specific keyword or formlist. when the keyword is found it fills an alias that has an onhit scripts attached to it and plays a shader. Link to comment Share on other sites More sharing options...
rickerhk Posted November 7, 2013 Share Posted November 7, 2013 You can use a ref-walk to look for specific type of objects or references then play a shader on them. Reference walking: http://www.cipscis.com/fallout/tutorials/loops.aspxhttp://geck.bethsoft.com/index.php?title=PlayMagicShaderVisuals Link to comment Share on other sites More sharing options...
bwins95 Posted November 7, 2013 Author Share Posted November 7, 2013 (edited) Thank you. that is what I wanted. I've just got a small problem. the shader doesn't play when I equip the item. the message box appears for each item that is found. scn GlowingItemsTestref rCurrentRefbegin OnEquip player ShowMessage aa set rCurrentRef to GetFirstRef 27 1 0 Label 10 if rCurrentRef PlayMagicShaderVisuals fxSearchAndMark pms fxSearchAndMark 10 set rCurrentRef to Pencil01 ; Prevent apple bug set rCurrentRef to GetNextRef ShowMessage aaaa Goto 10 endifEnd Edited November 7, 2013 by bwins95 Link to comment Share on other sites More sharing options...
rickerhk Posted November 7, 2013 Share Posted November 7, 2013 you have to specify the reference to play the shader on. rCurrentRef.PlayMagicShaderVisuals fxSearchAndMarkand for the second part rCurrentRef2.PlayMagicShaderVisuals fxSearchAndMark Link to comment Share on other sites More sharing options...
bwins95 Posted November 7, 2013 Author Share Posted November 7, 2013 (edited) you have to specify the reference to play the shader on. rCurrentRef.PlayMagicShaderVisuals fxSearchAndMarkand for the second part rCurrentRef2.PlayMagicShaderVisuals fxSearchAndMarkThank you. I got it mostly working. What I need is for it apply the shader to more then one item. right now it only affects one item and after the shader wears off it doesn't apply it to the one item or anything else. scn GlowingItemsTestref rCurrentRefref rCurrentRef2Begin OnEquip player set rCurrentRef to GetFirstRef 24 1 0 ; Actors Label 10 if rCurrentRef rCurrentRef.PlayMagicShaderVisuals fxSearchAndMark 5 set rCurrentRef to Pencil01 ; Prevent "apple" bug with GetNextRef set rCurrentRef to GetNextRef endif set rCurrentRef2 to GetNextRef 40 1 0 ; Actors if rCurrentRef2 rCurrentRef2.PlayMagicShaderVisuals fxSearchAndMark 5 set rCurrentRef2 to Pencil01 ; Prevent "apple" bug with GetNextRef set rCurrentRef2 to GetNextRef Goto 10 endifEnd Edited November 7, 2013 by bwins95 Link to comment Share on other sites More sharing options...
jazzisparis Posted November 7, 2013 Share Posted November 7, 2013 You can't REF walk over two different form types within the same loop. Try this: scn GlowingItemsTest ref rCurrentRef begin OnEquip player set rCurrentRef to GetFirstRef 24 1 0 Label 1 if IsFormValid rCurrentRef rCurrentRef.PlayMagicShaderVisuals fxSearchAndMark 5 set rCurrentRef to Pencil01 set rCurrentRef to GetNextRef GoTo 1 endif set rCurrentRef to GetFirstRef 40 1 0 Label 2 if IsFormValid rCurrentRef rCurrentRef.PlayMagicShaderVisuals fxSearchAndMark 5 set rCurrentRef to Pencil01 set rCurrentRef to GetNextRef GoTo 2 endif end Link to comment Share on other sites More sharing options...
bwins95 Posted November 7, 2013 Author Share Posted November 7, 2013 You can't REF walk over two different form types within the same loop. Try this: scn GlowingItemsTest ref rCurrentRef begin OnEquip player set rCurrentRef to GetFirstRef 24 1 0 Label 1 if IsFormValid rCurrentRef rCurrentRef.PlayMagicShaderVisuals fxSearchAndMark 5 set rCurrentRef to Pencil01 set rCurrentRef to GetNextRef GoTo 1 endif set rCurrentRef to GetFirstRef 40 1 0 Label 2 if IsFormValid rCurrentRef rCurrentRef.PlayMagicShaderVisuals fxSearchAndMark 5 set rCurrentRef to Pencil01 set rCurrentRef to GetNextRef GoTo 2 endif end Thank you. this is just what I was looking for. Link to comment Share on other sites More sharing options...
Recommended Posts