Jump to content

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


myav

Recommended Posts

i have tested a lot of animation commands, and some of them works only when NPC ==> NOT attacking.

 

As example:

Debug.SendAnimationEvent(selfactor as objectreference, "blockStart")
Debug.SendAnimationEvent(selfactor as objectreference, "SneakStart")
Debug.SendAnimationEvent(selfactor as objectreference, "SneakSprintStartRoll")
debug.SendAnimationEvent(selfactor as objectreference, "bashPowerStart")

All these commands - works (tested)

 

but they only work if the command is given at the moment - between NPC attacks. And if a command for these attacks is given when the NPC is already making an attack (during weapon swing), these commands will not be activated and will not work in practice.

 

Do you know animation or idle (which does not move much npc) which can stop /break/cancel already launched attack? that to start these commands after it.

Link to comment
Share on other sites

testing continues...

 

"attackStop" animation - enough that to break usual attack and to do any other kinds of attacks, after it (power attack or bash attack).

 

But how to force animation "blockStart" ? NPC do this animation from the script, only when he is not too close to the player.

How to force to start blocking when NPC is close? "attackStop" - cancels the attack, but NPC starts new one immediately and ignore blockStart.

 

All what i want: blocking for 2 seconds when NPC is on the close distance to the enemy.

 

Who can help, how to script this ?

 

 

Console command tcai is perfect from one side (npc do animations from the scripts, and ignore own will with the desire to attack), but it disables all NPCs ((( when needed only 1 target.

DisableAI is bad too.. It not only disable ai, it also disables the weight of the actor and he may freeze in an unnatural pose, after a hit.

To change combatstyle is not good too. Because i need only 2 seconds, not all time of the blocking, and combatstyle is locked during battle.

 

 

Who is skilled and can help how to force npc to block 2 seconds and to ignore own will which commands to attack instead to block?

Edited by myav
Link to comment
Share on other sites

After a lot of experiments, not perfect, but working way:

Debug.SendAnimationEvent(selfactor as objectreference, "staggerStop")
selfactor.SetDontMove(true)
SelfActor.SetAV("Confidence", 0 as Float)        
SelfActor.EvaluatePackage()
Debug.SendAnimationEvent(selfactor as objectreference, "blockStart")
Utility.Wait(0.3000000)
Debug.SendAnimationEvent(selfactor as objectreference, "blockStart")    
Utility.Wait(0.3000000)
Debug.SendAnimationEvent(selfactor as objectreference, "blockStart")    
Utility.Wait(0.3000000)
Debug.SendAnimationEvent(selfactor as objectreference, "blockStart")
Utility.Wait(0.3000000)    
SelfActor.SetAV("Confidence", 4 as Float)        
SelfActor.EvaluatePackage()
selfactor.SetDontMove(false)

With confidence 0, cowards don't desire to attack and they listen to commands: block at close distance))

 

But i get a new problem ((

With confidence 0, npc yell too much about surrending and about: stop to hit them)

 

ANYONE pls help, how to force NPC to be silent after hit? to break standart yells or to replace standart voice dialogue with custom empty?

Who have experience with voice dialogue scripts and can help?

Edited by myav
Link to comment
Share on other sites

First of all you need to understand how the npcs AI works/runs, while the npc is in combat he is in a "AI STATE OF COMBAT", this means that he will react/do what his "Hardcoded" AI code dictates him to.

* Unfortunately we don't have access to those hardcoded codes in order to be able to manipulate the game engine.


In order to do what you are trying to, is to manipulate that "State" with the given tools, this means that you will have to create a scene so that everything runs on "Packages", you may even need to remove / add "Factions" (to manage his aggression) to make this work properly.


Sending animation to an npc that's in "Combat State" will only work for the duration of that animation, if that animation has 3 sec then it will play for 3 sec and then he will return to the "Combat State" he was before.


'Block Start' is an animation of just 0.5 sec, it plays just the rising of the shield, so unless if there isn't a "Block Hold" animation the only way to achieve this is by 'Packages' and 'Factions'.

* Plus the combat state runs on "Radius" from the target distance, so its behavior is affected by the radius.


* There do exists experienced scripters in this forum, but some times you don't get a respond because you have taken a wrong approach and people have trouble understanding what you are trying to do, and the solution to your issue has nothing to do with coding or it requires a combination of things to work together

Plus, is very difficult for just one person to cover ALL ASPECTS of modding, even if he is the most expirienced in the world.

Keep in mind that video games companies like Bethesda have from tens to hundreds of employees each one covering different development parts of the game, and even they don't know all aspect of the game and they do F*** U* !.


* Also you might not get a response, because either no one has thought and done it before or it just can not be done !.

Edited by maxarturo
Link to comment
Share on other sites

maxarturo, thanks for explanation.

 

And i don't want to cover ALL game :smile: i only want to force npc to block 2 seconds)))

 

You have suggested to use packages and factions that to make good blocking, but how?

 

I have tested friendly variant before, too. And i have noticed that npc ignore - friendly he or not friendly, during combat, because his enemy is CombatTarget and changes in the relations - don't stop his aggression.

 

Other way - to make him friendly and to send command - stop combat (that to reset combattarget). But if NPC will stop combat => he will remove his weapons from the hands instantly (and without weapons - npc will ignore blocking and other battle commands)

 

Can you write 1 more message and to explain the way, how package or faction can help to hold blocking? I can send 4 times in a row "rising of the shield", that to obtain 0.5+0.5+0.5+0.5 = 2 seconds, but NPC ignore this "rising" command at close distance ((

 

I'm not lazy and i very want to finish this problem.. I have tried A LOT of ways.. but all results - fail ((

that's why I wrote here on the forum, in the hope that somebody will help, who has more experience in battle animations than me.

Edited by myav
Link to comment
Share on other sites

I don't have experienced with the "The Game's Npc's Combat State", meaning that i had never found myself in need to manipulate that state, i only have knowledge on how the game engine works in this occasion.


This are some approaches on how i would start my experiments.


1) Create a Package with

Interrupt Override > Combat

Package Template > UseWeapon

Weapon Type > Define the Shield to use

Define all the rest of the Parameters


Now you can do the following, i'm too lazy to write it down so read it from here.



Or do what i propose bellow


2) Create a package and Define it to use specific Idles > add your Idle (or use what i propused above).

Add condition that this Package will run, example when it gets hit by a certain spell or when his health reaches a certain %.

Add the Package to your NPC.


* Keep in mind that there are a lot of things that just can not be done.

All game engine are close programming environments, think of it like a kid's playground with a lot of toys, you can play with all toys and combination of toys, but you can not play with a toy that dosen't exists in the playground.

Link to comment
Share on other sites

maxarturo,

 

1. shield is not weapon, how to define it? I found only 1 way: Weapon Type > Linked Reference - Armor:Shield. But with this variant - NPC only move and ignore enemy completelly. No attacks and no blocking.

2. Only 20% of npc have shield. how blocking will work with this method, if npc blocks with melee weapons and don't have shield?

3. Second suggested method i can't use, because my script is for all npc in the world. I can't add package to everybody vanilla npc, because other mods can rewrite vanilla objects too.

 

Mb, game have idle of shield blocking? As example, NPC don't want to dodge at close distance too when i use debug.sendanimation. But if to use: playidle(customdodge) - npc dodge. Mb the same is possible for blocking? but i don't found blocking idle...

 

So, i still need the help... with this Holy blocking (

Edited by myav
Link to comment
Share on other sites

" shield is not weapon "

Yeah... i meant Armor Type > Define the Shield to use


There are a lot of things that your idea is trying to do, and since i don't have a clue what's your idea, i can't provide any support.


Plus, i'm very puzzled right now on how to resolve some issues with the idea that i'm working now to start experimenting on a solution for you.

And i fear a lot that this will be the 6th time that i will have just hit a wall !!... with no workaround for it... some things just can't be done ...


* I fear that you have also set sail in uncharted waters.


I'm very sorry my friend !.

Link to comment
Share on other sites

"some things just can't be done ..."

I hope that the "blocking" is not on this list ))

 

I have started this question, not only here, but on other big forums of CK scripting too...

For whole 2 months of trying to find the way, how to force npc to block at close distance (when he want to hit), i see 4 variants:

 

1. to change Combat Style for 2 seconds (0% attacking, 100% blocking), and as result: npc will hold block 2 seconds. But problem is that Combat Style is locked, during combat...

 

I have tried:

 

* to use SKSE commands (convert combatstyle variables into form and to change them and to return back). This method really change CS offensive/defensive numbers and we can check this with debug.notification(needed number). But AI ignore changes.

* to use ForceRefTo where allias have package with other combatstyle

* to stop combat and to restart it, as trying to remove lock.

 

all this don't work during combat ((( Maybe, they don't work because needed to update AI after changes. If to use reset AI through console - AI of the NPC updates and start to use new offensive numbers and EVERYTHING WORKS (including "hold block", at close distance). But... if to repeat the same in the papyrus: ResetAI during combat - crashes game, and i don't know how to write code without crash with this command.

 

2. to force AI to change his combat behavior through Package (which weapons to use, how often to attack, and e.t.c.), as have suggested maxarturo.

 

And result: it really force NPC to stop attacking, as I have tested today. But I didn't find commands that would force him to block.

Combination: force "attack stop" (through package) + SendAnimation(block) - don't works ((

 

3. combination: confidence 0 + SendAnimation(block) + StopMoving => this method works, but NPC crying too many (during confidence 0) and i don't know how to make "silent" version...

 

4. To create Custom Idle with blocking and to do the same, as did author of the UltimateCombat with custom dodge (AI of the NPC ignore SendAnimation(dodge commands) at close distance, but don't ignore his idle with custom dodge) . But i don't know how to create idle with custom block (which will work at close distance)

 

Nexus have million+ of visitors.. Is there really no pro-encoder left today that would suggest how to solve this blocking problem?

Edited by myav
Link to comment
Share on other sites

  • Recently Browsing   0 members

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