Jump to content

Recommended Posts

Posted

Hey all I am trying to create a script so that when an actor is hit by a spell, that actor plays an animation.

Bool property CeaseBlocking auto
String property StopAnimation auto
Bool property CeaseAttacking auto
String property PlayAnimation auto

function OnEffectFinish(Actor akTarget, Actor akCaster)

    if !akTarget.IsDead()
        debug.SendAnimationEvent(akTarget as objectreference, StopAnimation)
    endIf
endFunction

function OnEffectStart(Actor akTarget, Actor akCaster)

    if CeaseBlocking
        debug.SendAnimationEvent(akTarget as objectreference, "AttackStop")
    endIf
    if CeaseAttacking
        debug.SendAnimationEvent(akTarget as objectreference, "BlockStop")
    endIf
    debug.SendAnimationEvent(akTarget as objectreference, PlayAnimation)
endFunction

 

But for some reason I cannot get it to work. Any help is appreciated. The script compiles but nothing happens in game

Posted

Make sure your magiceffect script even starts at all. Depending how your effect and spell are setup, you might require a duration on the spell to be at least one second to get script actions to happen

If that isn't the issue, you might have animation prereqs to workaround. Def make sure it is even triggering the event at all first though IMO. Like a messagebox or something

Posted
18 hours ago, Sphered said:

Make sure your magiceffect script even starts at all. Depending how your effect and spell are setup, you might require a duration on the spell to be at least one second to get script actions to happen

If that isn't the issue, you might have animation prereqs to workaround. Def make sure it is even triggering the event at all first though IMO. Like a messagebox or something

Thank you I ended up using a different script and it worked perfectly! Thank you so much for answering Sphered!

  • Recently Browsing   0 members

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