Modding:Harmony: Difference between revisions

fix discord usernames for myself and arm
No edit summary
(fix discord usernames for myself and arm)
 
(5 intermediate revisions by 3 users not shown)
Line 5: Line 5:


For a primer on using Harmony to patch game methods, see [https://harmony.pardeike.net/articles/patching.html this article].
For a primer on using Harmony to patch game methods, see [https://harmony.pardeike.net/articles/patching.html this article].
While Harmony Patches are powerful and are often the easiest and most direct way to modify behaviour, they are more prone to incompatibility with other mods and future updates, and they can be more difficult to debug or troubleshoot if something goes wrong. A Harmony patch should be considered a last resort only if the desired functionality cannot otherwise be achieved by using the existing part and event infrastructure available in the game, or another similar solution.
That said, there do remain some situations in which Harmony patches are required in order to affect certain functionality. In these cases, Postfix patches tend to be the most compatibility friendly, followed by non-blocking Prefix patches. Prefix patches that prevent the main function from running or Transpiler Patches that modify the IL Code of a function are often more likely to conflict with other mods and should be avoided unless they are the only option.
In general, the Caves of Qud development team prefers data driven behavior, and would be likely to entertain adding a better hook for your mod to use than a Harmony patch.  Specifically, reach out to <code>@gnarf37</code> or <code>@armithaig</code> in <code>#modding</code> on the [https://discord.gg/cavesofqud Official Discord Server].


== Example: Chaotic-Colored Message Text ==
== Example: Chaotic-Colored Message Text ==