Ludeon Forums

Ludeon Forums

  • December 07, 2019, 09:31:59 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Some help patching  (Read 150 times)

itwasntmeright

  • Muffalo
  • *
  • Posts: 4
  • Refugee
    • View Profile
Some help patching
« on: August 05, 2019, 01:29:01 PM »

Hello,
I am trying to patch projectile from combat extended. More specificly speed and armor pen.
What's confusing me is, that speed works, but the armor penetration patch is failing.
This is my patch:
Code: [Select]
<?xml version="1.0" encoding="utf-8" ?>
<Patch>

<!-- ========== .50 Cal Sabot ========== -->

<Operation Class="PatchOperationReplace">
<xpath>/Defs/ThingDef[defName="Bullet_50BMG_Sabot"]/projectile/armorPenetration</xpath>
<value>
<armorPenetration>1.437</armorPenetration>
</value>
</Operation>

<Operation Class="PatchOperationReplace">
<xpath>/Defs/ThingDef[defName="Bullet_50BMG_Sabot"]/projectile/speed</xpath>
<value>
<speed>277</speed>
</value>
</Operation>
</Patch>

And this the Def im trying to patch:

Code: [Select]
  <ThingDef ParentName="Base50BMGBullet">
    <defName>Bullet_50BMG_Sabot</defName>
    <label>.50 BMG bullet (Sabot)</label>
    <projectile>
      <damageAmountBase>19</damageAmountBase>
      <armorPenetration>1.109</armorPenetration>
      <speed>250</speed>
    </projectile>
  </ThingDef>

This is the error log:
Code: [Select]
[Combat Extended Patches] Patch operation Verse.PatchOperationReplace(/Defs/ThingDef[defName="Bullet_50BMG_Sabot"]/projectile/armorPenetration) failed
file: D:\Programme\Steam\steamapps\common\RimWorld\Mods\CE Patches\Patches\ranges.xml
Verse.Log:Error(String, Boolean)
Verse.PatchOperation:Complete(String)
Verse.LoadedModManager:ClearCachedPatches()
Verse.LoadedModManager:LoadAllActiveMods()
Verse.PlayDataLoader:DoPlayLoad()
Verse.PlayDataLoader:LoadAllPlayData(Boolean)
Verse.Root:<Start>m__1()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1()

I have read through "A quick tutorial of xpathing and patching" and also tried the online xpath generator.
Hope someone can help.
Logged

Kirby23590

  • Planetologist
  • ****
  • Posts: 1303
  • Full Metal Yorkshire
    • View Profile
Re: Some help patching
« Reply #1 on: August 05, 2019, 01:50:15 PM »

You sure that's correct?

I think it's called "armorPenetrationBase" and not "armorPenetration"
Adding 'Base' at the end, would fix that problem...
Logged

One "happy family" in the rims...
Custom font made by Marnador.


itwasntmeright

  • Muffalo
  • *
  • Posts: 4
  • Refugee
    • View Profile
Re: Some help patching
« Reply #2 on: August 05, 2019, 01:58:13 PM »

You sure that's correct?

I think it's called "armorPenetrationBase" and not "armorPenetration"
Adding 'Base' at the end, would fix that problem...

You are right, thank you!
Logged