边缘世界 RimWorld

边缘世界 RimWorld

ObjPath tester + CDATA tester
16 条留言
NuanKi 2024 年 6 月 25 日 上午 12:33 
Thanks, looks like i would need to repeat for each one, or simply use the default "required restart to apply"
test  [作者] 2024 年 6 月 24 日 下午 11:48 
@NuanKi I don't think that's possible, the game resolves parents meaning their nodes are copied into all children, before creating defdatabase. The parent thing is more of a convenience for modders and no longer exists at that stage
NuanKi 2024 年 6 月 24 日 下午 9:51 
this is what i make, and it works, but how can we specify all the defs with the same parent, in this case FlagstoneBase:
TerrainDef/[defName="FlagstoneGranite"]/costList/*
NuanKi 2024 年 6 月 24 日 下午 9:18 
Do you know how and where i can see the objPath of an item?
yavis 2022 年 11 月 4 日 上午 11:29 
I tested it and it passed!
The last code you posted is correct.
Because this code has many entries, as long as one of them is wrong, all of them will report the same error.
yavis 2022 年 11 月 4 日 上午 8:19 
Well, thank you again - - I'll try:steamthumbsup:
test  [作者] 2022 年 11 月 4 日 上午 7:56 
@yavis not sure if that is the issue but you need to add a node inside valu like in normal patch operations, like this
<Operation Class="XmlExtensions.DefDatabaseOperationReplace">
<objPath>HediffDef/[defName = "ControlSublinkImplant"]/stages/[1]/statOffsets/[stat/defName="WorkSpeedGlobalOffsetMech"]/value</objPath>
<value>
<val>52</val><!--The name of the node doesn't matter, only the inner text will be parsed-->
</value>
</Operation>
yavis 2022 年 11 月 4 日 上午 7:40 
You then add a DefDatabaseOperationReplace Go in -, -
yavis 2022 年 11 月 4 日 上午 7:35 
DefDatabaseConditional
ok
DefDatabaseLog
ok
DefDatabaseOperationReplace
Failed to find a node referenced by <objPath>

:steamfacepalm:

<Operation Class="XmlExtensions.DefDatabaseOperationReplace">
<objPath>HediffDef/[defName = "ControlSublinkImplant"]/stages/[1]/statOffsets/[stat/defName="WorkSpeedGlobalOffsetMech"]/value</objPath>
<value>52</value>
</Operation>
yavis 2022 年 11 月 4 日 上午 6:41 
You can call Imranfish
Let him edit the wiki again,:steamhappy:
Thank you so much!
test  [作者] 2022 年 11 月 4 日 上午 6:36 
@yavis you can select all of them with HediffDef/[defName = "ControlSublinkImplant"]/stages/*/statOffsets/[stat/defName="WorkSpeedGlobalOffsetMech"]/value
yavis 2022 年 11 月 4 日 上午 6:34 
-,-
Well, it's actually two together
Second:
“ControlSublinkImplant”]/stages/[2]/statOffsets/[stat/defName=“WorkSpeedGlobalOffsetMech”]/value?
test  [作者] 2022 年 11 月 4 日 上午 6:30 
@yavis okay I bruteforced it, its HediffDef/[defName = "ControlSublinkImplant"]/stages/[1]/statOffsets/[stat/defName="WorkSpeedGlobalOffsetMech"]/value
yavis 2022 年 11 月 4 日 上午 6:28 
”statOffsets/defName=“WorkSpeedGlobalOffsetMech”
I know this way, but this status is assigned by level, and each level has a different status, so it shouldn't be right to use this way

https://github.com/15adhami/XmlExtensions/wiki/Using-DefDatabase-Operations
This link has the list method inside, but I don't understand it very well, I tested many methods and finally gave up.
Your mod is good, I can try again
test  [作者] 2022 年 11 月 4 日 上午 5:55 
@yavis I imagine objPath will look different from xpath, for example I don't think it uses li nodes. It probably uses something like statOffsets/defName="WorkSpeedGlobalOffsetMech". I have an idea about how to extract defDatabase but I don't know if it is going to work yet. Otherwise the only ways to get a working objPath appear to be looking at C# or just bruteforcing stuff with this mod
yavis 2022 年 11 月 4 日 上午 5:50 
Are you asking me to test the last question I posted in discord? haha
You are awesome!

<objPath>HediffDef/[defName = "ControlSublinkImplant"]/stages/li/[1]/statOffsets/WorkSpeedGlobalOffsetMech<objPath>
Failed to find a node referenced by <objPath>