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 - K4nna

#1
Help / Use <weight> with <statFactors> ?
May 24, 2022, 02:30:54 AM
Hi,

I have a patch like that:
<li Class="PatchOperationAdd">
<xpath>/Defs/StatDef[defName="PruningSpeed" or defName="MeditationFocusGain"]</xpath>
  <value>
    <statFactors>
      <li>PsychicSensitivity</li>
    </statFactors>
  </value>
</li>


The effect is a bit too strong, I want to reduce the weight of the statFactors, in the same way it's done for <capacityFactors>. But nothing working, I can't find a good syntax, and that is never done in the game files, so maybe I just can't do that.

Any idea please?
#2
Help / xpath syntax for multiple selection
May 23, 2022, 11:37:32 PM
Hi,

How is the correct syntax for my xpath please?

<xpath>/Defs/ThingDef[ ??? ]</xpath>

I want to select all ThingDef who have <minifiedDef>MinifiedThing</minifiedDef>, but who don't have <compClass>CompQuality</compClass> (select all the minifiable buildings who don't have quality).

I tried various things without find the good one :/


Also, can I use PatchOperation to add a new node who use the same value of another node? (add <WorkToMake> with the same value of <WorkToBuild>). I think no, but maybe...?
#3
Help / Make psychite tea - CanGiveJob and JobOnX
April 07, 2022, 05:42:03 AM
Hello,

I make a little mod who adds campfires, and in last checking I found a bug who seems to affect all modded campfires/stoves.
It happens only when the first job at the modded campfire/stove is Make psychite tea (or the x4), the pawn will skip the job the first time, then all seems to works fine all the long for this savegame.
(If a pawn cook something else first at the campfire/stove, then psychite tea, no error happens)

The error is:
RimWorld.WorkGiver_DoBill provided target Thing_Darkcampfire24049 but yielded no actual job for pawn Dacato. The CanGiveJob and JobOnX methods may not be synchronized.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
Verse.Log:ErrorOnce (string,int)
RimWorld.JobGiver_Work:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_PrioritySorter:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Tagger:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Subtree:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Conditional:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.Pawn_JobTracker:DetermineNextJob (Verse.ThinkTreeDef&)
Verse.AI.Pawn_JobTracker:TryFindAndStartJob ()
(wrapper dynamic-method) Verse.AI.Pawn_JobTracker:Verse.AI.Pawn_JobTracker.EndCurrentJob_Patch1 (Verse.AI.Pawn_JobTracker,Verse.AI.JobCondition,bool,bool)
Verse.AI.Pawn_JobTracker:JobTrackerTick ()
(wrapper dynamic-method) Verse.Pawn:Verse.Pawn.Tick_Patch2 (Verse.Pawn)
(wrapper dynamic-method) Verse.TickList:Verse.TickList.Tick_Patch2 (Verse.TickList)
(wrapper dynamic-method) Verse.TickManager:Verse.TickManager.DoSingleTick_Patch2 (Verse.TickManager)
Verse.TickManager:TickManagerUpdate ()
Verse.Game:UpdatePlay ()
Verse.Root_Play:Update ()


I patched all the same things I can see for campfire in xml files, I don't see what I can do more. I checked others mods and nothing special is done (and the same issue happens).

Can I safely ignore this bug? (very situational)

Thank you for reading.
#4
Hello,
I want to be able to meet baby and juvenile wild animals when I enter on a new map, or as animals entering on my map.
As I found no mod for that, I want to see if I can do it.
First, I found it seems I can't do it with only xml, my last hint from xml is GenStep_Animals.

Even if I don't know C#, I search to understand how wild animal generation works, to see if I would be able to patch it if I learn to mod with C#.
So I opened files with dnSpy, found WildAnimalSpawner, saw they seems to be spawn with:

GenSpawn.Spawn(PawnGenerator.GeneratePawn(pawnKindDef, null), loc2, this.map, WipeMode.Vanish);

who send me to PawnGenerationRequest who give me:

public PawnGenerationRequest(PawnKindDef kind, Faction faction = null, PawnGenerationContext context = PawnGenerationContext.NonPlayer, int tile = -1, bool forceGenerateNewPawn = false, bool newborn = false, bool allowDead = false, bool allowDowned = false, bool canGeneratePawnRelations = true, bool mustBeCapableOfViolence = false, float colonistRelationChanceFactor = 1f, bool forceAddFreeWarmLayerIfNeeded = false, bool allowGay = true, bool allowFood = true, bool allowAddictions = true, bool inhabitant = false, bool certainlyBeenInCryptosleep = false, bool forceRedressWorldPawnIfFormerColonist = false, bool worldPawnFactionDoesntMatter = false, float biocodeWeaponChance = 0f, float biocodeApparelChance = 0f, Pawn extraPawnForExtraRelationChance = null, float relationWithExtraPawnChanceFactor = 1f, Predicate<Pawn> validatorPreGear = null, Predicate<Pawn> validatorPostGear = null, IEnumerable<TraitDef> forcedTraits = null, IEnumerable<TraitDef> prohibitedTraits = null, float? minChanceToRedressWorldPawn = null, float? fixedBiologicalAge = null, float? fixedChronologicalAge = null, Gender? fixedGender = null, float? fixedMelanin = null, string fixedLastName = null, string fixedBirthName = null, RoyalTitleDef fixedTitle = null, Ideo fixedIdeo = null, bool forceNoIdeo = false, bool forceNoBackstory = false, bool forbidAnyTitle = false)

Here I see newborn, who could make spawn as a newborn baby, not really what I want, and fixedBiologicalAge = null, but I don't think it's what I search for.
So I reach a dead end without find why wild animals always spawn as adult.
I don't search in the right place? any idea please?
#5
Bugs / [1.3.3102] Slab bed, Flammability missing
August 29, 2021, 05:15:44 AM
Hello,

The Wooden slab bed can't burn, same for Metallic and for Slab double bed.

By looking xml files, we found from where the issue come:
<statBases Inherit="False">
      <MaxHitPoints>140</MaxHitPoints>
      <WorkToBuild>400</WorkToBuild>
      <Mass>30</Mass>
      <BedRestEffectiveness>1</BedRestEffectiveness>
      <ImmunityGainSpeedFactor>1.07</ImmunityGainSpeedFactor>
      <SurgerySuccessChanceFactor>1</SurgerySuccessChanceFactor>
    </statBases>

Inherit="False" without <Flammability>1.0</Flammability>, so of course it can't burn.

My guess is that Slab bed was thought to be made only from stone, then woody/metallic was added but flammability forgotten.
#6
Ideas / Auto-release to wild
August 11, 2021, 06:23:15 AM
Hello,

It could be nice to be able to toggle the auto-slaughter into a auto-release to wild, for 'killing innocent animals' precept.
#7
Bugs / [1.3.3080] animal bed, missing owner name
August 10, 2021, 04:53:45 AM
Hello,
With 1.3, you forgot to add <drawGUIOverlay>true</drawGUIOverlay> for the AnimalBed, as you did for AnimalSleepingSpot and AnimalSleepingBox.


Also, the bed owner name for animal beds should match with the Show animal names(None, Tame (named only), Tame (all)) setting, as it make no sense to choose to don't show animal names but to have to see all bed owner name in the barn (and it's hideous).
#8
Hi,
For buildings, we can use <building><expandHomeArea>false</expandHomeArea></building>.
I would like to do the same for flooring, but I don't know how.
I can't only copy/paste, <building> is not for TerrainDef, and I don't know where to put <expandHomeArea>false</expandHomeArea>...

An idea please?
#9
Hi,

I want to add a custom affordance to the shallow water.
I tried to process by the same way I did with the mud, but it doesn't works.

<li Class="PatchOperationAdd">
<xpath>/Defs/TerrainDef[defName = "Mud"]/affordances</xpath>
<value>
<li>MyCustomAffordance</li>
</value>
</li>

<li Class="PatchOperationAdd">
<xpath>/Defs/TerrainDef[defName = "WaterShallowBase"]/affordances</xpath>
<value>
<li>MyCustomAffordance</li>
</value>
</li>

<li Class="PatchOperationAdd">
<xpath>/Defs/TerrainDef[defName = "WaterShallow"]/affordances</xpath>
<value>
<li>MyCustomAffordance</li>
</value>
</li>


The first works fine for mud.
I think the second doesn't works because WaterShallowBase haven't a <defName>.
I don't understand why the third doesn't works.

In Terrain_Water.xml, we have:
<TerrainDef Abstract="True" Name="WaterShallowBase" ParentName="WaterBase">
    <pathCost>30</pathCost>
    <affordances>
      <li>ShallowWater</li>
      <li>Bridgeable</li>
    </affordances>
  </TerrainDef>

  <TerrainDef ParentName="WaterShallowBase">
    <defName>WaterShallow</defName>
    <label>shallow water</label>
    <texturePath>Terrain/Surfaces/WaterShallowRamp</texturePath>
    <waterDepthShader>Map/WaterDepth</waterDepthShader>
    <renderPrecedence>394</renderPrecedence>
    <driesTo>Gravel</driesTo>
  </TerrainDef>


I tried to use PatchOperationInsert for WaterShallow, but I have an error (duplicate <affordances>)

My file is Patches\TerrainPatches\TerrainPatch.xml

What I have missed please?