programmatically execute xml patch

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
kelmenwong
Posts: 195
Joined: Sat, 17. Mar 12, 18:40
x3tc

programmatically execute xml patch

Post by kelmenwong » Fri, 14. Aug 15, 19:01

XML Patch document standard RFC 5261
is mentioned in the modding tutorial

is the game come with the external component that can be run in .Net environment to execute modding xml-diff node?
or such component available free to public?

i tried googled such, but looks like m$ is using own stuff
The XML Diff and Patch GUI Tool
https://msdn.microsoft.com/en-us/library/aa302295.aspx

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13949
Joined: Sun, 20. Nov 05, 23:45
x4

Post by UniTrader » Fri, 14. Aug 15, 19:54

i doubt it will work in .net but here is an CLI-tool for xml diff files:
http://xmlpatch.sourceforge.net/

note that XR does not support the msel-extension implemented there. but there are tricks to circumvent this ^^
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

solntcev
Posts: 357
Joined: Thu, 27. Jun 13, 18:33
x4

Post by solntcev » Wed, 14. Oct 15, 15:52

What are you trying to do?

C: http://sourceforge.net/projects/xmlpatch/
Java: https://github.com/dnault/xml-patch

I also have partially implemented xmlpatch in Ruby for my scripts to read TO content in game.

Describe your task and maybe I can make tool for you.

jerry7890
Posts: 28
Joined: Mon, 13. Oct 08, 20:20

Post by jerry7890 » Thu, 3. Mar 16, 13:40

Which of the above mentioned tools can create the following <output file>?

tool.exe <input file 1> <input file 2> <output file>
where:
<input file 1> - xml extracted from 01-09.cat/dat (example: XR_extracted\libraries\unlocks.xml - 22 KB)
<input file 2> - same xml modified with the changed data or macros (example: WIP\modname_dev\libraries\unlocks.xml - 22 KB)
<output file> - xml patch for including in MOD (example: WIP\modname\libraries\unlocks.xml - 1 KB) (xml with sel, add ...)

<input file 1>+<output file>=<input file 2>

User avatar
YorrickVander
Posts: 2682
Joined: Tue, 29. Oct 13, 22:59
x4

Post by YorrickVander » Thu, 3. Mar 16, 14:25

@jerry -

I believe the C and Java versions both do the actual patch, just as occurs on game load.

a + b > c

a = xml from dat file
b = xml patch
c = xml the game reads

Creating the diff files yourself can seem a bit daunting when you are new to it and these tools will ease your learning curve by allowing you to see your resulting script and double checking the result of the patch is what you intneded. There are also some very competent guys on these forums that will be happy to help you once you step away from basic add and replace for whole nodes if things dont take correctly.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13949
Joined: Sun, 20. Nov 05, 23:45
x4

Post by UniTrader » Thu, 3. Mar 16, 15:08

The tool linked above can create such a file, but i wouldnt use it since its only compatible with vanilla files - if any mod changes the same file you will have the weirdest errors.
The problem is that the tool above uses sel paths in this style only:
/*[1]/*[2]/*[3]
which can only work if the original file is not changed.

May work as a start file, but the sel paths must be done properly before release..
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

jerry7890
Posts: 28
Joined: Mon, 13. Oct 08, 20:20

Post by jerry7890 » Thu, 3. Mar 16, 16:07

I checked the Java tool. It requires some Grade or something environment according to the readme. Too complex for stupid old me.:(

I'll check the C. But i recently installed XML tools plugin for NPP and only downloaded the required LIB for the plugin didn't check the command line tools. :oops:
I only try to update one unsupported old mod (find & replace in NPP)

When the Egosoft will realize that the game design is only 30-40%, the rest is OS Development == IDE tools for modders and docs, docs ... docs. :cry:

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13949
Joined: Sun, 20. Nov 05, 23:45
x4

Post by UniTrader » Thu, 3. Mar 16, 17:06

Here the docs,docs,docs for xml diff files:
https://tools.ietf.org/html/rfc5261
i dont think you can get more into detail than refering tho the Document which defines them...
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

jerry7890
Posts: 28
Joined: Mon, 13. Oct 08, 20:20

Post by jerry7890 » Thu, 3. Mar 16, 18:00

I'm referring to the docs about XR:
- the basics : how to start a script, load order of mods, how to assign a hotkey to a macro or menu command, ...;
- FFI, Lua, UI functions, parameters, parameter ranges what is acceptable and what not;
And all in one place, not to have to read/search 1000 different pages on different sites.

I recently discovered for me that in 01 or 02 cat/dat there is scriptproperties.html which extracts from the extracted files the valid constants, global variables, player.properties ... for the game version, and this useful source of data isn't mentioned anywhere or at least i didn't sow it.

How the newb like me will learn the basics?

Not to mention that its bad bisnes practice. The SDK for FO4 will be out 5 monts after debut.
There are >60000 mods for Skyrim only on Nexus. It's like having 1000 DLC. What kind of game will you buy, one with 1000 DLC or one with only few?
But its not for this thread.

Tnx for the help

Post Reply

Return to “X Rebirth - Scripts and Modding”