Jump to content

An armor that plays an effect shader when the actor dies


SeraVerte

Recommended Posts

I did some testing for another forum user a few months ago. It seems that the shader can be applied to an armor when it is in the inventory or when the armor is not equipped, but it won't work if the armor is equipped (but you can play the shader on the whole body).

 

Try this script, I haven't tested it but it is based on a similar working script from here.

 

Scriptname SPSEffectTest extends ObjectReference
{Plays an effect shader when the wearer of this armor dies}

EffectShader property myShader auto
{Assign your shader of choice to this property}

Actor Victim

Event OnEquipped(Actor akActor)
Victim = akActor ; store the wearer's reference for later
EndEvent 

Event OnUnequipped(Actor akActor) 
If Victim != None
        myShader.Stop(akActor) ; kill the effect when the armor is removed
	Victim = None
EndIf
EndEvent

Event OnDeath(Actor akKiller)
If Victim != None
        myShader.Play(Victim) ; play the effect when the wearer dies
EndIf
EndEvent

Link to comment
Share on other sites

  • 3 weeks later...
Thanks, but I'm trying to find a way to apply the shader only on the armor. I know it can be done, as on numerous occasions, I've seen an effect shader (disintegrate) that was supposed to be applied on the whole body bugged out and only played on the armor (effectively making the armor fade away, leaving the body). In fact, that bug was how I came up with the idea, in the first place.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...