power crystals' XML patcher and data exporter (now under old management)

User avatar
The W:AB Noob
Lieutenant General
Posts: 4575
Joined: Fri 12 Jul 2013 22:29
Location: United States, Central Time Zone
Contact:

Re: power crystals' XML patcher and data exporter (now under old management)

Postby The W:AB Noob » Thu 20 Oct 2016 03:03

Is adding TableStrings not supported?

Example code:

Code: Select all

<change operation="select" property="MapCoalitionToCountry" key="NSWP"/>
         <change operation="clear" />
         <change operation="add" type="TableString">URSS</change>
         <change operation="add" type="TableString">CHI</change>
         <change operation="unselect" />


Error message:

Code: Select all

Unable to determine type while in nested context in patch XXX and specified type is invalid!


Thanks.

User avatar
Bollywood Baloney
Chief Warrant Officer
Posts: 516
Joined: Thu 7 May 2015 21:32
Contact:

Re: power crystals' XML patcher and data exporter (now under old management)

Postby Bollywood Baloney » Tue 25 Oct 2016 10:19

Works for me. Try this instead

Code: Select all

<change operation="select" property="MapCoalitionToCountry" key="NSWP"/>
         <change operation="clear" type="list" />
         <change operation="append" type="TableString">URSS</change>
         <change operation="append" type="TableString">CHI</change>
         <change operation="unselect" />


I don't think add vs append matters all that much, but that's what I use

nooot95
Private
Posts: 2
Joined: Sat 25 Jun 2016 21:24
Contact:

Re: power crystals' XML patcher and data exporter (now under old management)

Postby nooot95 » Sat 10 Dec 2016 23:11

hey guys,

I was wondering if someone could quickly tell me what i'm doing wrong here.
The patch keeps getting "skipped" as it affects 0 entries.
the patch is supposed to buff all the atgm carriers/TD's in the veh tab by buffing their stealth

Code: Select all

<wargamepatch>
   <ndfpatch ndf="pc\ndf\patchable\gfx\everything.ndfbin" table="TUniteAuSolDescriptor" name="better atgm jeeps/tankdestroyers">
      <matchconditions>
            <matchcondition type="references" table="TTypeUnitModuleDescriptor">
               <matchconditions>
                  <matchcondition type="property" property="TypeUnitHintToken">31EAB6EA9E2F0000</matchcondition>
               </matchconditions>
            </matchcondition>   
      </matchconditions>
      <changes>
         <change operation="set" property="Modules" key="Visibility" type="ObjectReference">
            <reference table="TVisibilityModuleDescriptor">
               <matchconditions>
                  <matchcondition type="referencedby" table="TUniteAuSolDescriptor">
                     <matchconditions>
                        <matchcondition type="property" property="ClassNameForDebug">Unit_AMX_10_RC</matchcondition>
                     </matchconditions>
                  </matchcondition>
               </matchconditions>
            </reference>
         </change>
      </changes>
   </ndfpatch>
</wargamepatch>


thanks in advance

Pyro
Sergeant First-Class
Posts: 102
Joined: Mon 1 Sep 2014 23:56
Contact:

Re: power crystals' XML patcher and data exporter (now under old management)

Postby Pyro » Thu 12 Jan 2017 15:03

I am having trouble adding new instances to TDeckConstraints. The following code creates a new instance then patches the __order = last instance (four changes), then moves to the next new instance for a total of 10 new instances. What occurs is that after six new instances are created, the seventh instance and following give an error message: "An error was encountered applying patch <name> (invalid format?)". Inspection of the ndfbin shows that the seventh instance has been created with null entries, but not the eighth, nor the ninth, nor the tenth.

I have tried: moving the order of patches around; splitting into two separate patch files; putting operation="set" at beginning of <change>; removing names; removing the <change property="Coalition"> line (since this is unset anyway when the new instance is created); removing other <change> lines to see if one of them was at fault.

In every case the first six are created and patched ok; the seventh onwards are not - even if the order is changed around or some are deleted.

I think it is WGPatcher at fault, or my poor understanding of xml syntax. I can manually add and edit the instances using the modding suite.

This is an example of my code - my actual patch has well over one hundred new instances to be created in TDeckConstraints. So it would be great if it could be made to work automagically using WGPatcher.

UPDATE

The code below fails in latest version of WGPatcher (2.4). However, I was able to make it work by using an older version of WGPatcher (1.2). I have not tested any other versions to see where the fault started.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<wargamepatch>

   <!-- Add new instances of constraints to include new year categories -->

   <!-- US & UK Mot 80-81, UK Abn 80-81 -->
   <ndfcreate ndf="pc\ndf\patchable\gfx\everything.ndfbin" table="TDeckConstraints" name="New constraints US Mot 80-81"/>
   <ndfpatch ndf="pc\ndf\patchable\gfx\everything.ndfbin" table="TDeckConstraints" name="US Mot 80-81">
      <matchconditions>
         <matchcondition type="property" property="__order">last</matchcondition>
      </matchconditions>
      <changes>
         <change property="Country" type="TableString" operation="set">US</change>
         <change property="UnitType" type="LocalisationHash" operation="set">5E767965E3000000</change>
         <change property="Category" type="LocalisationHash" operation="set">41E22D4DD9380000</change>
         <change property="Coalition" type="Unset" operation="set">null</change>
      </changes>
   </ndfpatch>

   <ndfcreate ndf="pc\ndf\patchable\gfx\everything.ndfbin" table="TDeckConstraints" name="New constraints UK Mot 80-81"/>
   <ndfpatch ndf="pc\ndf\patchable\gfx\everything.ndfbin" table="TDeckConstraints" name="UK Mot 80-81">
      <matchconditions>
         <matchcondition type="property" property="__order">last</matchcondition>
      </matchconditions>
      <changes>
         <change property="Country" type="TableString" operation="set">UK</change>
         <change property="UnitType" type="LocalisationHash" operation="set">5E767965E3000000</change>
         <change property="Category" type="LocalisationHash" operation="set">41E22D4DD9380000</change>
         <change property="Coalition" type="Unset" operation="set">null</change>
      </changes>
   </ndfpatch>

   <ndfcreate ndf="pc\ndf\patchable\gfx\everything.ndfbin" table="TDeckConstraints" name="New constraints UK Abn 80-81"/>
   <ndfpatch ndf="pc\ndf\patchable\gfx\everything.ndfbin" table="TDeckConstraints" name="UK Abn 80-81">
      <matchconditions>
         <matchcondition type="property" property="__order">last</matchcondition>
      </matchconditions>
      <changes>
         <change property="Country" type="TableString" operation="set">UK</change>
         <change property="UnitType" type="LocalisationHash" operation="set">0BB7685ED9380000</change>
         <change property="Category" type="LocalisationHash" operation="set">41E22D4DD9380000</change>
         <change property="Coalition" type="Unset" operation="set">null</change>
      </changes>
   </ndfpatch>

   <!-- US -->
   <ndfcreate ndf="pc\ndf\patchable\gfx\everything.ndfbin" table="TDeckConstraints" name="New constraints US All 86-87"/>
   <ndfpatch ndf="pc\ndf\patchable\gfx\everything.ndfbin" table="TDeckConstraints" name="US All 86-87">
      <matchconditions>
         <matchcondition type="property" property="__order">last</matchcondition>
      </matchconditions>
      <changes>
         <change property="Country" type="TableString" operation="set">US</change>
         <change property="UnitType" type="LocalisationHash" operation="set">0C565AD652360E00</change>
         <change property="Category" type="LocalisationHash" operation="set">4CE92D4DD9380000</change>
         <change property="Coalition" type="Unset" operation="set">null</change>
      </changes>
   </ndfpatch>

   <ndfcreate ndf="pc\ndf\patchable\gfx\everything.ndfbin" table="TDeckConstraints" name="New constraints US Mot 86-87"/>
   <ndfpatch ndf="pc\ndf\patchable\gfx\everything.ndfbin" table="TDeckConstraints" name="US Mot 86-87">
      <matchconditions>
         <matchcondition type="property" property="__order">last</matchcondition>
      </matchconditions>
      <changes>
         <change property="Country" type="TableString" operation="set">US</change>
         <change property="UnitType" type="LocalisationHash" operation="set">5E767965E3000000</change>
         <change property="Category" type="LocalisationHash" operation="set">4CE92D4DD9380000</change>
         <change property="Coalition" type="Unset" operation="set">null</change>
      </changes>
   </ndfpatch>

   <ndfcreate ndf="pc\ndf\patchable\gfx\everything.ndfbin" table="TDeckConstraints" name="New constraints US Arm 86-87"/>
   <ndfpatch ndf="pc\ndf\patchable\gfx\everything.ndfbin" table="TDeckConstraints" name="US Arm 86-87">
      <matchconditions>
         <matchcondition type="property" property="__order">last</matchcondition>
      </matchconditions>
      <changes>
         <change property="Country" type="TableString" operation="set">US</change>
         <change property="UnitType" type="LocalisationHash" operation="set">5C76718B57360E00</change>
         <change property="Category" type="LocalisationHash" operation="set">4CE92D4DD9380000</change>
         <change property="Coalition" type="Unset" operation="set">null</change>
      </changes>
   </ndfpatch>

   <ndfcreate ndf="pc\ndf\patchable\gfx\everything.ndfbin" table="TDeckConstraints" name="New constraints US Mech 86-87"/>
   <ndfpatch ndf="pc\ndf\patchable\gfx\everything.ndfbin" table="TDeckConstraints" name="US Mech 86-87">
      <matchconditions>
         <matchcondition type="property" property="__order">last</matchcondition>
      </matchconditions>
      <changes>
         <change property="Country" type="TableString" operation="set">US</change>
         <change property="UnitType" type="LocalisationHash" operation="set">8BD43C9757360E00</change>
         <change property="Category" type="LocalisationHash" operation="set">4CE92D4DD9380000</change>
         <change property="Coalition" type="Unset" operation="set">null</change>
      </changes>
   </ndfpatch>

   <ndfcreate ndf="pc\ndf\patchable\gfx\everything.ndfbin" table="TDeckConstraints" name="New constraints US Abn 86-87"/>
   <ndfpatch ndf="pc\ndf\patchable\gfx\everything.ndfbin" table="TDeckConstraints" name="US Abn 86-87">
      <matchconditions>
         <matchcondition type="property" property="__order">last</matchcondition>
      </matchconditions>
      <changes>
         <change property="Country" type="TableString" operation="set">US</change>
         <change property="UnitType" type="LocalisationHash" operation="set">0BB7685ED9380000</change>
         <change property="Category" type="LocalisationHash" operation="set">4CE92D4DD9380000</change>
         <change property="Coalition" type="Unset" operation="set">null</change>
      </changes>
   </ndfpatch>

   <ndfcreate ndf="pc\ndf\patchable\gfx\everything.ndfbin" table="TDeckConstraints" name="New constraints US Spt 86-87"/>
   <ndfpatch ndf="pc\ndf\patchable\gfx\everything.ndfbin" table="TDeckConstraints" name="US Spt 86-87">
      <matchconditions>
         <matchcondition type="property" property="__order">last</matchcondition>
      </matchconditions>
      <changes>
         <change property="Country" type="TableString" operation="set">US</change>
         <change property="UnitType" type="LocalisationHash" operation="set">DAD77965E3000000</change>
         <change property="Category" type="LocalisationHash" operation="set">4CE92D4DD9380000</change>
         <change property="Coalition" type="Unset" operation="set">null</change>
      </changes>
   </ndfpatch>

   <ndfcreate ndf="pc\ndf\patchable\gfx\everything.ndfbin" table="TDeckConstraints" name="New constraints US Mar 86-87"/>
   <ndfpatch ndf="pc\ndf\patchable\gfx\everything.ndfbin" table="TDeckConstraints" name="US Mar 86-87">
      <matchconditions>
         <matchcondition type="property" property="__order">last</matchcondition>
      </matchconditions>
      <changes>
         <change property="Country" type="TableString" operation="set">US</change>
         <change property="UnitType" type="LocalisationHash" operation="set">23B8605ED9380000</change>
         <change property="Category" type="LocalisationHash" operation="set">4CE92D4DD9380000</change>
         <change property="Coalition" type="Unset" operation="set">null</change>
      </changes>
   </ndfpatch>

</wargamepatch>

User avatar
The W:AB Noob
Lieutenant General
Posts: 4575
Joined: Fri 12 Jul 2013 22:29
Location: United States, Central Time Zone
Contact:

Re: power crystals' XML patcher and data exporter (now under old management)

Postby The W:AB Noob » Fri 13 Jan 2017 00:20

Hey Pyro!
Pyro wrote:UPDATE

The code below fails in latest version of WGPatcher (2.4). However, I was able to make it work by using an older version of WGPatcher (1.2). I have not tested any other versions to see where the fault started.

Hm, good to know. I know Sireyn and I had run across times where we had many ndfpatch commands that were pretty much the same but gave weird errors. I think we can get around some of them by dividing it up and putting like a max of 5 ndfpatches per xml file. Possible has something to do with memory leaks, I don't really know.

But thanks for lettings us know that 1.2 can handle some xml files that 2.4 can't.

Pyro
Sergeant First-Class
Posts: 102
Joined: Mon 1 Sep 2014 23:56
Contact:

Re: power crystals' XML patcher and data exporter (now under old management)

Postby Pyro » Fri 13 Jan 2017 00:47

Hi W:AB Noob! I'm back!

The W:AB Noob wrote:...I think we can get around some of them by dividing it up and putting like a max of 5 ndfpatches per xml file...


That didn't work for me, I tried splitting it into two separate files, still got the error. Specifically, what I did was split into two separate xml files and ran one instance of the patcher, viz:

WGPatcher.exe "apply" NDF_Win_updated.dat file1.xml file2.xml

What I did not try was to run two separate runs of the patcher, for example:

WGPatcher.exe "apply" NDF_Win_updated.dat file1.xml
WGPatcher.exe "apply" NDF_Win_updated.dat file2.xml

In any case, splitting ~100 patches into numerous smaller files is a pain, much easier to just use 1.2 for the single large patch as a workaround, which is what I did.

User avatar
The W:AB Noob
Lieutenant General
Posts: 4575
Joined: Fri 12 Jul 2013 22:29
Location: United States, Central Time Zone
Contact:

Re: power crystals' XML patcher and data exporter (now under old management)

Postby The W:AB Noob » Sat 14 Jan 2017 04:41

Pyro wrote:That didn't work for me, I tried splitting it into two separate files, still got the error. Specifically, what I did was split into two separate xml files and ran one instance of the patcher, viz:

WGPatcher.exe "apply" NDF_Win_updated.dat file1.xml file2.xml

What I did not try was to run two separate runs of the patcher, for example:

WGPatcher.exe "apply" NDF_Win_updated.dat file1.xml
WGPatcher.exe "apply" NDF_Win_updated.dat file2.xml

That's what I meant. IIRC, doesn't your batch call the patcher for each xml file?

Pyro wrote:In any case, splitting ~100 patches into numerous smaller files is a pain, much easier to just use 1.2 for the single large patch as a workaround, which is what I did.

Yep... I saw one person who had a batch that had run multiple batches, each running multiple files.

Pyro
Sergeant First-Class
Posts: 102
Joined: Mon 1 Sep 2014 23:56
Contact:

Re: power crystals' XML patcher and data exporter (now under old management)

Postby Pyro » Sat 14 Jan 2017 09:41

The W:AB Noob wrote:That's what I meant. IIRC, doesn't your batch call the patcher for each xml file?


No - for multiple xml the batch file does this:

WGPatcher.exe "apply" NDF_Win_updated.dat file1.xml file2.xml file3.xml file4.xml ... file20.xml

Incidentally, I downloaded your latest sandbox mod to find out how you backed up profiles, only to find that you had grabbed that from me! Talk about circular logic ... I shall have to watch Loopers again now. Thanks for crediting me, too, in a post I searched earlier today.

User avatar
The W:AB Noob
Lieutenant General
Posts: 4575
Joined: Fri 12 Jul 2013 22:29
Location: United States, Central Time Zone
Contact:

Re: power crystals' XML patcher and data exporter (now under old management)

Postby The W:AB Noob » Sun 15 Jan 2017 03:02

Pyro wrote:
The W:AB Noob wrote:That's what I meant. IIRC, doesn't your batch call the patcher for each xml file?


No - for multiple xml the batch file does this:

WGPatcher.exe "apply" NDF_Win_updated.dat file1.xml file2.xml file3.xml file4.xml ... file20.xml

Incidentally, I downloaded your latest sandbox mod to find out how you backed up profiles, only to find that you had grabbed that from me! Talk about circular logic ... I shall have to watch Loopers again now. Thanks for crediting me, too, in a post I searched earlier today.

Did I? I thought the first mod I saw doing it was Ural? :? Oh well.

User avatar
enohka
Second-Lieutenant
Posts: 928
Joined: Sun 21 Oct 2012 04:25
Location: HEAP
Contact:

Re: power crystals' XML patcher and data exporter (now under old management)

Postby enohka » Fri 27 Jan 2017 23:55

I just flew over this thread and read something about forking! I'd add you as contributor just as well buddy.

I'm actually a bit sad about the fact that most derivatives of the WMS turned into single separated Projects!

@the Java guy: We are living in times where .net is mostly open source and mono isn't a hobby project anymore, have you checked the progress of it since the last years? I'm pretty sure you could run the WMS core on an iPhone nowadays, not the GUI ofc. How did you solve all the structs anyways? If it wasn't for the WPF GUI even I might have considered C# for too "high level" for such low level binary operations :lol:

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 4 guests

cron