Jump to content

[LE] How to stop attack animations of the NPC that to start other animations?


myav

Recommended Posts

This is an unconventional approach.

- registerForAnimationEvent

- OnAnimationEvent

- SendAnimationEvent

- wait x sec for the npc to rise the shield

- cast on him a freeze spell with none of the freeze visual FX (blank FXs - casting the spell from the script and not making the player cast the spell), just to keep him in place for 2 sec.

- do what you need with him from here...

Edited by maxarturo
Link to comment
Share on other sites

maxarturo, can you give me more details?

1. Which animation to register and which animation to send?

 

2. How to create freeze spell? I didn't find freeze variant in the Magic Effect > Effect Archetype

 

*if to use paralysis - NPC fall on the ground and ignore all block commands

*if to use template: FreezeSlowEffect, this only slow movement speed, but dont freeze the character

*if to use stagger (even with none Visual FX) NPC play stagger animation and ignore block too

 

NexusComa, during combat AI ignore faction changes and relation changes while CombatTarget != none. And no commands that to reset it, except StopCombat. But if to stop combat => AI will hide weapons, and without weapons - ignore all block commands. If you know THE WAY how to make friendly NPC without stop combat - pls write, and i'll test blocking

Edited by myav
Link to comment
Share on other sites

"1. Which animation to register and which animation to send?"

This was just an idea of how you could make such a thing work. I don't actually know what you are trying to do and i'm making my proposals based on the limited info you have provided.


"2. How to create freeze spell? I didn't find freeze variant in the Magic Effect > Effect Archetype"

I didn't say to make a 'freeze spell', but to mimic its effect.

You will need to start digging deeper into this, start by studying how the "Wall Of Frost" spell works, the spell has two effects in it that influence the npc's movement.

Slow : SpeedMult

Deep Freeze Paralysis

The "Slow : SpeedMult" can work if you just need 2 sec for the npc to stay in one pose.

There are also other spells that affect SpeedMult, i just picked the first one that came to mind.


* Sometimes you need to find a workaround for your issue, and that workaround my need its own workaround.


* If all your hope lies in doing this just by scripting, then you won't get anywhere... something like this needs outside the box thinking.

Link to comment
Share on other sites

testing continues...

 

NPC with maces/axes (with two-handed versions too) listen to the next command:

HoldBlock_Allias.ForceRefTo(selfactor); HoldBlock_Allias => empty allias with empty package where is combat style with 100% defense
Utility.Wait(0.25)
selfactor.EvaluatePackage()
if selfactor.getAnimationVariablebool("IsAttacking")
    Debug.SendAnimationEvent(selfactor as objectreference, "attackStop")   
endif
Debug.SendAnimationEvent(selfactor as objectreference, "blockStart")  
Utility.Wait(0.5)
Debug.SendAnimationEvent(selfactor as objectreference, "blockStart") 
Utility.Wait(0.5)
Debug.SendAnimationEvent(selfactor as objectreference, "blockStart") 
Utility.Wait(0.5)
HoldBlock_Allias.Clear()

so, i find the way how to hold block 2 seconds for 50% of the NPC types, and half of the problem is finished.

 

But..

 

npc with daggers and swords - ignore all this and ignore block commands/animations (at close distance). So, left 50% of the problem :-P how to force these types of the enemies to block.

 

Anybody know any short animation which can cancel attack animations?

 

and will be possible for swords/knifes to force blocking with command:

int i = 0
while i < 20
if selfactor.getAnimationVariablebool("IsAttacking")
    Debug.SendAnimationEvent(selfactor as objectreference, SHORT stop attack animation)  
endif
if !selfactor.getAnimationVariablebool("IsBlocking")
    Debug.SendAnimationEvent(selfactor as objectreference, "blockStart")
endif
    Utility.Wait(0.1)
i += 1
endwhile

i found only 1 working animation: "attackstop", But this animation is not short (( and very visible when it casts 20 times in a row, when cancel attacks.

 

the next was tested too:

 

* staggerStop - don't cancel attacks

* to make NPC friendly - cancels combat and npc ignore block commands

* to add to forcefullbodystagger faction - don't cancel launched attack

* paralysis - down npc and it ignore block animations

 

So, who can help with short cancel? animation or idle or other way

Edited by myav
Link to comment
Share on other sites

  • Recently Browsing   0 members

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