Jump to content

problem getting debug.sendanimationevent to go through


3aq

Recommended Posts

script is below.

 

I plan to have the script attached to a spell. for ex. candlelight, assuming that it works it after the actor casts the spell, he/she will be forced to do the sAction that is filled in the properties field ex. "dance", or one of the events here https://www.creationkit.com/index.php?title=Animation_Events.

 

problem is it doesn't seem at all to be working how I envisioned it. help and assistance is kindly appreciated, thank you =)

scriptName _OnEffectDoAction extends activemagiceffect  

string property sAction auto

Event OnEffectStart (Actor akTarget, Actor akCaster)
	debug.SendAnimationEvent(akCaster, sAction)
	debug.notification("doing action")
endEvent


Link to comment
Share on other sites

Using "OnEffectStart" will start the magic effect on the target, you need to use a different approach, like :
Function Cast(ObjectReference akSource, ObjectReference akTarget = None) native
OR
bool Function RegisterForAnimationEvent(ObjectReference akSender, string asEventName) native
So that when the spell gets cast the animation will play on the caster intead of the target.
* There are other ways you can also do this, the above is just examples.

 

* Be sure to have a valuable animation event name in your string properties.

Edited by maxarturo
Link to comment
Share on other sites

even if the magic effect is using akCaster? (which should be self?)

 

regardless, I'll keep what you said in mind, thank you maxarturo =)

Link to comment
Share on other sites

Here is a portion of a "kind of similar" working script as yours, so you take an idea :

spell thats makes the player and the target play a random animation.

 

 

Idle Property akIdle0 Auto
... continuous
 
spell Property akSpell Auto
... continuous
 
Float DamAugment
 
Event OnEffectStart(Actor akTarget, Actor akCaster)
           DamAugment = Game.GetPlayer().getAV("OneHanded*5")
           akSpell.Cast(Game.GetPlayer(), Game.GetPlayer())
           Game.GetPlayer().MoveTo(aktarget)
           int random = Utility.RandomInt(0, 4)
        If Random == 0
           Game.GetPlayer().PlayIdleWithTarget(akIdle0, akTarget)
           Utility.Wait(2)
           akTarget.DamageAV("Health", DamAugment)
           Actor RandomActor1 = Game.FindRandomActorFromRef(Game.GetPlayer(), 1000)
           AkSpell2.Cast(RandomActor1, RandomActor1)
  EndIf
... continuous

 

 

Edited by maxarturo
Link to comment
Share on other sites

Also try this :

debug.SendAnimationEvent(ActorRef, sAction)

 

Don't forget to add a ActorRef properties in your script and fill it with the actor casting the spell.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...