RimWorld
Romance On The Rim
 Este tema se ha marcado como fijo, por lo que probablemente sea importante
telardo  [desarrollador] 21 NOV 2021 a las 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.
< >
Mostrando 1-1 de 1 comentarios
telardo  [desarrollador] 21 NOV 2021 a las 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.^^
< >
Mostrando 1-1 de 1 comentarios
Por página: 1530 50