0 of 0

File information

Last updated

Original upload

Created by

Hishigami

Uploaded by

Hishigami

Virus scan

Safe to use

Tags for this mod

About this mod

Reverse engineers the "KAH" - Kill All Hostiles console command. For use with SSE 1.5.97 and 1.6.317-1.6.640.

Requirements
Permissions and credits
Changelogs
Overview
SSE 1.6.1130 introduced two console commands alongside a few native changes to the console itself: KAH, short for "Kill All Hostiles"; and GetSelectedRefBase, which returns the selected reference's BaseID. While the latter has been provided through console mods such as More Informative Console, the former command originated in FO4, returned in Starfield, and didn't have any re-implementations for SSE 1.5.97 and 1.6.317-1.6.640 users.
This mod is my attempt to reverse engineer KAH using a hacky Papyrus solution via ConsoleUtil Extended. I currently don't plan to replicate GetSelectedRefBase due to the noted overlap with MIC.

Usage
ConsoleUtil Extended and PO3's Papyrus Extender are required for this mod to work.

Entering bcon kah (short for backported-console killallhostiles) will instantly kill all nearby hostile NPCs without killing any friendly/neutral NPCs. This will also kill any NPCs that would turn hostile the moment they spot you or are alerted to your presence, even if they're not directly in combat with you. For example, all Solstheim Reavers within your vicinity will die even if you don't see them, while any non-hostile Netches will remain unharmed.

Technical details:
Spoiler:  
Show

This script relies on a key Papyrus Extender function to scan for all nearby Actors: GetActorsByProcessingLevel. GetActorsByProcessingLevel(0) fishes out active Actors in the current interior cell/surrounding exterior cells without touching anyone that's inside the memory buffer (level 1) or not loaded at all (levels 2-3).
While not directly documented on the Papyrus Extender's wiki, this function is still buried in the source code, and it worked fine in my short testing.

I did try using GetCombatTargets(Player) previously, and this ended up not killing anyone that the game recognizes as hostile due to a stealth-induced search event as those Actors weren't in active combat with the Player; thus they wouldn't be recognized by GCT, and so the kill loop wouldn't affect them.
By the same token, using an IsHostileToActor(Player) check is a scorched earth method, much like the regular KillAll command. As with other console commands, please use this with care.

This mod is redundant if you're on SSE 1.6.1130+.

Credits
ponzipyramid for creating Custom Console, and Scrab for maintaining it as part of CUE.
powerofthree for writing the Papyrus Extender.