Menu

Show posts

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.

Show posts Menu

Topics - LeatherCat

#1
Help / customize enemy pawn AI in raid
December 13, 2019, 04:53:54 PM
I've spent several hours for customizing Humanlike ThinkTreeDef with battle-related nodes
when I seams pawns in raid think using HumanlikeConstant tree  ;D

I am thinking about:
how to switch Humanlike and HumanlikeConstant trees?
OR maybe is it possible to inject my custom tree into HumanlikeConstant tree (there are no insertTag hook)?

<ThinkTreeDef>
    <defName>HumanlikeConstant</defName>
    <thinkRoot Class="ThinkNode_Priority">
      <subNodes>
        <li Class="ThinkNode_ConditionalCanDoConstantThinkTreeJobNow" ListIndex="0">
          <subNodes>
            <!-- Flee explosion -->
            <li Class="JobGiver_FleePotentialExplosion" ListIndex="0" />
            <!-- Hostility response -->
            <li Class="JobGiver_ConfigurableHostilityResponse" ListIndex="1" />
            <!-- Lord directives -->
            <li Class="ThinkNode_Subtree" ListIndex="2">
              <treeDef>LordDutyConstant</treeDef>
            </li>
          </subNodes>
        </li>
      </subNodes>
    </thinkRoot>
  </ThinkTreeDef>


#2
Help / Modding development - speed up csharp loading
December 11, 2019, 03:21:21 PM
Technical question to .NET experts.

Scenario:
I am developing mod which is already depends on other 5 mods (3 of them are technical mods like JecsTools).
Game load time is ~1 minute in total, and 50% for dll loading and patching. So is it possible to like "compile" game with all harmony patches from other mod dlls once?

Load order:
Fat.dll = game + system + mod dlls
MyMod.dll
#3
Mods / How to print object as json/xml in Log.Message
December 06, 2019, 05:30:15 PM
Hey!
In general - I need to print some objects using Log.Message. How does one do that in rimworld project?

I tried to serialize with .NET System.Runtime.Serialization and JavaScriptSerializer.
I've added required .NET dlls into Assemblies where is my mod's dll built. These dlls are from .NET 2.0 and 3.5
Mod is built fine.

But there is an error when game is loaded:
ReflectionTypeLoadException getting types in assembly System.Runtime.Serialization: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)


I joined discord  - can't type in any channel yet...