RimWorld

RimWorld

Romance On The Rim
 Toto téma bylo přilepeno, takže je nejspíš důležité
telardo  [vývojář] 21. lis. 2021 v 19.14
Compatibility Guide (For modder)
I received several requests about filling pawns' romance need bar with interactions/activities in other romance mods. In most cases, I need a tedious transpiler but it can be done easily in these mods. If you're interested in adding this compatibility for your mod, the guide reads as follows.
First, we need to get the method info for the hook function with reflection.
using HarmonyLib; using System; using System.Reflection; using Verse; namespace YourMod { [StaticConstructorOnStartup] public static class HelperClass { public static MethodInfo fillRomanceBarMI; static HelperClass() { // check for this mod and get method info for hook if (ModLister.HasActiveModWithName("Romance On The Rim")) { fillRomanceBarMI = AccessTools.DeclaredMethod(Type.GetType("RomanceOnTheRim.RomanceUtility,RomanceOnTheRim"), "TryAffectRomanceNeedLevelForPawn"); } } } }
Once you have that static method info, you can invoke it to fill the romance need bar with
HelperClass.fillRomanceBarMI?.Invoke(null, new object[] { pawn, 0.2f });
, the first parameter in the hook function is the target pawn, the second is the need level offset. You can add it in your job driver, maybe in a tickaction or finishaction.
< >
Zobrazuje se 11 z 1 komentářů
telardo  [vývojář] 21. lis. 2021 v 19.17 
Thanks for making your mod fully compatible with this mod. If you have any questions about the guide, leave me a comment and I will try my best to offer help.^^
< >
Zobrazuje se 11 z 1 komentářů
Na stránku: 1530 50