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

Messages - LeatherCat

#1
You can see pawn price at Numbers mod. This number includes pawn stats, current health state, body parts installed price. But Ratings described in this topic are much more better. I like it!
#2
Help / Re: customize enemy pawn AI in raid
December 14, 2019, 04:57:32 AM
I was wrong, enemy pawns on raid use main tree. Now I am thinking what is constant tree for.
#3
Help / Re: how do I override Pawn spawning/loading?
December 14, 2019, 04:49:36 AM
You may want look at PawnGenerator class. And method called something like find-player-start-location (don't remember exactly) with return type Vector3.
You may create harmony prefix patch with return false to not call original method.
#4
Releases / Re: [1.0] A RimWorld of Magic
December 13, 2019, 05:18:50 PM
Quote from: LeatherCat on December 09, 2019, 03:31:40 PM
Please, is the following initialization correct for CompAbilityUserMagic? Actually didn't find how it is initialized in original.
All types of Ability User Comp are automatically added to pawns at init (AbilityUser dll).
#5
Help / Re: customize enemy pawn AI in raid
December 13, 2019, 05:14:27 PM
Game decides by itself when to use main or constant thinkTree for every kind of situation.
So need to patch constantTree
#6
How many pawns were destroyed during development?  :D
#7
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>


#8
Help / Re: Modding development - speed up csharp loading
December 13, 2019, 02:15:14 PM
Quote from: Canute on December 13, 2019, 03:43:18 AM
I think when you would speed up the loading process, you would need a mod compiler which load all the mod's like rimworld would do and create a meta mod based on all loaded mod which don't need any patching anymore (beside Core).
Exactly! Kind of 'Save final patched code as new dll'. Use this dll during development only.

From logs:
45 seconds ExecuteToExecuteWhenFinished()
where: 37 sec Static constructor calls - what is I guess Harmony patches, right? they are defined in Static constructors
#9
Help / Re: Modding development - speed up csharp loading
December 12, 2019, 02:44:08 PM
Thank you! I think more about what I asked and it seams impossible.
I afraid that ILMerge will only merge classes from initial assemblies, but not the resulting dynamic assembly after all dynamic patches applied... So patches will be applied anyway on every game startup.
But I have to try it, just need to think how to test that patches are not applied during runtime, but already exist in assembly. Thank you for help once again!
#10
 There is already kind of score in pawn price attribute.
#11
Help / Re: My medics feed pawns with drugs
December 12, 2019, 09:20:17 AM
Does medic have DrugFeeder trait?
#12
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
#13
Quote from: LeatherCat on December 10, 2019, 01:56:01 AM
Hey! Thank you for this mod!
I am wondering how CompElderThing is added to all pawns?
ElderThingFaction.CompElderThing.CompTick is called every game tick... Is it possible to remove compThing from pawn?
Oh I see... AbilityUser.AbilityUserUtility.TransformPawn from AbilityUser.dll adds components of typeof(CompAbilityUser) to all humanlike pawns via harmony patches. Need to digest...
#14
Hey! Thank you for this mod!
I am wondering how CompElderThing is added to all pawns?
ElderThingFaction.CompElderThing.CompTick is called every game tick... Is it possible to remove compThing from pawn?
#15
Releases / Re: [1.0] A RimWorld of Magic
December 09, 2019, 03:31:40 PM
I am trying to "fork" this mod but getting NullPointer when click on pawn with CompAbilityUserMagic component.
Please, is the following initialization correct for CompAbilityUserMagic? Actually didn't find how it is initialized in original.


// add CompAbilityUserMagic component to pawn entity:
ThingWithComps entity = pawn;
ThingComp thingComp = new CompAbilityUserMagic();
thingComp.parent = entity;
CompProperties compProps = new CompProperties(thingComp.GetType());
thingComp.Initialize(compProps);



// component was added:
var compAbilityUserMagic = pawn.TryGetComp<CompAbilityUserMagic>();
Log.Message("add ability");
compAbilityUserMagic.AddPawnAbility(TorannMagicDefOf.TM_PsionicBlast);