[A17] XML Patch causes black screen

Started by Xnope, May 24, 2017, 02:59:35 PM

Previous topic - Next topic

Xnope

After "InitializingInterface" but before "Loading Defs" appears, this patch causes the game screen to go black and the music doesn't even start playing:


<Patch>
  <Operation Class="PatchOperationReplace">
    <xpath>//StatDef[defName = "MiningYield"]/</xpath>
<value>
  <maxValue>1.15</maxValue>
</value>
  </Operation>
</Patch>


Perhaps I just don't quite understand how patching works? I was using a def override before but decided since I was changing just his one value to give xml patching a stab.
My W.I.P. mods:
Carnivale: GitHub | Forum Post
XnopeCore: GitHub

Xnope

#1
Update: a silly typo caused the black screen. Spelling matters people!

For the interested: the forward slash after //StatDef[defName = "MiningYield"] caused the black screen. Also the proper xpath would have been

<xpath>//StatDef[defName = "MiningYield"]/maxValue</xpath>
My W.I.P. mods:
Carnivale: GitHub | Forum Post
XnopeCore: GitHub

Sp0nge

Im trying the same as you did here, but Im not able to get it working. Did yours work?

Xnope

Yes triple check all spelling. The last char in your xpatch should not be a forward slash. See the second code in my last comment. After this, you still have to do


<value>
    <maxValue>1.15</maxValue>
<value>


or whatever you patch entails.

If you still have problems, I love solving problems, so post your code here.
My W.I.P. mods:
Carnivale: GitHub | Forum Post
XnopeCore: GitHub

Sp0nge


faltonico

Quote from: Xnope on May 24, 2017, 03:33:11 PM

<xpath>//StatDef[defName = "MiningYield"]/maxValue</xpath>


Using // causes long loading times, or something like that.... In short it is not good to do that.
It searches everywhere on all the defs according to some of the tutorials here in the help forum.

skullywag

Aye:

/StatDefs/StatDef[defName = "MiningYield"] would be much faster (or whatever the 1st xml parent node in the relevant file is)

even */StatDefs/StatDef[defName = "MiningYield"] would be faster.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Xnope

Oops yeah I forgot to look at my actual code before replying to Sp0nge's question. What I actually had in the patch was

<xpath>/Defs/StatDef[defName = "MiningYield"]/maxValue</xpath>
My W.I.P. mods:
Carnivale: GitHub | Forum Post
XnopeCore: GitHub