Other user's assetsAll the assets in this file belong to the author, or are from free-to-use modder's resources
Upload permissionYou can upload this file to other sites but you must credit me as the creator of the file
Modification permissionYou are allowed to modify my files and release bug fixes or improve on the features without permission from or credit to me
Conversion permissionYou can convert this file to work with other games as long as you credit me as the creator of the file
Asset use permissionYou are allowed to use the assets in this file without permission or crediting me
Asset use permission in mods/files that are being soldYou are not allowed to use assets from this file in any mods/files that are being sold, for money, on Steam Workshop or other platforms
Asset use permission in mods/files that earn donation pointsYou are allowed to earn Donation Points for your mods if they use my assets
Author notes
This author has not provided any additional notes regarding file permissions
File credits
This author has not credited anyone else in this file
Donation Points system
Please log in to find out whether this mod is receiving Donation Points
Changelogs
Version 4.2
Added a check for the presence of Immersive Patrols.esp before trying to retrieve its factions to prevent getting a warning in papyrus logs
Removed Stop() since mods can still call the API functions
Version 4.0
{a new game is required when updating}
CWWhiterunGuardNeutralFaction is now only used to prevent guards from attacking Stormcloack NPCs or the player before the scripted spell applies factions, and gets replaced with a custom faction NeutralWhiterunGuardFaction (this faction now must be used in conditions instead of CWWhiterunGuardNeutralFaction). This change is supposed to prevent guards from helping either side when they fight with someone, which caused by making guards allies with both sides (v3.0 only fixed this for fighting with the opposite faction). Updated the Crime Overhaul patch.
Version 3.0
Fixed that if Stormcloaks fight with Imperials/Thalmor, "neutral" whiterun guards help Stormcloaks. Custom Imperial/Thalmor factions now need to be registered in a similar way to the stormcloak factions. THIS WILL ONLY TAKE EFFECT ON NEW GAMES.
Version 2.1
Fixed conditions on dialogue "I'm the Jarl's Thane. I demand you let me go at once." (A34C2). The mod now requires USSEP. Added a patch for Crime Overhaul
Version 2.0
SPID 6 is required. Neutral whiterun guards are no longer in the imperial faction, and when they become imperial they are no longer in the neutral faction. This means that neutral whiterun guards won't use imperial dialogues. This version wasn't tested much, let me know if the lack of the imperial faction causes any issues.
Version 1.3
Fixed incorrect conditions in AddStormcloakFaction()
Version 1.2
added a line to the SPID ini to distribute the neutral faction to all NPCs in factions IsGuardFaction + CWImperialFactionNPC + CrimeFactionWhiterun to reduce the need in patches for mod-added guards
added a formlist StormcloakFactions, to which you can add any factions whose relationships with the neutral whiterun guard faction will be set in the same way as with the vanilla stormcloak faction. + added AddStormcloakFaction(Faction) function that can be called by other mods to do that via script
Version 1.1
Added support for Immersive Patrols. It appeared it doesn't use CWSonsFactionNPC faction (who cares about setting proper factions). This will only work on new games (or you can try to remove Neutral Whiterun Guards, make a save, and install it back)
Description
Balgruuf is initially neutral and doesn't take sides, but in vanilla guards of the Whiterun hold aren't really neutral. Of course they don't attack the player even if the player is Stormcloak. However, if some Stormcloak NPCs happen to come to Whiterun or any other settlement in the hold, they will start fighting with the guards. This can happen for example if you have mods that add Stormcloak patrols on roads.
This mod makes guards of the Whiterun hold neutral to both sides before the battle for Whiterun instead of being imperial, as they are supposed to be. In fact there's already a faction CWWhiterunGuardNeutralFaction on Whiterun guards but some guards didn't have it and this faction didn't do anything, while all of the guards also were in the imperial faction, which made them enemies with Stormcloaks.
This mod dynamically changes guard factions. Before the battle for Whiterun all guards get removed from the imperial factions (CWImperialFactionNPC, CWImperialFaction, CrimeFactionImperial) and added to a custom faction NeutralWhiterunGuardFaction. When Balgruuf takes the side of the Empire they get added back to the imperial factions and removed from NeutralWhiterunGuardFaction. CWWhiterunGuardNeutralFaction is only used to prevent guards from attacking Stormcloaks before the factions are set and gets removed as soon as they are.
This mod doesn't affect relations between guards and the player, unless some mod puts you directly to CWSonsFactionNPC faction or integrates with this mod (like Immersive Aggressive Opponents).
The only vanilla record that this mod edits is the dialogue "I'm the Jarl's Thane. I demand you let me go at once.", any other mod that edits it will conflict. A patch for Crime Overhaul is available in the optional files.
Should affect mod-added guards.
If some mod-added NPCs use custom Stormcloak/Imperial/Thalmor factions instead of the vanilla factions (CWSonsFactionNPC/CWImperialFactionNPC/ThalmorFaction), these custom factions need to be registered by adding the faction to StormcloakFactions/ImperialFactions formlist from this mod (This will only take effect on new games. Due to this, if you want to do that via papyrus script, call AddStormcloakFaction(Faction)/AddImperialFaction(Faction) function from NeutralWhiterunGuardsScript).
If some mod only relies on the imperial faction to identify Whiterun guards, it won't work properly with this mod. This can be fixed by adding a condition on NeutralWhiterunGuardFaction via OR operator.