Indiscriminate forced change to the combat mode will cause a lot of AI issues such as preventing actors from following you thru a load door while they are in combat with you.
You would then be able to duck thru a door 3 feet away just to cheat your way out of combat.
The problem is with the mod that is detecting combat mode, they should not do that as the only way to determine the combat situation.
For example I use a combination of detections and a timer to determine if my player "WAS in combat".
Is player and actor in combat ?
Is the player the "combat target" of the actor?
Is player and or actor attacking? Or Is actor and or player blocking?
This then set my "WasInCombatTimer" to 15
Then after 15 seconds if the timer is not set back to 15 from the above detections, it counts down to zero.
Or if player.isincombat == 0 I set my timer to ZERO.
In all my scripts I then do not use isincombat == 1
No, I instead use :
WasInCombatTimer > 0
Combat AI is tricky stuff, you can cause a lot of odd behaver if you get too draconian with the DEV system.
You need to dance with the code.... not fight it.
Some time ago I tried to use Kamikaze's Combat Animation Selector which uses a series of scripts to dynamically change the skeleton path based obn which weapon type you'yre using.
However I run in a quite nasty bug...Namely, while in combat, or even when mudcrabs force me in combat mode (I don.t see them for some time but combat music plays), then if I change weapone usually I become stuck in combat mode with no way of fighting or changing weapon.
After some attempts of debug I realized that the global script hangs because of combat mode. Some further google-ing showed that this can happen in a vanilla as well. Basically what happens is that because some NPC/Creature noticed the player and has decided to attack, the player becomes stuck in combat mode until the culprit is reset or dies.
So, does anyone have a workaround for this? Someway to forcefully exit combat mode or maybe forcefully stop combat mode altogether?
What I'd like to do is to make it so that combat mode is active only and only if either the player or the attaker is n attack animation.
Any sugestions?