Fight or fly

Skyrim Mods |

Fight or fly

Actors will flee when they start to lose a fight. You can loot NPCs that yielded by conversing with them.

Fight or fly
Note that a copy of this document exists in the Skyrim\\Data\\Docs folder.

Version: 0.81
Date: 23 April 2015
Author: kuertee

Requirements:
Skyrim 1.9
Skyrim Script Extender

Short description
Actors will flee when they start to lose a fight. You can loot NPCs that yielded by conversing with them.

Quick start
Step 1: Quickly read only 3 sections for now: the “Requirements” (above), the “Install” (or “Updating”) and the “Uninstall” sections, all below.
Step 2: Do a very quick read of available configuration settings in the “Configuring the mod” section.
Step 3: Play.
Step 4 (when something is wrong): Only when you think something is wrong, or when you don’t understand how a feature works, should you open this document again. Also search for keywords to quickly “jump” to a possibly relevant section. It’s better than reading this from top to bottom.
Step 5 (when something is REALLY wrong): If you feel that something is really wrong in your game, read the “Troubleshooting”, “Creating a clean save”, and “Script logging” sections below. A log of your game session really helps in determining a problem and in finding solutions for it.

Updates since last release (0.806)
0.81, 23 April 2015:
Bug fix: When looting a surrendered NPCs with the “Give me…” option, their gear would sometimes disappear.
Compatibility fix: Followers are never resurrected anymore. Resurrecting them caused too many bugs on them. They simply die from this version on. Make sure that they are set as essential in whichever follower mod you use.

Updating
Simply deactivate and uninstall the previous version then install and activate this version. Note that you do not need to stop the mod in-game. If you do, you will lose your accumulated mod-specific data. Let the new version back-up the data of its old version, clean-up the old data (i.e. zero-out) by stopping itself, restart itself and restore the data of the old version.
After the update is finished, the message “kuFOF2 v0.81” will appear.
If the MCM fails to start, simply type “startQuest kuFOF2xMCMQ” in the console.

Gameplay changes
Actors will flee when they start to lose a fight. You can loot NPCs that yielded by conversing with them.

Dragons, the undead (except vampires), summoned creatures and automatons never yield.

Detailed below is how the mod behaves during some quests.

Note that some quest targets (mainly Bounty targets and repeatable Radiant quest targets) will complete the associated quest when their targets yield.

Quest – Mod behaviour
Ill Met by Moonlight (DA05), The Mind of Madness (DA15), Waking Nightmare (DA16) – All effects of Fight or Fly are disabled.
Bounty: Bandit Boss (BQ01), Bounty: Forwsworn (BQ02), Bounty: Giant (BQ03), Animal Extermination (CR01, CR02), Trouble in Skyrim (CR05), Striking the heart (CR08), during brawling (DGIntimidateQuest), Revenge, Hired Thugs (WIKill06) – The targets for these quests will not surrender if the appropriate userNPCBountyTargetsFlee, userGiantBountyTargetsFlee, userCreatureBountyTargetsFlee is False. They will need to be killed. However, if the relevant setting is True, the targets will surrender and the relevant Quest will complete when they surrender.
Proving Honor (C01), Escaped Criminal (CR07), Rescue Mission (CR08), start of Forsworn Conspiracy (MS01GuardAmbushQuest), Blood on Ice (MS11) – The targets for these quests will never surrender.

More information
The mod classifies all actors as one of three types: (1) combatants, (2) ignored by the mod and (3) those that have surrendered. Each classification can hold 30 actors. When full, new actors are added at the start of the list, removing those that previously occupied them. This lists are actually Quest Aliases. When actors move 5000 distant away from the player, they are also removed from the list. Actors that were removed from the list lose all of the mods effects on them – i.e. those who have surrendered will stop running away and regain the default game’s AI. Also, actors that were removed from the list can be “found” and reclassified again by the mod.

When the mod first finds an actor, they are added to either the combatants or the ignored list.

Those in the ignored list will act with their default Skyrim AI. The mod does not add any of its behaviours to these actors.

Those in the combatant list may yield when their health drops 25% below their combat target’s health. Combatants with ranged weapons will yield when their health drops below 12% their combat target’s health if they are 750 distant from their target. Otherwise they will yield at 25% or lower health. Note that each actor remembers the last highest damage they received and takes this into consideration when determining whether they should flee.

Some actors may fight to the death. This is determined by a random chance that is dependent on their left-over health and their confidence. An actor’s chance of fighting to the death is: left-over health / base health * confidence / 4 * userFightToDeathChanceFactor. By default userFightToDeathChanceFactor is 1. You can increase the chances of an actor fighting to the death by increasing this number.

Actors who go into their bleed-out state will yield after their bleed-out animation is finished. At this time, they will run away from you but they won’t be activatble (i.e. you cannot converse with them) for 5 seconds. This is Skyrim’s default flee behaviour. After 5 seconds, they will become activatable even if they still run away from. This is the mod’s own “flee” behaviour.

When an actor yields, they are removed from the combatants list and added to the surrendered list.

When actors first yield, their Confidence is set to 0 and their Aggression is set to 1. Deer and other non-aggressive animals have this settings. This is how they get their flight behaviour. While in this behaviour, you cannot activate them. (In my tests in Skyrim, from literature about the Oblivion AI engine, and from experience with my Oblivion mod, NPCs Yield, Confidence is the determining factor for Skyrim’s default fleeing behaviour. When actors first go into combat the game checks the actor’s Confidence. If low, then the actor will not engage in combat and will instead flee. However, this behaviour is triggred only when they go into combat. Hence, an Aggression of 1 is required. If 0, then the actor will never enter combat and so their flee behaviour is not triggered. Also during this flee behaviour, the default game prevents you from activating the actor.)

Five seconds after they first yield, the mod sets their Confidence to 1 and their Aggression and Assistance to 0. Their Confidence at 1 prevents them from trigerring Skyrim’s default flee behaviour described above. And Aggression and Assistance both at 0 prevents them engaging in combat. The behaviour of running away from their attacker is from my custom Package AI that is applied to them.

Actors who have targeted the player and who have not received damage but have their health already at 25% or less than the player’s will also be put in the surrendered list. But only temporarily. With their Confidence at 0 and Aggression at 1, they will get Skyrim’s default fleeing behaviour. This behaviour includes actors fleeing towards their closest friends. This is called “grouping” in this mod. Grouping actors will delay their true yielding behaviour for 30 seconds. If the player gets busy with another meleer combatant (i.e. gets attacked by another actor in melee), grouping actors will rejoin the fight (i.e. will be removed from the surrendered list and readded into the combatants list). You can turn off this behaviour by setting userCreaturesGroup and/or userNPCsGroup to False.

Actors who have targeted another actor who is not the player and who have their health already at 25% or less than their opponents will always yield immediately because userYieldBeforeDamage is set to True by default. Set this to False so that only actors with damaged health will flee.

Teammates (i.e. actors with IsPlayerTeammate () as True which includes owned horses) will yield and run away, as described above, in the first five seconds of their surrender. After this, their Confidence, Aggression and Assistance and all other effects of the mod are removed from them. They are readded to the combatants list for the mod to track their health for the possibility for their next yield.

As mentioned above, when actors are removed from any of the lists, all the mod’s effects are removed from them. This includes the restoration of their original Confidence, Aggression and Assistance. Actors are removed from the lists when (1) they die, (2) they move away from the player 5000 distant.

Protect from first death
When userProtectAllFromFirstDeath is True, actors are protected from their “first” death. They truly die on their “second” death.

When damage is high, actors with low base health may die before they have a chance to flee. Without this feature, there is no way to stop an attack other than to kill. With this feature, fighting becomes more about stopping the fight and less about killing.

Actors who decide to fight to the death are not protected with this feature.

Note that actors will still try to flee before they die with this feature.

There are two methods this feature is implemented.

Protect from first death – method 0
If userProtectAllFromFirstDeath is True and userProtectAllFromFirstDeathMethod is 0, those that yield will be put into their bleed-out state. They are protected from death while they are in the combatants list (i.e. during the entire time of them being in combat). After their bleed-out state (i.e. when they are put into the surredenred list), they are no longer protected and can be killed. With userProtectAllFromFirstDeath set as True, you can role-play a true good-aligned character. You don’t have to “pull your punches” waiting for your opponents to yield.

Note that since method 1 has been developed, method 0 may now be buggy. I did try to keep the two separate, so method 0 may not be buggy. I just don’t know because I’ve not played with method 0 since method 1.

Protect from first death – method 1
If userProtectAllFromFirstDeath is True and userProtectAllFromFirstDeathMethod is 1, those that die before they had a chance to flee are simply “knocked out”. They will be revived after the value of userResurrectAfterSeconds in seconds. You can loot them while they are knocked out. If they die or are killed after they are reived, they will truly die.

If a quest is updated close to the time they are “knocked out”, they are likely to be a quest “kill” target and they have actually died. They won’t be revived.

Blood-thirsty fueds
Actors in these fights will never yield:

Silverhand Faction v player and teammates if player is a werewolf
Vigilants of Stendarrs v vampires and werewolves
Dawnguard Faction v vampires
Cultist Faction v player and teammates

Configuring the mod
Method 1: SkyUI’s MCM
You can configure this mod with SkyUI’s MCM or manually as described below. Ignore the rest of this section.

Method 2: FISS
The SKSE plug-in, FISS, is required for this. With FISS installed, you can (1) export your settings from the MCM to the XML file, SKSE\\plugins\\FISS\\kuertee\\kuerteeSightlessSenses.xml, (2) edit this file outside the game with a text editor, (3) then import it again for any save game.

Method 3: INI file
Another way to configure this mod is to use its INI file. Note, however, that every time you change a value in the INI file, you’ll need to execute it from the in-game console by typing {bat “ini\\kuerteeSightlessSenses.ini”} (without the brackets).

Method 4: Console
A less efficient way to configure this mod is by using the console command {SetPQV kuFOF2Q option value}. Option is the name of setting. And value is your new value for it.

Below are the various settings that you can change, their default values and a short description.

SetPQV kuFOF2Q userCreaturesFlee 1
;Default False or 0.

SetPQV kuFOF2Q userEssentialsFlee 1
;Default False or 0.

SetPQV kuFOF2Q userLastRiddenHorseFlees 1
;Default False or 0.

SetPQV kuFOF2Q userPlayerTeammatesFlee 1
;Default False or 0.

SetPQV kuFOF2Q userUniquesFlee 1
;Default False or 0.

SetPQV kuFOF2Q userVampiresFlee 1
;Default False or 0

SetPQV kuFOF2Q userNPCBountyTargetsFlee 1
;Default False or 0.

SetPQV kuFOF2Q userGiantBountyTargetsFlee 1
;Default False or 0.

SetPQV kuFOF2Q userCreatureBountyTargetsFlee 1
;Default False or 0.

SetPQV kuFOF2Q userYieldBeforeDamage 0
;Default False or 0. When True, NPCs and non-animal-type creatures may fly before they are hurt.

SetPQV kuFOF2Q userFightToDeathChanceFactor 1.000000
;Default 1.000000. The chance for an actor to fight to their death is health / base health * confidence / 4 * userFightToDeathChanceFactor. 0 = never fight to the death.

SetPQV kuFOF2Q userCreaturesGroup 1
;Default TRUE. Grouping prevents the actor from engaging the player unless the player is busy with at least 1 melee opponent.

SetPQV kuFOF2Q userCreaturesMayFightToDeath 0
;Default False or 0.

SetPQV kuFOF2Q userNPCsGroup 1
;Default TRUE.

SetPQV kuFOF2Q userNPCsMayFightToDeath 0
;Default TRUE.

SetPQV kuFOF2Q userProtectAllFromFirstDeath 1
;Default TRUE. All actors who may fly are protected from death until they surrender. They may be killed when they surrender – unless they are tagged as essential by a Quest or another mod.

SetPQV kuFOF2Q userDebugPerActor 0
;Default TRUE. Create debug logs for each actor rather than for combatant, flier and ignored Aliases. This will create a log of log files so use this sparingly. At the start of each game session, this will be reset to False.

SetPQV kuFOF2Q userProtectAllFromFirstDeathMethod 1
;Default 1.000000. Method 0 = Make actors essential. Method 1 = Let actors die. If no Quest is completed, resurrect them. Note that Method 0 is no longer supported. When userProtectAllFromFirstDeath is True, userProtectAllFromFirstDeathMethod is forced to 1.

SetPQV kuFOF2Q userDisableTemporarily 0
;Default TRUE. Disables all fleeing behaviours for 10 minutes.

SetPQV kuFOF2Q userResurrectAfterSeconds 1.000000
;Default 1.000000. When userProtectAllFromFirstDeathMethod = 1, this is the number of seconds the actor stays dead before resurrection. Note that the actual time is determined by when the mod receives its allocated CPU time from the engine. And the actual time before resurrection may be longer than this value.

SetPQV kuFOF2Q userApplyToRunTimeCreatedActorsOnly 1
;Default False or 0.

SetPQV kuFOF2Q userNonCombatClassAlwaysFlee 1
;Default False or 0.

SetPQV kuFOF2Q userAnimalsYieldBeforeDamage 1
;Default TRUE. When True, animals may fly before they are hurt.

SetPQV kuFOF2Q userOnlyPlayerCombatantsFlee 0
;Default False or 0.

SetPQV kuFOF2Q userUseActivateLootButton 1
;Default TRUE. When true, a ‘Give me…” button is presented when you activate a yielded actor. It’s much faster than going into the Dialogue Menu.

Install
Use Wrye Bash to install this mod. Just drag the package (which is a normal ZIP file) into Wrye Bash’s Installers tab. Note, however, that the package is only a normal ZIP file, so if you know the game’s mod file structure, install it manually. Other mod managers (e.g. NMM) that support ZIP files that mirror the file structure of the game may also be used.
Configure the mod as described in the “Configuring the mod” section.
Activate the mod.

Starting from a downloaded saved-game
(Thanks to Restutitor Orbis for this suggestion on how to jump-start my mods when playing from a downloaded saved game.)

“Starting another character from a DLed saved game file in Helgen, I came upon an easier solution than warping into the LAL prison cell.
If you have LAL but are starting a character in Helgen, just use a bat file with these 2 console commands or just type them in after the ~:
setstage arthlalstartquest10
setstage arthlalstartquest20This ends the LAL quest and re-enables the MQ101 update that you are supposed to get when you complete your escape, but was initially disabled by LAL.
That way you can do the vanilla MQ without switching to the LAL beginning if you want to.”
-Restutitor Orbis

Uninstall
In the console, type {SetPQV kuFOF2Q uninstallNow True} (without the brackets). Or with Sky UI’s MCM, set the uninstallNow toggle to True then exit the menus.
Wait for a message confirming the uninstallation. Save the game.
Deactivate the mod with Wrye Bash. If you installed this manually, simply delete all the files you installed. (Wrye Bash keeps track of files used, so installing/uninstalling the mod with it is 100% simpler.)

Troubleshooting
You can reset the mod by typing {SetPQV kuFOF2Q resetNow True} (without the brackets) in the console. Or with Sky UI’s MCM, set the resetNow toggle to True then exit the menus.
When it resets it will ask you either reset all of its data or continue with the current data. Resetting all its data will remove all your settings and set the mod as if you have first installed it.
You can check all the mod’s data by typing {SQV kuFOF2Q} in the console. You can check if your settings were set in the mod properly with this.
If you find that your changes (with the command SetPQV or from executing the INI) do not appear in the mod, check the command again for spelling errors. Then try again.
If you find that resetting (with resetNow) and uninstalling (with uninstallNow) don’t seem to work, the mod may have been suspended. It is best to simply start-over (i.e. reinstall the mod) after a “clean” save.

Creating a clean save:
If you can, uninstall the mod from the console with {SetPQV kuFOF2Q uninstallNow True}.
Wait for the mod to confirm the uninstallation. It may take a minute. If no confirmation appears, then simply continue to the next step.
Save the game manually from the console by typing {save uninstalledMod}.
Uninstall all the mod’s files (*.ESP, *.PSC, *.PEX) from the game folders. Make sure that none of the mod’s Scripts are left. A mod manager like Wrye is best used for this.
Load the “uninstalledMod” save.
Save the game manually again from the console by typing {save cleanSave}. Because all of the mod’s files were removed, all of its data will be “zeroed” in this game.
Play from this game.

Script logging
As a last resort, you can enable script logging and investigate the “Documents\\My Games\\Skyrim\\Logs\\Script\\Papyrus.0.log” file and/or send them to me. Contact me first either on TESNexus or the official Bethesda forums.
To enable script logging, set bEnableLogging, bEnableTrace and bLoadDebugInformation in the Skyrim.INI file. More information about this is described in this thread in the official Bethesda Creation Kit Forum.
Also, you can set mod specific logging by setting debugMode to 1 in either the MCM or in the console by typing {SetPQV kuFOF2Q debugMode 1} (without the brackets). Mod specific logs are found in “Documents\\My Games\\Skyrim\\Logs\\Script\\User\\kuFOF2Qs.0.log”.
Play the game for 5 minutes or so – enough time for the game to capture logging events.
If the “Papyrus.0.log” contain “Suspended stack count is over our warning threshold, dumping stacks:”, then your game is suffering very badly. I’ve written a guide on how to clean your game and recover from this problem in Bethesda’s official forums.
Feel free to send me (kuertee at gmail dot com) the “Documents\\My Games\\Skyrim\\Logs\\Script\\Papyrus.0.log”, “Documents\\My Games\\Skyrim\\Logs\\Script\\User\\kuFOF2Qs.0.log” to investigate the problem.

Licensing/Legal
You can do whatever you want with this mod but all I ask in return is that you give me credit. I would also like to be contacted when you include this mod in part or in full in a public release.


Author: kuertee
This content was uploaded by website visitors. If you notice any mistake, please let us know.


You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *