OnEffectFinish: Why it doesn't last?

Post » Tue Jun 19, 2012 11:05 am

I've made the following piece of code:

"[i]Faction Property faMinionState  Auto  {This is the faction that corresponds to the condition of being a minion of the player.}string sOutputEvent OnEffectStart(Actor akTarget, Actor akCaster)if Game.Getplayer() == akCaster   akTarget.AddToFaction(faMinionState)  Debug.Notification("L'incantesimo è stato lanciato dal giocatore!")  sOutput = Game.Getplayer() as String  Debug.Notification("Il mago è " + sOutput )  sOutput = akTarget as String  Debug.Notification("Il bersaglio è " + sOutput )  sOutput = faMinionState as String  Debug.Notification("La fazione è " )Else  Debug.Notification("L'incantesimo è stato lanciato da qualcun'altro!")  sOutput = akCaster as String  Debug.Notification("Il mago è " + sOutput )  sOutput = akTarget as String  Debug.Notification("Il bersaglio è " + sOutput )  Debug.Notification("La fazione non è stata cambiata" )endifakTarget.SetActorValue("aggression", 1)akTarget.SetActorValue("confidence", 0)akTarget.SetActorValue("morality", 0)akTarget.SetActorValue("assistance", 1)EndEventEvent OnEffectFinish(Actor akTarget, Actor akCaster)if Game.Getplayer() == akCaster   akTarget.RemoveFromFaction(faMinionState)endif  Debug.Notification("Cazzo! La magia è già finita!" )akTarget.SetActorValue("aggression", 0)akTarget.SetActorValue("confidence", 4)akTarget.SetActorValue("morality", 3)akTarget.SetActorValue("assistance", 0)endEvent[/i]"

Please...do not consider the notifications in Italian (are done just for debug)...but the problem is this:

I have attached the above said script to this magic effect below:

http://imageshack.us/photo/my-images/442/undeadminion.jpg/

...and the effect was attached to the Raise Zombie spell.

http://imageshack.us/photo/my-images/638/raisezombie.jpg/

...and from the debugging notifications is clear that the effect is finishing just a couple of moments after the casting!

I am not able to understand why this happens! :(

Why the script does that? :((

Does anyone have an hint about this? :(

Please, guys...please...please...help me! :(

Thanks,
Jashkar
User avatar
Ricky Meehan
 
Posts: 3364
Joined: Wed Jun 27, 2007 5:42 pm

Post » Tue Jun 19, 2012 3:03 am

Do you have 'No Duration' checked on the magic effect?
User avatar
D IV
 
Posts: 3406
Joined: Fri Nov 24, 2006 1:32 am

Post » Tue Jun 19, 2012 3:45 am

Do you have 'No Duration' checked on the magic effect?

No... :(
User avatar
Donald Richards
 
Posts: 3378
Joined: Sat Jun 30, 2007 3:59 am

Post » Tue Jun 19, 2012 3:03 pm

You really should surround your code in [code] brackets when you post code. Makes it easier to follow and read. (Also takes up less room on the page.)

You don't show a screenshot of the magic effect in the spell. What is your duration set to?

EDIT: Just to clarify, I want to see the actual page where you set the duration. I know it shows the number in one of your screenshots.
User avatar
Sara Lee
 
Posts: 3448
Joined: Mon Sep 25, 2006 1:40 pm

Post » Tue Jun 19, 2012 4:27 pm

You really should surround your code in [code] brackets when you post code. Makes it easier to follow and read. (Also takes up less room on the page.)

Sorry...I'll change that. :(

You don't show a screenshot of the magic effect in the spell. What is your duration set to?

EDIT: Just to clarify, I want to see the actual page where you set the duration. I know it shows the number in one of your screenshots.

http://imageshack.us/photo/my-images/543/effectitem.jpg/

I've found the "dirty" solution of adding the script to the Reanimate effect (and that works), but I don't like that too much... :( ...as I've said...it's a dirty trick! :(
Thanks,
Jashkar
User avatar
Alessandra Botham
 
Posts: 3440
Joined: Mon Nov 13, 2006 6:27 pm

Post » Tue Jun 19, 2012 2:56 am

I've found the "dirty" solution of adding the script to the Reanimate effect (and that works), but I don't like that too much... :( ...as I've said...it's a dirty trick! :(
Thanks,
Jashkar
You probably don't want to alter the default Reanimate effect. You should duplicate it and start from that.
User avatar
Richard Thompson
 
Posts: 3302
Joined: Mon Jun 04, 2007 3:49 am

Post » Tue Jun 19, 2012 1:57 am



Sorry...I'll change that. :(



http://imageshack.us/photo/my-images/543/effectitem.jpg/

I've found the "dirty" solution of adding the script to the Reanimate effect (and that works), but I don't like that too much... :( ...as I've said...it's a dirty trick! :(
Thanks,
Jashkar
In your code you don't post the actual name of the script.

Is your script formatted like this "ScriptName yourScriptNameHere extends activemagiceffect" ?

If it isn't, that's your problem. If it is, I really have no idea. You could try "duplicating" the Reanimate spell, and then changing the new spell to work how you want it to. That would probably work.
User avatar
Greg Cavaliere
 
Posts: 3514
Joined: Thu Nov 01, 2007 6:31 am

Post » Tue Jun 19, 2012 8:19 am

In your code you don't post the actual name of the script.

Is your script formatted like this "ScriptName yourScriptNameHere extends activemagiceffect" ?

Yes...I made a blunder and didn't add that above. However...the problem isn't in the script, just in the Magic Effect or in its implementation into the spell. :(

If it isn't, that's your problem. If it is, I really have no idea. You could try "duplicating" the Reanimate spell, and then changing the new spell to work how you want it to. That would probably work.

I'll just add the script to all Reanimate spells. It's dirty, but it's also faster... ;)

Thanks,
Jashkar
User avatar
Tamara Primo
 
Posts: 3483
Joined: Fri Jul 28, 2006 7:15 am

Post » Tue Jun 19, 2012 2:08 am

Do you have 'No Duration' checked on the magic effect?

It will have no effect. No Duration means the effect is instant, and any duration field from the actual spell is grayed out.


Jashkar - Am I right in my assumption that you are trying to make a summon spell?

And try checking No Death Dispel.
User avatar
Blessed DIVA
 
Posts: 3408
Joined: Thu Jul 13, 2006 12:09 am

Post » Tue Jun 19, 2012 7:00 am

It will have no effect. No Duration means the effect is instant, and any duration field from the actual spell is grayed out.


Jashkar - Am I right in my assumption that you are trying to make a summon spell?

And try checking No Death Dispel.

No. I was just trying to attach a special faction to Reanimated creatures. :P

However...now I've sticked the script to all the reanimate spell effects and that works... :)

Thanks,
Jashkar
User avatar
Julie Serebrekoff
 
Posts: 3359
Joined: Sun Dec 24, 2006 4:41 am

Post » Tue Jun 19, 2012 1:05 pm

Looking at the magic effect more closely, could the problem be that the magic effect has no visual effects and/or sounds? I tried making a slow time spell that had no effects and it wouldn't cast, then i added in some and it would suddenly work.
User avatar
butterfly
 
Posts: 3467
Joined: Wed Aug 16, 2006 8:20 pm


Return to V - Skyrim