Removing FX Ingame

Post » Mon Jun 18, 2012 2:56 pm

In a mod which I am currently in the process of creating I have a diamond with a light and affect which makes it look like light is focusing through the diamond. However, when I pick up the diamond from mid-air the effect and light obviously remains. How do I make it so that the two effects disappear? I need the diamond to be take-able as part of a quest. I have not got any experience scripting so if that is what is required could someone tell me how do it or at least point me to where I could find out. This is my first attempt at a mod.

Thanks

PS On a side note, does anyone know how I could make the diamond rotate or wobble in the air?
User avatar
Nick Jase Mason
 
Posts: 3432
Joined: Sun Jul 29, 2007 1:23 am

Post » Mon Jun 18, 2012 9:52 pm

http://www.creationkit.com/Stop_-_EffectShader for an FX Shader and http://www.creationkit.com/Disable_-_ObjectReference for a light.

Spoiler
ScriptName YourDiamondScriptEffectShader Property SomeFXShader AutoBool Property bPlayerHasTakenItem = FalseObjectReference Property YourLightREFR AutoFloat fZRotation = 0Event OnLoad()	If !bPlayerHasTakenItem		RegisterForUpdate(0.1) ; Speed of rotation determined here	EndIfEndEvent;=================================Event OnUnload()	If !bPlayerHasTakenItem		UnregisterForUpdate() ; No need to keep spinning	EndIfEndEvent;=================================Event OnUpdate()	fZRotation += 1	SetAngle(0.0, 0.0, fZRotation) ; SpinEndEvent;================================Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)	If akNewContainer		SomeFXShader.Stop(Self)		If akNewContainer == Game.GetPlayer()			If !bPlayerHasTakenItem				bPlayerHasTakenItem = True				UnregisterForUpdate()				YourLightREFR.Disable()			EndIf		EndIf	Else;If !akNewContainer		SomeFXShader.Play(Self)	EndIfEndEvent
...might work?
User avatar
Leonie Connor
 
Posts: 3434
Joined: Mon Mar 12, 2007 4:18 pm


Return to V - Skyrim