Need Some Direction with Some "Unique" Spell Effects

Post » Wed Jun 20, 2012 9:35 am

I've been working on my Lich mod for a bit now, and up until this point I've been using placeholder spell effects/animations. Quite frankly they look like crap, and I'm not so sure where to start to make them look better. Any direct help or direction pointing would be appreciated here, I'm completely new to the visual side of spell effects. I could simply play around with them, and I intend to do just that, but there are certain things I'm unsure about that I'd like to have clarified before I attempt to mess with them.

The first thing I'm looking to set up is a set of "combo" spells. I want the player to use a concentration spell on a target. If that target is an NPC Actor that is dead, I want it to apply a visual effect to him. (Something like the SoulTrap effect, but lighter.) As the player continues to channel at the target, I want the glow to become brighter and brighter. After a certain point, I want it to cap out. If the player stops channeling the spell on the target for any amount of time at all, the effect should fade completely.

The second part of the combo, would be a long channeling spell with a dark effect. Kind of like the bound weapon spells but not quite. If there's a "unique" 1h spell casting animation for powerful spells I'd like to play that too, but I don't know if there is one. Once he fully "builds up" the spell and releases it, it should run a script on the target. This script should only succeed if the target is at the "cap stage" of the concentration spell.

Now, I have a general idea of how to do most of that. I can make a really long cast time for the second spell, give it effects through the effect window, and run a script using "OnMagicEffectStart". The part that I really don't think I'd be able to do, is the "accumulating spell effect" from the concentration spell. I'm also not too sure how scripts work on concentrated spells. Will the script run several times per second because it's concentration? Or will the script only run once every time it finds a new target?

Any help is appreciated, thanks.
User avatar
Clea Jamerson
 
Posts: 3376
Joined: Tue Jun 20, 2006 3:23 pm

Post » Thu Jun 21, 2012 12:15 am

Anyone? To be honest I could figure most of this on my own if I just knew how to accumulate a shader effect on a target through a concentration spell.
User avatar
Naughty not Nice
 
Posts: 3527
Joined: Sat Nov 04, 2006 6:14 am

Post » Thu Jun 21, 2012 12:19 am

Working on it.
User avatar
Benji
 
Posts: 3447
Joined: Tue May 15, 2007 11:58 pm

Post » Wed Jun 20, 2012 11:59 am

Okay, here's what I have, but there's one small problem. For some reason it won't recognize IsCasting as existing, even though it totally does.
Scriptname NonsenseScript extends activemagiceffect EffectShader Property WhateverShader1  Auto EffectShader Property WhateverShader2  Auto EffectShader Property WhateverShader3  Auto EffectShader Property WhateverShader4  Auto EffectShader Property WhateverShader5  Auto Event OnEffectStart(Actor akTarget, Actor akCaster)int shaderlevel =0float playduration = 0   if akTarget.IsDead()==1	  While (akCaster as Form).IsCasting() as bool ==1 && shaderlevel < 6		 Utility.Wait(2)		 shaderlevel = shaderlevel+1		 playduration = (5 +- shaderlevel) * 2		 if shaderlevel ==1		    WhateverShader1.Play(akTarget as ObjectReference, playduration)		 endIf		 if shaderlevel ==2		    WhateverShader2.Play(akTarget as ObjectReference, playduration)		 endIf 		 if shaderlevel ==3		    WhateverShader3.Play(akTarget as ObjectReference, playduration)		 endIf 		 if shaderlevel ==4		    WhateverShader4.Play(akTarget as ObjectReference, playduration)		 endIf 		 if shaderlevel ==5		    WhateverShader5.Play(akTarget as ObjectReference, playduration)		 endIf  	  endWhile  endIfendEvent

Basically what this will do make it so that as you cast it longer and longer for 10 seconds it will add a series of shaders, which will play until the spell climixes. Every two seconds a new shader is applied, each one (if you make them this way) a bit brighter than the last.
User avatar
Isabel Ruiz
 
Posts: 3447
Joined: Sat Nov 04, 2006 4:39 am

Post » Wed Jun 20, 2012 5:57 pm

Okay, here's what I have, but there's one small problem. For some reason it won't recognize IsCasting as existing, even though it totally does.
Scriptname NonsenseScript extends activemagiceffectEffectShader Property WhateverShader1  AutoEffectShader Property WhateverShader2  AutoEffectShader Property WhateverShader3  AutoEffectShader Property WhateverShader4  AutoEffectShader Property WhateverShader5  AutoEvent OnEffectStart(Actor akTarget, Actor akCaster)int shaderlevel =0float playduration = 0   if akTarget.IsDead()==1	  While (akCaster as Form).IsCasting() as bool ==1 && shaderlevel < 6		 Utility.Wait(2)		 shaderlevel = shaderlevel+1		 playduration = (5 +- shaderlevel) * 2		 if shaderlevel ==1			WhateverShader1.Play(akTarget as ObjectReference, playduration)		 endIf		 if shaderlevel ==2			WhateverShader2.Play(akTarget as ObjectReference, playduration)		 endIf		 if shaderlevel ==3			WhateverShader3.Play(akTarget as ObjectReference, playduration)		 endIf		 if shaderlevel ==4			WhateverShader4.Play(akTarget as ObjectReference, playduration)		 endIf		 if shaderlevel ==5			WhateverShader5.Play(akTarget as ObjectReference, playduration)		 endIf  	  endWhile  endIfendEvent

Basically what this will do make it so that as you cast it longer and longer for 10 seconds it will add a series of shaders, which will play until the spell climixes. Every two seconds a new shader is applied, each one (if you make them this way) a bit brighter than the last.
Awesome, wasn't expecting a full blown script to be made for me, thanks!
As far as the "iscasting" not registering, is it perhaps because you're casting it as a form? Or does "IsCasting" only work on form objects?

EDIT: Ok I see, isCasting isn't working at all. Tried playing around with some typecasting but I couldn't get it to register (I imagine you did the same). I'm going to experiment with this for a bit and see if I can get it working. Thanks for the help.
User avatar
Tyrone Haywood
 
Posts: 3472
Joined: Sun Apr 29, 2007 7:10 am

Post » Wed Jun 20, 2012 4:21 pm

Awesome, wasn't expecting a full blown script to be made for me, thanks!
As far as the "iscasting" not registering, is it perhaps because you're casting it as a form? Or does "IsCasting" only work on form objects?

EDIT: Ok I see, isCasting isn't working at all. Tried playing around with some typecasting but I couldn't get it to register (I imagine you did the same). I'm going to experiment with this for a bit and see if I can get it working. Thanks for the help.

I was bored, figured I'd help a brother out.
User avatar
Casey
 
Posts: 3376
Joined: Mon Nov 12, 2007 8:38 am

Post » Wed Jun 20, 2012 5:14 pm

I was bored, figured I'd help a brother out.
Appreciate it. :smile:

I did some experimenting, and this is what I'm deciding to go with. I haven't fully tested it yet (Haven't set up the actual shaders, just did messageboxes), but I think it will work. Turns out concentration spells only run "OnMagicEffectStart" the moment they acquire a new target, and the moment they lose that target (either from the player stopping casting or by moving his crosshairs off of the target), the effect ends and "OnMagicEffectFinish" starts up. Even after the effect finishes though, the script in the effectStart will still loop. So what I do is I make the loop check for the effect itself. If it isn't there, stop looping, if it is, keep upgrading.
Scriptname Lich02PrepareHostEffectScript extends activemagiceffect{Prepares a target host for host swapping.}Actor Property Player AutoKeyword Property ActorTypeNPC AutoEffectShader Property PossessionShader1  AutoEffectShader Property PossessionShader2  AutoEffectShader Property PossessionShader3  AutoEffectShader Property PossessionShader4  AutoEffectShader Property PossessionShader5  AutoEvent OnEffectStart(Actor akTarget, Actor akCaster)	; Only run if they are dead and are NPC actors	If akCaster == Player && akTarget.IsDead() == 1 && akTarget.HasKeyWord(ActorTypeNPC)				; Initialize the possession level		int PossessionLevel = 0		; Only upgrade the shader if the target still has the spell cast on them, and if we aren't at maximum possession level		While PossessionLevel < 6 && akTarget.HasMagicEffect(GetBaseObject())						; Wait 3 seconds between each upgrade			Utility.Wait(3)			PossessionLevel+= 1						; When upgrading to a new shader, remove the old one first			;Debug.Notification("Removing Shader Level: " + (PossessionLevel - 1) + " Playing Shader Level: " + PossessionLevel)			If PossessionLevel == 1				PossessionShader1.Play(akTarget as ObjectReference, 9999)			ElseIf PossessionLevel == 2				PossessionShader1.Stop(akTarget as ObjectReference)				PossessionShader2.Play(akTarget as ObjectReference, 9999)			ElseIf PossessionLevel == 3				PossessionShader2.Stop(akTarget as ObjectReference)				PossessionShader3.Play(akTarget as ObjectReference, 9999)			ElseIf PossessionLevel == 4				PossessionShader3.Stop(akTarget as ObjectReference)				PossessionShader4.Play(akTarget as ObjectReference, 9999)			ElseIf PossessionLevel == 5				PossessionShader4.Stop(akTarget as ObjectReference)				PossessionShader5.Play(akTarget as ObjectReference, 9999)			EndIf		EndWhile	EndIf	EndEventEvent OnEffectFinish(Actor akTarget, Actor akCaster)	;Debug.Notification("Removing All Shaders")	PossessionShader1.Stop(akTarget as ObjectReference)	PossessionShader2.Stop(akTarget as ObjectReference)	PossessionShader3.Stop(akTarget as ObjectReference)	PossessionShader4.Stop(akTarget as ObjectReference)	PossessionShader5.Stop(akTarget as ObjectReference)EndEvent

Now I just need to set the "PossessionLevel" variable to be located in a host script, and have my other spell check for that before it runs. Thanks for the help!
User avatar
Katie Pollard
 
Posts: 3460
Joined: Thu Nov 09, 2006 11:23 pm

Post » Wed Jun 20, 2012 8:09 pm

No prob brah.
User avatar
Matthew Aaron Evans
 
Posts: 3361
Joined: Wed Jul 25, 2007 2:59 am

Post » Wed Jun 20, 2012 9:59 pm

I struggled with a scripted concentration effect for a while. Here are my http://forums.nexusmods.com/index.php?/topic/565749-spell-script-not-working-as-intended/page__p__4585684__fromsearch__1#entry4585684 on the matter

Edit: the method you're using looks more sleek though, mine required a spell and an ability to watch it. Do you get multiple instances of that script running on the target? I found that scripts on concentration spells behaved oddly which is why I had to use an ability with mine.
User avatar
Jordan Fletcher
 
Posts: 3355
Joined: Tue Oct 16, 2007 5:27 am

Post » Wed Jun 20, 2012 7:13 pm

I struggled with a scripted concentration effect for a while. Here are my http://forums.nexusmods.com/index.php?/topic/565749-spell-script-not-working-as-intended/page__p__4585684__fromsearch__1#entry4585684 on the matter

Edit: the method you're using looks more sleek though, mine required a spell and an ability to watch it. Do you get multiple instances of that script running on the target? I found that scripts on concentration spells behaved oddly which is why I had to use an ability with mine.
I was kind of scared of using scripts on concentration spells at first because of what you described, but it seems to me like it does not work that way at all. Like I said in the previous post, I haven't had a chance to "really" test it, but as far as the messageboxes go, it all appears to be working perfectly.

I have a concentration aimed spell effect that has the script attached. This effect is added to a spell that is, of course, concentration/aimed as well. However, I noticed other concentration spells include a duration of 1 second, so I made sure my spell had the same.

It does not appear to run multiple times. The moment I begin casting the spell, nothing happens, but if the "spray" hits an actual target, the "OnScriptEffectStart" event fires up. It does not continue to fire multiple times, only the one. However, the instant I stop casting, or if I lose my target somehow, the script expires and runs the "OnSpellEffectFinish" event.

Also, as I stated in my previous post, the "OnSpellEffectStart" event will continue to run code for as long as it is told to, even after the spell effect fades. If you use a loop or a timer in that event, you have to find a way to exit the script quickly if that is your desire. (I just used an if block to detect if the magic effect was still applied to the target. The moment it isn't, the loop stops.)
User avatar
SUck MYdIck
 
Posts: 3378
Joined: Fri Nov 30, 2007 6:43 am


Return to V - Skyrim