EffectShader on Overriden Class

Post » Sat May 10, 2014 12:41 am

Perhaps a tricky question, but I'm sure someone out there is smart enough to figure this out.

I have created a class which extends ObjectReference to handle coordinated movement of all the pieces of mannequins. It has internal variables to hold the mannequin actor, activator, and xmarker references. It overrides functions for TranslateTo, StopTranslation, Enable and Disable.

Works great and is an eloquent way to move all the pieces of a mannequin as a single entity. I'm planning to do similar for weapon racks etc.

One of the challenges is that I would like to be able to play EffectShaders on objects that are being manipuated as a visual cue to users. This is very easily accomplished on normal ObjectReferences with the EffectShader.Play(objRef, afDuration) function, but I can't seem to figure out how I might get it to work on my class as the actual models are internal.

I suppose I could expose an external method to accomplish the same thing, but that would be pretty ugly.

Thoughts on how this might be accomplished? Is there an event that gets fired off when EffectShaders play?

Many thanks

User avatar
louise tagg
 
Posts: 3394
Joined: Sun Aug 06, 2006 8:32 am

Post » Sat May 10, 2014 1:22 pm

Using the same syntax on your class should work fine, since it extends object reference. If the compiler throws an error, you could instead try

EffectShaderName.Play((obj as ObjectReference), afDuration)

Also keep in mind (if I recall correctly) that particle shaders wont play on anything besides actors, so if your effect shader is only composed of a particle shader it might not show up for that reason.

User avatar
Josh Dagreat
 
Posts: 3438
Joined: Fri Oct 19, 2007 3:07 am


Return to V - Skyrim