Magic Effect Script Messing Up

Post » Wed Jun 20, 2012 8:03 am

NVM - Sorted

Thanks Random. Works great!
User avatar
herrade
 
Posts: 3469
Joined: Thu Apr 05, 2007 1:09 pm

Post » Wed Jun 20, 2012 6:18 am

I can only think of using two scripts. You keep this one the same but remove the dripping effect. In your second script, put in a function to control the dropping effect.

In the OnEffectStart of your current script, you should add in a line to stop the function in the second script. Maybe just use UnregisterForUpdateGameTime(). In the OnEffectFinish, you should add a line to start the function in the second script. Maybe just use RegisterForUpdateGameTime().
User avatar
Lance Vannortwick
 
Posts: 3479
Joined: Thu Sep 27, 2007 5:30 pm

Post » Wed Jun 20, 2012 5:52 am

Cheers sent you a PM, but just going to bump it in case anyone else has any ideas. I am a very visual person so I need someone to edit my script so I can actually read and learn what to do in the future.

Sorry for the trouble.
User avatar
Georgine Lee
 
Posts: 3353
Joined: Wed Oct 04, 2006 11:50 am

Post » Wed Jun 20, 2012 6:25 am

I'm posting it here because now that I think about it, my idea will only work if you use it for just one NPC.

The magic effect script:
Spoiler
Scriptname OpticWaterFXSwimScript extends ActiveMagicEffect  ;Simple script to determine when swim/drip FX is applied.MyFunctionScript property MyFunction autoVisualEffect Property RainVisual  Auto  VisualEffect Property SwimVisual  AutoActor selfRefimport utilityEVENT OnEffectStart(Actor Target, Actor Caster);Start Swim FX, no art.    selfRef = caster    MyFunction.PlayVisualEffect(selfRef, false, RainVisual)    SwimVisual.Play(selfRef)ENDEVENTEVENT OnEffectFinish(Actor akTarget, Actor akCaster)    SwimVisual.Stop(selfRef);Stop swim FX.    MyFunction.PlayVisualEffect(selfRef, true, RainVisual, 0.14)ENDEVENTEVENT OnDeath(actor myKiller);We are dead, end FX.    RainVisual.Stop(selfRef)    SwimVisual.Stop(selfRef)ENDEVENT

The function:
Spoiler
Scriptname MyFunctionScript extends QuestActor MyActorVisualEffect MyVEFunction PlayVisualEffect(Actor Target = None, Bool Start = True, VisualEffect VE = None, Float Duration = 0.0)    if !Start        VE.Stop(Target)        UnregisterForUpdateGameTime()    else        VE.Play(Target)        RegisterForSingleUpdateGameTime(Duration)        MyActor = Target        MyVE = VE    endifEndFunctionEvent OnUpdateGameTime()    MyVE.Stop(MyActor)    MyVE = None    MyActor = NoneEndEvent
User avatar
Leah
 
Posts: 3358
Joined: Wed Nov 01, 2006 3:11 pm

Post » Wed Jun 20, 2012 3:00 pm

Yeah that's cool. Only want it for player atm.

Thanks for your time! Will give it a bash and hopefull I won't run into any problems.

Thanks again!
User avatar
Chloe Yarnall
 
Posts: 3461
Joined: Sun Oct 08, 2006 3:26 am

Post » Wed Jun 20, 2012 1:01 am

I am still new to using states in scripts but would this be of use to you? have a state for when you are swimming, one for running/ standing still and when its raining?
User avatar
Julie Ann
 
Posts: 3383
Joined: Thu Aug 23, 2007 5:17 am


Return to V - Skyrim