Same issue, natural born child in tribal start, selected stay tribesman at first growth moment. Has the "Tribe Child" backstory which seems to lack to natural focus meditation type, compared to the base game "Tribe Child" which includes a few skill bonuses and the natural focus meditation. Using Character editor mod to manually fix.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Pages1
#1
Bugs / Re: [1.4.3524] Vanilla, With DLC: Tribe Child trait don't have natural meditate type
October 27, 2022, 11:08:37 PM #2
Help / Re: makeImmuneTo Tag & FoodPoisoning [harmony help request]
June 17, 2019, 06:04:55 AM
Resolved, it turns out the .net framework has to be set to 3.5 and you will have to reload your harmony package for it to compile properly.
#3
Help / Re: makeImmuneTo Tag & FoodPoisoning [harmony help request]
June 17, 2019, 04:33:33 AM
Finally home and got a chance to compile and test it. It compiled and it throws a plethora of Harmony typeload errors on startup, I did some research online and there are some archaic posts about it being a .NET framework conflict but that doesn't seem relevant as the 0Harmony.dll im using is compiled for .NET F472
Heres the log:
Which leads me to believe its something borked in my namespace.
Heres the log:
Code Select
ReflectionTypeLoadException getting types in assembly 0Harmony: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0
at Verse.ModAssemblyHandler.AssemblyIsUsable (System.Reflection.Assembly asm) [0x00000] in <filename unknown>:0
Loader exceptions:
=> System.TypeLoadException: Could not load type 'Harmony.Traverse' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.CodeTranspiler+<>c' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.CodeTranspiler+<ConvertToOurInstructions>d__7' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.Patches+<>c' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.HarmonyInstance+<>c' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.HarmonyMethod+<>c' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.HarmonyMethod+<>c__DisplayClass13_0' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.HarmonyMethod+<>c__DisplayClass13_1' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.HarmonyMethod+<>c__DisplayClass14_0' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.HarmonyMethodExtensions+<>c__DisplayClass0_0' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.HarmonyMethodExtensions+<>c__DisplayClass2_0' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.HarmonyMethodExtensions+<>c' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.HarmonySharedState+<>c' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.MethodPatcher+<>c' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.PatchFunctions+<>c' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.PatchProcessor+<>c' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.AccessTools+<>c' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.AccessTools+<>c__DisplayClass21_0' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.AccessTools+<>c__DisplayClass22_0' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.AccessTools+<>c__DisplayClass23_0' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.AccessTools+<>c__DisplayClass24_0' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.AccessTools+<>c__DisplayClass36_0' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.GeneralExtensions+<>c__DisplayClass0_0`1[T]' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.GeneralExtensions+<>c__0`1[T]' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.GeneralExtensions+<>c' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.PatchTools+<>c__2`1[T]' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.Tools.SelfPatching+<>c' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.ILCopying.Emitter+<>c' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type 'Harmony.ILCopying.MethodBodyReader+<>c' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type '<>c' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type '<>c__DisplayClass36_0' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type '<>c__DisplayClass37_0' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type '<>c__DisplayClass38_0' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type '<>c__DisplayClass39_0' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type '<>c__DisplayClass40_0' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
=> System.TypeLoadException: Could not load type '<>c__DisplayClass41_0' from assembly '0Harmony, Version=1.2.0.1, Culture=neutral, PublicKeyToken=null'.
Verse.Log:Error(String, Boolean)
Verse.ModAssemblyHandler:AssemblyIsUsable(Assembly)
Verse.ModAssemblyHandler:ReloadAll()
Verse.ModContentPack:ReloadContent()
Verse.LoadedModManager:LoadModContent()
Verse.LoadedModManager:LoadAllActiveMods()
Verse.PlayDataLoader:DoPlayLoad()
Verse.PlayDataLoader:LoadAllPlayData(Boolean)
Verse.Root:<Start>m__1()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1()
Which leads me to believe its something borked in my namespace.
#4
Help / Re: makeImmuneTo Tag & FoodPoisoning [harmony help request]
June 17, 2019, 01:03:01 AM
Heres my first attempt at the harmony patch.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
using Harmony;
using RimWorld;
using Verse;
namespace EvolvedOrgans
{
[StaticConstructorOnStartup]
static class HarmonyPatches
{
static HarmonyPatches()
{
HarmonyInstance harmony = HarmonyInstance.Create("rimworld.evolvedorgans");
MethodInfo targetmethod = AccessTools.Method(typeof(RimWorld.FoodUtility), "AddFoodPoisoningHediff");
HarmonyMethod prefixmethod = new HarmonyMethod(typeof(EvolvedOrgans.HarmonyPatches).GetMethod("AddFoodPoisoningHediff_Prefix"));
harmony.Patch(targetmethod, prefixmethod, null);
}
public static void AddFoodPoisoningHediff_Prefix(Pawn pawn)
{
if (pawn.health.immunity.GetImmunity(HediffDefOf.FoodPoisoning) > 0f)
{
return;
}
}
}
}
Feedback appreciated.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
using Harmony;
using RimWorld;
using Verse;
namespace EvolvedOrgans
{
[StaticConstructorOnStartup]
static class HarmonyPatches
{
static HarmonyPatches()
{
HarmonyInstance harmony = HarmonyInstance.Create("rimworld.evolvedorgans");
MethodInfo targetmethod = AccessTools.Method(typeof(RimWorld.FoodUtility), "AddFoodPoisoningHediff");
HarmonyMethod prefixmethod = new HarmonyMethod(typeof(EvolvedOrgans.HarmonyPatches).GetMethod("AddFoodPoisoningHediff_Prefix"));
harmony.Patch(targetmethod, prefixmethod, null);
}
public static void AddFoodPoisoningHediff_Prefix(Pawn pawn)
{
if (pawn.health.immunity.GetImmunity(HediffDefOf.FoodPoisoning) > 0f)
{
return;
}
}
}
}
Feedback appreciated.
#5
Help / Re: makeImmuneTo Tag & FoodPoisoning
June 16, 2019, 03:18:16 PM
Jeez reading the Harmony Transpiler Tutorial is a bit intimidating. Just executing a prefix to the hediffgiver method to evaluate the Immunizable DefOf FoodPoisoning of the pawn being considered for the hediff and exiting the method if the evaluation returns anything greater than zero i think will be the direction I go. I'm open to suggestions if there is another way.
#6
Help / Re: makeImmuneTo Tag & FoodPoisoning
June 16, 2019, 02:35:16 PM
I am but exclusively, I just dived into the source of the game yesterday. I have more experience with Java than C# but they are relatively similar. I'm going to be investigating the harmony framework as I understand that is the best way to inject C# assemblies.
As far as my experience with Rimworld, about 1000 hours played, about 200 hours tinkering with basic XML modding.
As far as my experience with Rimworld, about 1000 hours played, about 200 hours tinkering with basic XML modding.
#7
Help / Re: Best way to call debug function in code
June 16, 2019, 07:16:37 AM
All the debug events are triggered with worker classes for each specific event for example an infestation:
public class IncidentWorker_Infestation : IncidentWorker
which is checked with a evaluation:
protected override bool CanFireNowSub(IncidentParms parms)
{
Map map = (Map)parms.target;
IntVec3 intVec;
return base.CanFireNowSub(parms) && HiveUtility.TotalSpawnedHivesCount(map) < 30 && InfestationCellFinder.TryFindCell(out intVec, map);
}
then executed:
protected override bool TryExecuteWorker(IncidentParms parms)
{
Map map = (Map)parms.target;
int hiveCount = Mathf.Max(GenMath.RoundRandom(parms.points / 220f), 1);
Thing t = this.SpawnTunnels(hiveCount, map);
base.SendStandardLetter(t, null, new string[0]);
Find.TickManager.slower.SignalForceNormalSpeedShort();
return true;
}
Depending on how you want to execute the events, manually running the IncidentWorker_Infestation.TryExecuteWorker() would manually spawn a infestation. I'm pretty sure all the other events run off the same classes and methods to some degree. I hope this gives you some direction.
public class IncidentWorker_Infestation : IncidentWorker
which is checked with a evaluation:
protected override bool CanFireNowSub(IncidentParms parms)
{
Map map = (Map)parms.target;
IntVec3 intVec;
return base.CanFireNowSub(parms) && HiveUtility.TotalSpawnedHivesCount(map) < 30 && InfestationCellFinder.TryFindCell(out intVec, map);
}
then executed:
protected override bool TryExecuteWorker(IncidentParms parms)
{
Map map = (Map)parms.target;
int hiveCount = Mathf.Max(GenMath.RoundRandom(parms.points / 220f), 1);
Thing t = this.SpawnTunnels(hiveCount, map);
base.SendStandardLetter(t, null, new string[0]);
Find.TickManager.slower.SignalForceNormalSpeedShort();
return true;
}
Depending on how you want to execute the events, manually running the IncidentWorker_Infestation.TryExecuteWorker() would manually spawn a infestation. I'm pretty sure all the other events run off the same classes and methods to some degree. I hope this gives you some direction.
#8
Help / Re: makeImmuneTo Tag & FoodPoisoning
June 16, 2019, 07:03:13 AM
So even with adding the Immunizable property to the FoodPoisoning HediffDef in xml, the code doesn't seem to ever evaluate it before running the hediffgiver. I think the only way to fix this is with a assembly to add an evaluation like :
if (pawn.health.immunity.GetImmunity(HediffDefOf.FoodPoisoning) > 0f)
{
return;
}
if (pawn.health.immunity.GetImmunity(HediffDefOf.FoodPoisoning) > 0f)
{
return;
}
#9
Help / [Resolved] makeImmuneTo Tag & FoodPoisoning [harmony help request]
June 16, 2019, 02:19:12 AM
Does the <makeImmuneTo> tag in the HediffDef class not prevent the FoodPoisoning hediff?
Code is below for the implant, it gives the proper tooltip in game "Prevents Infection: Food Poisoning" however, the pawn is still capable of contracting it. Is this some symptom of the uniqueness of the food poisoning hediff or is there something I'm doing wrong?
<HediffDef ParentName="AddedBodyPartBase">
<defName>EvolvedStomach</defName>
<label>evolved stomach</label>
<labelNoun>an evolved stomach</labelNoun>
<spawnThingOnRemoved>EvolvedStomach</spawnThingOnRemoved>
<addedPartProps>
<solid>true</solid>
<partEfficiency>2.0</partEfficiency>
</addedPartProps>
<stages>
<li>
<makeImmuneTo>
<li>FoodPoisoning</li>
</makeImmuneTo>
<hungerRateFactor>0.75</hungerRateFactor>
</li>
</stages>
</HediffDef>
Code is below for the implant, it gives the proper tooltip in game "Prevents Infection: Food Poisoning" however, the pawn is still capable of contracting it. Is this some symptom of the uniqueness of the food poisoning hediff or is there something I'm doing wrong?
<HediffDef ParentName="AddedBodyPartBase">
<defName>EvolvedStomach</defName>
<label>evolved stomach</label>
<labelNoun>an evolved stomach</labelNoun>
<spawnThingOnRemoved>EvolvedStomach</spawnThingOnRemoved>
<addedPartProps>
<solid>true</solid>
<partEfficiency>2.0</partEfficiency>
</addedPartProps>
<stages>
<li>
<makeImmuneTo>
<li>FoodPoisoning</li>
</makeImmuneTo>
<hungerRateFactor>0.75</hungerRateFactor>
</li>
</stages>
</HediffDef>
Pages1