Play animation script syntax

Post » Fri Jul 26, 2013 10:09 am

Hi! I've been out of modding for a while and I can't seem to remember what little I knew to begin with. I'd like to finish a mod I started, I lost the scripts when I reinstalled. I decided to just start from scratch.

I'm looking to make a spell, when hit, the target plays a certain animation. I want it to only work if the target is a hostile(and human shaped but I have no idea about this part).

Here's all I have:

Scriptname AceFearScript extends ActiveMagicEffect  If akActor.IsHostileToActor()  Debug.SendAnimationEvent(SpellSubject,"IdelCower")  UnregisterForUpdate()  endif
User avatar
Heather Stewart
 
Posts: 3525
Joined: Thu Aug 10, 2006 11:04 pm

Post » Thu Jul 25, 2013 11:38 pm


Scriptname AceFearScript extends ActiveMagicEffect  Actor Property PlayerRef autoKeyword Property ActorTypeNPC auto Idle Property IdleCower auto ; check these properties in the CKEvent OnEffectStart(Actor akTarget, Actor akCaster)If akTarget.IsHostileToActor(PlayerRef)&& akTarget.HasKeyword(ActorTypeNPC)   Debug.SendAnimationEvent(akTarget,"IdleCower") ; or you could try this instead; akTarget.PlayIdle(IdleCower)endifendevent
User avatar
Emily Martell
 
Posts: 3469
Joined: Sun Dec 03, 2006 7:41 am

Post » Fri Jul 26, 2013 11:58 am

It won't compile:

AceFearScript.psc(0,-1): mismatched input '' expecting ENDEVENT
No output generated for AceFearScript, compilation failed.

I also don't know what you mean by "Idle Property IdleCower auto ; check these properties in the CK". IdleCower is the animation name.

EDIT:

I added endevent at the end and it compiled. Checking now.

Instantly crashed my game. Tried it on a human and a Reikling.

I now understand what you meant by check these properties in the CK. I'm not sure what I'm looking for though. I have 3 properties:

ActorTypeNpc Keyword

IdleCower Idle

PlayerRef Actor

User avatar
Kevin Jay
 
Posts: 3431
Joined: Sun Apr 29, 2007 4:29 am

Post » Thu Jul 25, 2013 8:01 pm

You have to check whether the properties match the actual names or not. I'm away from the CK so now so I can't check.

If AutoFill works, then there's nothing to worry about, otherwise you have to manually adjust the properties yourself.

Since this crashes, hmm, is this spell aimed or an AOE spell? I think the reason why is because the idle is not defined properly in SendAnimationEvent. You have to go to the Animation tab and check for the ID yourself.

Otherwise, try commenting out Debug.SendAnimationEvent(akTarget,"IdleCower")

and uncomment akTarget.PlayIdle(IdleCower)

User avatar
Rhi Edwards
 
Posts: 3453
Joined: Fri Jul 28, 2006 1:42 am


Return to V - Skyrim