[SCRIPT HELP] DELAY

Post » Mon Jun 18, 2012 3:32 pm

Scriptname MYSPELLScript extends ActiveMagicEffectVisualEffect Property MYSPELL  Auto	EVENT OnEffectStart(Actor Target, Actor Caster)			selfRef = caster   	 MYSPELL.Play(selfRef, -1)	ENDEVENT		Event OnEffectFinish(Actor akTarget, Actor akCaster)   	 MYSPELL.Stop(selfRef)	ENDEVENT

So I have this visual effect for my spell above. How would I delay the OnEffectFinish for 10 seconds?
I want the player to be able to cast it ONLY while they are walking, but when they start running it dispels instantly.

How do I get it so it dispels after 10 seconds when they start running? Like a fade. I don't have a clue how to set up the
delay.

Thanks!
User avatar
naomi
 
Posts: 3400
Joined: Tue Jul 11, 2006 2:58 pm

Post » Mon Jun 18, 2012 5:50 pm

You can use the http://www.creationkit.com/Wait_-_Utility function to add a delay to a script.

Cipscis
User avatar
sophie
 
Posts: 3482
Joined: Fri Apr 20, 2007 7:31 pm

Post » Mon Jun 18, 2012 9:15 am

Thank you Cipscis!

Okay because I'm really dumb at this stuff.

Where would this go in my script?... Based on what I said?
User avatar
Dawn Porter
 
Posts: 3449
Joined: Sun Jun 18, 2006 11:17 am

Post » Mon Jun 18, 2012 4:26 am

Assuming this is the behaviour you want:
- OnEffectFinish event fires as soon as they start running
- 10 seconds after they start running, call Stop on MySpell

This should do the trick:
Event OnEffectFinish(Actor akTarget, Actor akCaster)	Utility.Wait(10)	MYSPELL.Stop(selfRef)EndEvent

Cipscis
User avatar
MISS KEEP UR
 
Posts: 3384
Joined: Sat Aug 26, 2006 6:26 am

Post » Mon Jun 18, 2012 6:11 am

Thought so, but didn't want to break anything.

Everything checks out. Thank you kindly for your great help! =)
User avatar
KIng James
 
Posts: 3499
Joined: Wed Sep 26, 2007 2:54 pm


Return to V - Skyrim