noimageavailable / dontshaveyourhead Goto Github PK
View Code? Open in Web Editor NEWDon't Shave Your Head mod for Rimworld
Don't Shave Your Head mod for Rimworld
Hi, were you planning on updating this for 1.1?
I did some quick tests on getting it to work, and these are the main changes required (aside from updating to Harmony 2 etc):
Harmony_PawnRenderer.cs
RenderPawnInternal now has an extra bool in its constructor, so the annotation has to look like:
[HarmonyPatch(typeof(PawnRenderer), "RenderPawnInternal", new Type[] { typeof(Vector3), typeof(float), typeof(bool), typeof(Rot4), typeof(Rot4), typeof(RotDrawMode), typeof(bool), typeof(bool), typeof(bool) })]
and the hide hair flag is now at index 12:
else if (code.opcode == OpCodes.Ldloc_S && code.operand is LocalBuilder b && b.LocalIndex == 12)
Hiya. I got the following when adding this in and I've no idea what it's about. Is ti something I need to worry about, and if so, is there a way to fix it?
Error while instantiating a mod of type DontShaveYourHead.Controller: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> HarmonyLib.HarmonyException: Patching exception in method null ---> System.ArgumentException: Undefined target method for patch method static System.Collections.Generic.IEnumerable1<HarmonyLib.CodeInstruction> DontShaveYourHead.Harmony_PawnRenderer::Transpiler(System.Collections.Generic.IEnumerable
1<HarmonyLib.CodeInstruction> instructions)
at HarmonyLib.PatchClassProcessor.PatchWithAttributes (System.Reflection.MethodBase& lastOriginal) [0x00047] in <255414689d344b1385ae719f6cce8c55>:0
at HarmonyLib.PatchClassProcessor.Patch () [0x00068] in <255414689d344b1385ae719f6cce8c55>:0
--- End of inner exception stack trace ---
at HarmonyLib.PatchClassProcessor.ReportException (System.Exception exception, System.Reflection.MethodBase original) [0x00127] in <255414689d344b1385ae719f6cce8c55>:0
at HarmonyLib.PatchClassProcessor.Patch () [0x00093] in <255414689d344b1385ae719f6cce8c55>:0
at HarmonyLib.Harmony.b__10_0 (System.Type type) [0x00007] in <255414689d344b1385ae719f6cce8c55>:0
at HarmonyLib.CollectionExtensions.Do[T] (System.Collections.Generic.IEnumerable1[T] sequence, System.Action
1[T] action) [0x00014] in <255414689d344b1385ae719f6cce8c55>:0
at HarmonyLib.Harmony.PatchAll (System.Reflection.Assembly assembly) [0x00006] in <255414689d344b1385ae719f6cce8c55>:0
at DontShaveYourHead.Controller..ctor (Verse.ModContentPack content) [0x00035] in <9ac716d721254319a6673c877a04d1d5>:0
at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke(System.Reflection.MonoCMethod,object,object[],System.Exception&)
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in :0
--- End of inner exception stack trace ---
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00014] in :0
at System.Reflection.MonoCMethod.DoInvoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0007a] in :0
at System.Reflection.MonoCMethod.Invoke (System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
at System.RuntimeType.CreateInstanceImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes, System.Threading.StackCrawlMark& stackMark) [0x00213] in :0
at System.Activator.CreateInstance (System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) [0x00095] in :0
at System.Activator.CreateInstance (System.Type type, System.Object[] args) [0x00000] in :0
at Verse.LoadedModManager.CreateModClasses () [0x00076] in <95de19971c5d40878d8742747904cdcd>:0
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
Verse.LoadedModManager:CreateModClasses ()
Verse.LoadedModManager:LoadAllActiveMods ()
Verse.PlayDataLoader:DoPlayLoad ()
Verse.PlayDataLoader:LoadAllPlayData (bool)
Verse.Root/<>c:b__6_1 ()
Verse.LongEventHandler:RunEventFromAnotherThread (System.Action)
Verse.LongEventHandler/<>c:b__27_0 ()
System.Threading.ThreadHelper:ThreadStart_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
System.Threading.ThreadHelper:ThreadStart ()
Update: Nov 20 @ 6:37am
Hey, just wanted to make a patch for one other hairmod I am using and wanted to ask how to do it.
Readme says:
To make a hair mod compatible all that is needed is for the texture to be in the appropriate place, no def editing necessary.
I don't exactly understand phrase. How and where do I need to put textures, or do I need to do def editing?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.