Skip to content

Commit

Permalink
Updates for v1.1.0
Browse files Browse the repository at this point in the history
Support for disabling visual effects resulting from mythic paths, added some buffs, some additional logging and hardening.
  • Loading branch information
Decair committed Oct 15, 2021
1 parent c483868 commit 428af54
Show file tree
Hide file tree
Showing 8 changed files with 253 additions and 39 deletions.
58 changes: 42 additions & 16 deletions README.md
Expand Up @@ -2,32 +2,58 @@

WOTR Mod which allows users to disable and to override FX effects of buffs.

By default the mod disables the BlessingOfUnlife buff FX. If you don't like this behavior, see How to Use for instructions around how to change DisableFx for BlessingOfUnlife from true to false.
By default the mod disables the BlessingOfUnlife and Stoneskin buff FXs. If you don't like this behavior, see How to Use for instructions around how to change DisableFx for BlessingOfUnlife and the four Stoneskin buffs from true to false.

# How to Install

0. Download the latest published zip file.
1. Install [UnityModManager](https://www.nexusmods.com/site/mods/21)
2. Install the zip with UnityModManager.
1. Download the latest published zip file.
2. Install [UnityModManager](https://www.nexusmods.com/site/mods/21)
3. Install the zip with UnityModManager.

# How to Use

Configure Buff FX Tweaks by editing the buffs.json file present in the UserSettings folder of the mod.
Configure Buff FX Tweaks by editing the Buffs.json file present in the UserSettings folder of the mod.

To disable a buff FX, find the buff whose FX you wish to disable in buffs.json, and change DisableFx from false to true.
To disable an FX, find the buff whose FX you wish to disable in Buffs.json, and change DisableFx from false to true.

To override a buff FX with a different FX, first determine the buff whose new FX you wish to have displayed in game (we'll call that the override buff) and find that in buffs.json. Copy the id of the override buff. Then find the buff whose FX you wish to replace in buffs.json. Paste the id of the override buff into the value of OverrideFxId.
To override an FX with a different FX, first determine the buff whose FX you wish to have displayed in game (we'll call that the override buff) and find that in Buffs.json. Copy the id of the override buff. Then find the buff whose FX you wish to replace in Buffs.json. Paste the id of the override buff into the value of OverrideFxId.

Note that the most challenging part of configuring the mod is determining which named buff actually corresponds to the buff you're trying to tweak. There are a lot of cloned buffs in WOTR blueprints.
Notes:
- Only override the FX of a Mythic Class (denoted with "IsMythicClassFx = true", located at the beginning of buffs.json) with the FX of another Mythic Class. Similarly, only override the FX of a normal buff (won't have an "IsMythicClassFx") with another normal buff.
- The most challenging part of configuring the mod is determining which named buff actually corresponds to the buff you're trying to tweak. There are a lot of similar buffs in WOTR blueprints, so you may need to experiment a bit.

# Q & A
**Q:** Do I always need to replace Buffs.json or can I continue to use my previous one?
**A:** I will always try to make non-breaking changes (so things should be additive). The change from v1.0.0 to v1.0.1 was an exception as it intentionally removes buffs which were creating an issue. That said, you obviously can't disable / override newly added buffs without them being present in Buffs.json. To keep using your old Buffs.json, prior to an update please copy the old Buffs.json to a new name/location; then after the update you can overwrite the Buffs.json included in the update.

**Q:** On an update, can I just add select json objects / buffs vs. replacing the entire Buffs.json?
**A:** Yep, this currently works fine. You obviously need an understanding of how to edit json, as the mod won't work if you create malformed json.

**Q:** Having to possibly re-edit my json changes on an update sucks. Is there an easier way?
**A:** Yeah, I don't like this either. I'm evaluating how to best migrate settings from earlier versions into new ones, and hope to support this in a future release.

# Change List
### v1.1.0
**New Feature:** *You can now disable and override FX for the visual changes stemming from your Mythic Path choices. For example, you can disable or override the visual change from being a Lich.*

The fix for Drezen in 1.0.1 missed including some player buffs. It's unclear which, so please let me know in WOTR Discord should you find something you need missing. Found the following buffs missing and added them back to Buffs.json: Angel Sword Speed of Light, various Wings buffs, Protection from Spells, and certain Stoneskin variations.

### v1.0.1
v1.0.0 supported over 4600 buffs, player and non-player, but disabling certain non-player buffs resulted in a crash entering Drezen. Addresses the issue by reducing the list to only player buffs.

Please ensure that you're replacing your Buffs.json file with the one from this release and updating that new Buffs.json file with any tweaks you wish to make. Apologies for the inconvenience.

### v1.0.0
Initial release of Buff FX Tweaks, which enables users to disable and to override FX effects of buffs.

# How to Compile

0. Install all required development pre-requisites:
1. Install all required development pre-requisites:
- [Visual Studio 2019 Community Edition](https://visualstudio.microsoft.com/downloads/)
- [.NET "Current" x86 SDK](https://dotnet.microsoft.com/download/visual-studio-sdks)
1. Download and install [Unity Mod Manager (UMM)](https://www.nexusmods.com/site/mods/21)
2. Execute UMM, Select Pathfinder: WoTR, and Install
3. Create the environment variable *WrathInstallDir* and point it to your Pathfinder: WoTR game home folder
2. Download and install [Unity Mod Manager (UMM)](https://www.nexusmods.com/site/mods/21)
3. Execute UMM, Select Pathfinder: WoTR, and Install
4. Create the environment variable *WrathInstallDir* and point it to your Pathfinder: WoTR game home folder
- tip: search for "edit the system environment variables" on windows search bar45. Use "Install Release" or "Install Debug" to have the Mod installed directly to your Game Mods folder

NOTE Unity Mod Manager and this mod template make use of [Harmony](https://go.microsoft.com/fwlink/?linkid=874338)
Expand All @@ -40,8 +66,8 @@ Source code: https://github.com/Decair/WOTR_FxTweaks

Thanks to:

0. [ThyWoof's mod template](https://github.com/ThyWoof/PathfinderWoTRModTemplate), for an auto-setup template for WOTR mods.
1. [Xenofell's Tweakable Weapon Categories mod](https://github.com/cstamford/WOTR_TweakableWeaponCategories), for getting me going way beyond the base template.
2. [Vek17's TTT mod](https://github.com/Vek17/WrathMods-TabletopTweaks), for many examples of how to make behavioral and blueprint changes.
3. All the folks at Owlcat's Pathfinder WOTR discord #mod-dev-technical channel, for the multiple times they pointed me in the right direction (especially WittleWolfie - thank you!).
1. [ThyWoof's mod template](https://github.com/ThyWoof/PathfinderWoTRModTemplate), for an auto-setup template for WOTR mods.
2. [Xenofell's Tweakable Weapon Categories mod](https://github.com/cstamford/WOTR_TweakableWeaponCategories), for getting me going way beyond the base template.
3. [Vek17's TTT mod](https://github.com/Vek17/WrathMods-TabletopTweaks), for many examples of how to make behavioral and blueprint changes.
4. All the folks at Owlcat's Pathfinder WOTR discord #mod-dev-technical channel, for the multiple times they pointed me in the right direction (especially WittleWolfie - thank you!).

5 changes: 1 addition & 4 deletions WOTR_FxTweaks/Config/ModSettings.cs
Expand Up @@ -12,6 +12,7 @@ public class Buff {
public string Id {get;set;}
public bool DisableFx {get;set;}
public string OverrideFxId {get;set;}
public bool IsMythicClassFx { get; set; }
}

static class ModSettings {
Expand Down Expand Up @@ -43,10 +44,6 @@ static class ModSettings {
.OrderBy(b => b.DisableFx)
.ToList();
Main.Log($"Found {BuffsToTweak.Count} buffs to tweak.");
//foreach (Buff buffToTweak in BuffsToTweak)
//{
// Main.Log("To tweak: " + buffToTweak.Name);
//}
}
}
}
2 changes: 1 addition & 1 deletion WOTR_FxTweaks/Info.json
Expand Up @@ -2,7 +2,7 @@
"Id": "WOTR_FxTweaks",
"DisplayName": "Buff FX Tweaks",
"Author": "Decair",
"Version": "1.0.0",
"Version": "1.1.0",
"ManagerVersion": "0.23.3",
"Requirements": [],
"AssemblyName": "WOTR_FxTweaks.dll",
Expand Down
1 change: 1 addition & 0 deletions WOTR_FxTweaks/Main.cs
Expand Up @@ -13,6 +13,7 @@ namespace WOTR_FxTweaks
public class Main
{
[Conditional("DEBUG")]
internal static void DebugLog(string msg) => Logger.Log(msg);
internal static void Log(string msg) => Logger.Log(msg);
internal static void Error(Exception ex) => Logger?.Error(ex.ToString());
internal static void Error(string msg) => Logger?.Error(msg);
Expand Down
2 changes: 1 addition & 1 deletion WOTR_FxTweaks/Repository.json
@@ -1,7 +1,7 @@
{
"Releases":
[
{"Id": "WOTR_FxTweaks", "Version": "1.0.0"}
{"Id": "WOTR_FxTweaks", "Version": "1.1.0"}
]
}

54 changes: 42 additions & 12 deletions WOTR_FxTweaks/Spells.cs
@@ -1,5 +1,7 @@
using HarmonyLib;
using System;
using HarmonyLib;
using Kingmaker.Blueprints;
using Kingmaker.Blueprints.Classes;
using Kingmaker.Blueprints.Classes.Spells;
using Kingmaker.Blueprints.Items.Ecnchantments;
using Kingmaker.Blueprints.JsonSystem;
Expand Down Expand Up @@ -31,24 +33,52 @@ static void Postfix()
{
if (Initialized) return;
Initialized = true;
if (!Main.Enabled) { return; }
Main.Log("Initialize blueprint patching process...");
if (ModSettings.BuffsToTweak.Count > 0)
{
if (!Main.Enabled) { return; }

foreach (Buff buffToTweak in ModSettings.BuffsToTweak)
Main.Log($"Tweaking {ModSettings.BuffsToTweak.Count} buffs.");
try
{
Main.Log("Tweaking: " + buffToTweak.Name);
var BlueprintBuffToTweak = ResourcesLibrary.TryGetBlueprint<BlueprintBuff>(buffToTweak.Id);
if (buffToTweak.DisableFx)
{
BlueprintBuffToTweak.FxOnStart = BlueprintBuffToTweak.FxOnRemove;
} else
foreach (Buff buffToTweak in ModSettings.BuffsToTweak)
{
var OverrideBlueprintBuff = ResourcesLibrary.TryGetBlueprint<BlueprintBuff>(buffToTweak.OverrideFxId);
BlueprintBuffToTweak.FxOnStart = OverrideBlueprintBuff.FxOnStart;
Main.DebugLog("Tweaking: " + buffToTweak.Name);
if (buffToTweak.IsMythicClassFx)
{
var BlueprintClassToTweak = ResourcesLibrary.TryGetBlueprint<BlueprintCharacterClass>(buffToTweak.Id);
var ClassWithNullVisualSettingsFx = ResourcesLibrary.TryGetBlueprint<BlueprintCharacterClass>("0937bec61c0dabc468428f496580c721"); // Using Alchemist which is empty
if (buffToTweak.DisableFx)
{
BlueprintClassToTweak.m_AdditionalVisualSettings = ClassWithNullVisualSettingsFx.m_AdditionalVisualSettings;
}
else
{
var OverrideBlueprintClass = ResourcesLibrary.TryGetBlueprint<BlueprintCharacterClass>(buffToTweak.OverrideFxId);
BlueprintClassToTweak.m_AdditionalVisualSettings = OverrideBlueprintClass.m_AdditionalVisualSettings;
}
}
else
{
var BlueprintBuffToTweak = ResourcesLibrary.TryGetBlueprint<BlueprintBuff>(buffToTweak.Id);
if (buffToTweak.DisableFx)
{
BlueprintBuffToTweak.FxOnStart = BlueprintBuffToTweak.FxOnRemove;
}
else
{
var OverrideBlueprintBuff = ResourcesLibrary.TryGetBlueprint<BlueprintBuff>(buffToTweak.OverrideFxId);
BlueprintBuffToTweak.FxOnStart = OverrideBlueprintBuff.FxOnStart;
}
}
}
}
catch (Exception e)
{
Main.Error("Failed Blueprint patching.");
Main.Error(e.Message);
}
}
Main.Log("Patching process complete.");
}
}
}
Expand Down
162 changes: 161 additions & 1 deletion WOTR_FxTweaks/UserSettings/Buffs.json
@@ -1,4 +1,64 @@
[{
"Name": "_AeonMythicClass",
"Id": "15a85e67b7d69554cab9ed5830d0268e",
"DisableFx": false,
"OverrideFxId": "",
"IsMythicClassFx": true
}, {
"Name": "_AngelMythicClass",
"Id": "a5a9fe8f663d701488bd1db8ea40484e",
"DisableFx": false,
"OverrideFxId": "",
"IsMythicClassFx": true
}, {
"Name": "_AzataMythicClass",
"Id": "9a3b2c63afa79744cbca46bea0da9a16",
"DisableFx": false,
"OverrideFxId": "",
"IsMythicClassFx": true
}, {
"Name": "_DemonMythicClass",
"Id": "8e19495ea576a8641964102d177e34b7",
"DisableFx": false,
"OverrideFxId": "",
"IsMythicClassFx": true
}, {
"Name": "_DevilMythicClass",
"Id": "211f49705f478b3468db6daa802452a2",
"DisableFx": false,
"OverrideFxId": "",
"IsMythicClassFx": true
}, {
"Name": "_GoldenDragonClass",
"Id": "daf1235b6217787499c14e4e32142523",
"DisableFx": false,
"OverrideFxId": "",
"IsMythicClassFx": true
}, {
"Name": "_LegendClass",
"Id": "3d420403f3e7340499931324640efe96",
"DisableFx": false,
"OverrideFxId": "",
"IsMythicClassFx": true
}, {
"Name": "_LichMythicClass",
"Id": "5d501618a28bdc24c80007a5c937dcb7",
"DisableFx": false,
"OverrideFxId": "",
"IsMythicClassFx": true
}, {
"Name": "_SwarmThatWalksClass",
"Id": "5295b8e13c2303f4c88bdb3d7760a757",
"DisableFx": false,
"OverrideFxId": "",
"IsMythicClassFx": true
}, {
"Name": "_TricksterMythicClass",
"Id": "8df873a8c6e48294abdb78c45834aa0a",
"DisableFx": false,
"OverrideFxId": "",
"IsMythicClassFx": true
}, {
"Name": "AbjurationResistanceAcidBuff",
"Id": "b87a0e8a961c63a44a952822fe975edb",
"DisableFx": false,
Expand Down Expand Up @@ -168,6 +228,11 @@
"Id": "f5f500d6a2a39fc4181af32ad79af488",
"DisableFx": false,
"OverrideFxId": ""
}, {
"Name": "AngelSwordSpeedOfLightBuff",
"Id": "58d3b0b98ce4f9346b3c1fb4c7dbc9bf",
"DisableFx": false,
"OverrideFxId": ""
}, {
"Name": "AngelWardFromHarmBuff",
"Id": "8801f41b253263249a3d3a46cdf3b276",
Expand Down Expand Up @@ -718,6 +783,81 @@
"Id": "d389b135e67f7134c8d723e30a62c259",
"DisableFx": false,
"OverrideFxId": ""
}, {
"Name": "BuffWingsAngel",
"Id": "d596694ff285f3f429528547f441b1c0",
"DisableFx": false,
"OverrideFxId": ""
}, {
"Name": "BuffWingsAngelGhost",
"Id": "bd6980649fd60fa4085c34aa74ac47f2",
"DisableFx": false,
"OverrideFxId": ""
}, {
"Name": "BuffWingsDemon",
"Id": "3c958be25ab34dc448569331488bee27",
"DisableFx": false,
"OverrideFxId": ""
}, {
"Name": "BuffWingsDevil",
"Id": "38431e32f0e210342968d3a997eb233e",
"DisableFx": false,
"OverrideFxId": ""
}, {
"Name": "BuffWingsDraconicBlack",
"Id": "ddfe6e85e1eed7a40aa911280373c228",
"DisableFx": false,
"OverrideFxId": ""
}, {
"Name": "BuffWingsDraconicBlue",
"Id": "800cde038f9e6304d95365edc60ab0a4",
"DisableFx": false,
"OverrideFxId": ""
}, {
"Name": "BuffWingsDraconicBrass",
"Id": "7f5acae38fc1e0f4c9325d8a4f4f81fc",
"DisableFx": false,
"OverrideFxId": ""
}, {
"Name": "BuffWingsDraconicBronze",
"Id": "482ee5d001527204bb86e34240e2ce65",
"DisableFx": false,
"OverrideFxId": ""
}, {
"Name": "BuffWingsDraconicCopper",
"Id": "a25d6fc69cba80548832afc6c4787379",
"DisableFx": false,
"OverrideFxId": ""
}, {
"Name": "BuffWingsDraconicGold",
"Id": "984064a3dd0f25444ad143b8a33d7d92",
"DisableFx": false,
"OverrideFxId": ""
}, {
"Name": "BuffWingsDraconicGreen",
"Id": "a4ccc396e60a00f44907e95bc8bf463f",
"DisableFx": false,
"OverrideFxId": ""
}, {
"Name": "BuffWingsDraconicRed",
"Id": "08ae1c01155a2184db869e9ebedc758d",
"DisableFx": false,
"OverrideFxId": ""
}, {
"Name": "BuffWingsDraconicSilver",
"Id": "5a791c1b0bacee3459d7f5137fa0bd5f",
"DisableFx": false,
"OverrideFxId": ""
}, {
"Name": "BuffWingsDraconicWhite",
"Id": "381a168acd79cd54baf87a17ca861d9b",
"DisableFx": false,
"OverrideFxId": ""
}, {
"Name": "BuffWingsMutagen",
"Id": "e4979934bdb39d842b28bee614606823",
"DisableFx": false,
"OverrideFxId": ""
}, {
"Name": "BullsStrengthBuff",
"Id": "b175001b42b1a02479881b72fe132116",
Expand Down Expand Up @@ -3308,6 +3448,11 @@
"Id": "e40277752759edb49b557ce8399596bc",
"DisableFx": false,
"OverrideFxId": ""
}, {
"Name": "ProtectionFromSpellsBuffSpell",
"Id": "e9947402c84e8bc4e958b9be08d7a720",
"DisableFx": false,
"OverrideFxId": ""
}, {
"Name": "ProtectionJudgmentBuff",
"Id": "99345ce7c0f8001438fee23db660d039",
Expand Down Expand Up @@ -3996,7 +4141,22 @@
}, {
"Name": "StoneskinBuff",
"Id": "7aeaf147211349b40bb55c57fec8e28d",
"DisableFx": false,
"DisableFx": true,
"OverrideFxId": ""
}, {
"Name": "StoneskinBuffCL11",
"Id": "6215b25fbc1a36748b5606ebc0092074",
"DisableFx": true,
"OverrideFxId": ""
}, {
"Name": "StoneskinBuffLichImproved",
"Id": "e089f04285f995443a2e295d9b7a40e0",
"DisableFx": true,
"OverrideFxId": ""
}, {
"Name": "StoneskinCommunalBuff",
"Id": "714244637d461354b85b1808e7c6c814",
"DisableFx": true,
"OverrideFxId": ""
}, {
"Name": "StormwalkerWeaponBuff",
Expand Down

0 comments on commit 428af54

Please sign in to comment.