RimWorld

RimWorld

Romance On The Rim
 This topic has been pinned, so it's probably important
telardo  [developer] 21 Nov, 2021 @ 7:14pm
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.
< >
Showing 1-1 of 1 comments
telardo  [developer] 21 Nov, 2021 @ 7:17pm 
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.^^
< >
Showing 1-1 of 1 comments
Per page: 1530 50