Help! Script is not working...

Post » Mon Jun 18, 2012 3:09 pm

I am trying to make it when I hit a person with a spell, they will do a slash animation. But, for some reason it won't work:

Scriptname aaBess extends ObjectReferenceActor MeActiveMagicEffect GetTargetActor()Event OnInit()Me = GetTargetActor()	  Me.PlayAnimation("ihm_attackpowerright")EndEvent

required (...)+ loop did not match anything at input '('
User avatar
c.o.s.m.o
 
Posts: 3419
Joined: Sat Aug 12, 2006 9:21 am

Post » Mon Jun 18, 2012 9:47 pm

Bump for Importance.
User avatar
Alisha Clarke
 
Posts: 3461
Joined: Tue Jan 16, 2007 2:53 am

Post » Mon Jun 18, 2012 11:50 pm

This line looks like it's trying to define a variable name as "GetTargetActor()", which won't work.
ActiveMagicEffect GetTargetActor()

Your script should extend http://www.creationkit.com/ActiveMagicEffect_Script, I believe, which would allow you to associate it with your magic effect. Try this:
ScriptName aaBess extends ActiveMagicEffectEvent OnEffectStart(Actor akTarget, Actor akCaster)	akTarget.PlayAnimation("ihm_attackpowerright")EndEvent

Does that code compile? If not, what error does it give? If it does, does it work when you associate that script with your magic effect?

Cipscis
User avatar
Spaceman
 
Posts: 3429
Joined: Wed May 23, 2007 10:09 am

Post » Mon Jun 18, 2012 2:22 pm

This line looks like it's trying to define a variable name as "GetTargetActor()", which won't work.
ActiveMagicEffect GetTargetActor()

Your script should extend http://www.creationkit.com/ActiveMagicEffect_Script, I believe, which would allow you to associate it with your magic effect. Try this:
ScriptName aaBess extends ActiveMagicEffectEvent OnEffectStart(Actor akTarget, Actor akCaster)	akTarget.PlayAnimation("ihm_attackpowerright")EndEvent

Does that code compile? If not, what error does it give? If it does, does it work when you associate that script with your magic effect?

Cipscis

Ok it worked. Thanks Cipscis! You can't comprehend what a help you are to me. One more question though, can I begin a line with "If" in Papyrus? I'm so used to Oblivion scripting I'm not sure what works still.
User avatar
Kelly John
 
Posts: 3413
Joined: Tue Jun 13, 2006 6:40 am

Post » Mon Jun 18, 2012 7:04 pm

Hmm... wait. I test in game, but when I cast the spell at them, they do nothing. Any tips?
User avatar
Penny Wills
 
Posts: 3474
Joined: Wed Sep 27, 2006 6:16 pm

Post » Mon Jun 18, 2012 3:47 pm

Conditional functions still work like in Oblivion - they still use the "if", "elseif", "else" and "endif" keywords.

Try adding a call to http://www.creationkit.com/Notification_-_Debug in your script to check that it's running when it's supposed to. What have you attached it to at the moment?

Cipscis
User avatar
Sian Ennis
 
Posts: 3362
Joined: Wed Nov 08, 2006 11:46 am

Post » Mon Jun 18, 2012 3:27 pm

Added a notification. When I cast the spell, the actor does nothing. But, I do see the notification.
User avatar
Andrea Pratt
 
Posts: 3396
Joined: Mon Jul 31, 2006 4:49 am

Post » Mon Jun 18, 2012 9:26 pm

Regardless of the script I have found the playanimation function to be extremely unreliable. You might want to try the "playIdle" function which I have had more (but not much more) success with.
User avatar
Invasion's
 
Posts: 3546
Joined: Fri Aug 18, 2006 6:09 pm

Post » Mon Jun 18, 2012 6:38 pm

Regardless of the script I have found the playanimation function to be extremely unreliable. You might want to try the "playIdle" function which I have had more (but not much more) success with.

Can PlayIdle use animation that don't have the Idle prefix?
User avatar
Kelli Wolfe
 
Posts: 3440
Joined: Thu Aug 23, 2007 7:09 am

Post » Mon Jun 18, 2012 7:41 pm

I'm currently trying "PlayGamebryoAnimation". Will report results.
User avatar
Rowena
 
Posts: 3471
Joined: Sun Nov 05, 2006 11:40 am

Post » Mon Jun 18, 2012 9:49 pm

Completely stuck. Does the PlayAnimation function even work?
User avatar
Oscar Vazquez
 
Posts: 3418
Joined: Sun Sep 30, 2007 12:08 pm

Post » Mon Jun 18, 2012 12:33 pm

Are either of these posts useful? http://www.gamesas.com/topic/1344517-playsubgraphanim-and-playsyncanim/page__view__findpost__p__20267453, http://www.gamesas.com/topic/1343921-script-to-change-activator-animation-idle/page__view__findpost__p__20260468

Cipscis
User avatar
Lynne Hinton
 
Posts: 3388
Joined: Wed Nov 15, 2006 4:24 am


Return to V - Skyrim