RimWorld
No hay suficientes valoraciones
ObjPath tester + CDATA tester
   
Premio
Favoritos
Favorito
Quitar
Mod, 1.4, 1.5, 1.6
Tamaño
Publicado el
Actualizado el
612.732 KB
4 NOV 2022 a las 5:01 a. m.
11 JUL a las 3:17 a. m.
3 notas sobre cambios ( ver )

Suscríbete para descargar
ObjPath tester + CDATA tester

En 1 colección creada por test
test's mods
19 artículos
Descripción
This tool allows you to validate objPaths in-game. it is a modding tool, it has no impact on gameplay.

Menu at Options - '+' - objPath tester.


objPath tester
DefDatabase operations in XML Extensions allow you to modify stuff that you can't patch with just XML, and you can apply them without having to restart the game. They use objPath instead of XPath, so you can validate your objPaths with this mod.
https://github.com/15adhami/XmlExtensions/wiki/Using-DefDatabase-Operations for more info on DefDatabase operations.

This mod can only output the objPath results to log. It isn't the most convenient way but still very useable.


Rich Text tester
Rich Text has nothing to do with objPath and DefDatabase operations, but I included it for no particular reason. You can use CDATA to add unity3D Rich Text formatting to any text strings in your mod, such as labels and descriptions.
https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/StyledText.html for more info on Rich Text formatting that you can use inside CDATA.

Basically you can put <![CDATA[some text]]> into any string, and put Rich Text formatting inside. For example <![CDATA[<b><color=green>Shrek</color><b>]]> will look be green bold text saying "Shrek".


This mod also has no custom code, it is in fact an extemely simple XML mod which just combines some XML Extensions functions.

Note that I have very little knowledge of what objPath actually is, I originally wanted an xpath tester that showed results after applying patch operations, but it didn't work. But replacing xpath with objpath worked so here it is, even though I don't really know how to use it and how useful this is
16 comentarios
NuanKi 25 JUN 2024 a las 12:33 a. m. 
Thanks, looks like i would need to repeat for each one, or simply use the default "required restart to apply"
test  [autor] 24 JUN 2024 a las 11:48 p. m. 
@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 24 JUN 2024 a las 9:51 p. m. 
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 24 JUN 2024 a las 9:18 p. m. 
Do you know how and where i can see the objPath of an item?
yavis 4 NOV 2022 a las 11:29 a. m. 
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 4 NOV 2022 a las 8:19 a. m. 
Well, thank you again - - I'll try:steamthumbsup:
test  [autor] 4 NOV 2022 a las 7:56 a. m. 
@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 4 NOV 2022 a las 7:40 a. m. 
You then add a DefDatabaseOperationReplace Go in -, -
yavis 4 NOV 2022 a las 7:35 a. m. 
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 4 NOV 2022 a las 6:41 a. m. 
You can call Imranfish
Let him edit the wiki again,:steamhappy:
Thank you so much!