Can't figure out for the life of my why this doesn't compile

Post » Wed Jun 20, 2012 7:30 pm

Reasonably simple script. I want to stagger an opponent that hits you, with a 30% random chance.

However I can't understand why this isn't compiling?

Scriptname CPO_OffensiveCancellingScript extends activemagiceffect;Controls the Offensive Cancelling ability. First starts with an OnHit;event that runs a random percent calculation of 30%. If the calculation;suceeds, staggers the akAgressor.Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)if Utility.RandomInt(1, 100) < 30  SendAnimationEvent(akAgressor,"stagger")endifendEvent

Compile error:

Starting 1 compile threads for 1 files...Compiling "CPO_OffensiveCancellingScript"...e:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\CPO_OffensiveCancellingScript.psc(9,21): variable akAgressor is undefinede:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\CPO_OffensiveCancellingScript.psc(9,2): SendAnimationEvent is not a function or does not existNo output generated for CPO_OffensiveCancellingScript, compilation failed.Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on CPO_OffensiveCancellingScript

EDIT: Got rid of the animation error by prefacing it with "Debug." but I still don't know why it can't see what the akAgressor is from the OnHit event.
User avatar
Rob Smith
 
Posts: 3424
Joined: Wed Oct 03, 2007 5:30 pm

Post » Wed Jun 20, 2012 7:01 pm

ObjectReference akAggressor

SendAnimationEvent(akAgressor, "stagger")
User avatar
CSar L
 
Posts: 3404
Joined: Fri Nov 09, 2007 9:36 pm

Post » Wed Jun 20, 2012 1:28 pm

Don't you love it when it's totally obvious :P

Thank you!
User avatar
Sherry Speakman
 
Posts: 3487
Joined: Fri Oct 20, 2006 1:00 pm

Post » Thu Jun 21, 2012 1:36 am

:lmao:
User avatar
Undisclosed Desires
 
Posts: 3388
Joined: Fri Mar 02, 2007 4:10 pm

Post » Wed Jun 20, 2012 1:14 pm

You need "Debug." before SendAnimationEvent(). I don't see that you imported debug and it's throwing an error.


Debug.SendAnimationEvent(akAggressor,"stagger")

EDIT: Saw your edit. I am dumb.
User avatar
Tasha Clifford
 
Posts: 3295
Joined: Fri Jul 21, 2006 7:08 am


Return to V - Skyrim