sIKE23 / Mage-Wars

Mage Wars for OCTGN
7 stars 5 forks source link

Create xml mass-editor #286

Open ACG8 opened 9 years ago

ACG8 commented 9 years ago

Editing the xml code by hand is tiresome and labor intensive. As my next project, I will develop a tool that allows us to mass-edit xml files. I will start work on this now.

ACG8 commented 9 years ago

Okay, I have created an xml mass editor. It is located in the Developer Tools folder the the MageWars-Dev dropbox folder. To use it, just move the xml file you want to edit into its folder (or copy it into the folder with the xml file) and double-click on "xml mass editor.py"

Currently, it has four functions:

  1. Replacing all instances of one string with another within the value field of a specific property
  2. Creating a new property for each card
  3. Deleting all instances of a property (from each card)
  4. Duplicating a property for each card and giving the new property a new name.

If you have ideas for other functions that would be useful with this tool, just post them here and I will implement them!

Hopefully this will make formatting changes to the xml files easier.

sIKE23 commented 8 years ago

Going forward I think we will need a script to process raw card data from a csv or other delimited file for new card sets.

ACG8 commented 8 years ago

Sure. If you show me some examples of csv files as they are usually given, I can probably write a script to transcribe them to xml.

sIKE23 commented 8 years ago

So, you will find what I did for FiF in the Developer Tools folder. That output is delimited by ` (I call them back ticks) and since shell scripts do not handle blanks very well, ~ are place holders for "nothing". Honestly its all in a Spreadsheet and I then save it as delimited text. If you tell me your preferences I will gladly do the same for your script.

//FC

On Sun, Sep 27, 2015 at 12:53 PM, Ananda notifications@github.com wrote:

Sure. If you show me some examples of csv files as they are usually given, I can probably write a script to transcribe them to xml.

— Reply to this email directly or view it on GitHub https://github.com/sIKE23/Mage-Wars/issues/286#issuecomment-143580836.

ACG8 commented 8 years ago

I took a look. If it is always just card data, then we should be fine as long as each card always has the same number of fields (which, presumably, they do); that format will work. If there are other types of data besides card data, we would want something at the beginning (or end) of each entry that tells us what type of data it is (e.g. card before a card, token before a token, etc.).

I assume it is just the card data, so this data format works fine.

ACG8 commented 8 years ago

I wrote a simple parser for the csv data. It takes care of the card data formatting. Let me know what you think.

sIKE23 commented 8 years ago

It is a good start. If and when you take the next pass, and field that ="~" should be changed to ="". I also thought that you would add intergrate your cTargets and Nickname stuff to the script. But we (meaning you :) ) might want to wait until you work out all of the new details you want in the set data going forward.

//FC

On Fri, Oct 2, 2015 at 5:24 PM, Ananda notifications@github.com wrote:

I wrote a simple parser for the csv data. It takes care of the card data formatting. Let me know what you think.

— Reply to this email directly or view it on GitHub https://github.com/sIKE23/Mage-Wars/issues/286#issuecomment-145169690.

sIKE23 commented 8 years ago

I was able to get this done. Let me know what you think...

ACG8 commented 8 years ago

It looks good to me. Of course, there will likely be more to add as I define more special fields, but this should be easy enough to add in. Hopefully this will make our work a lot easier going forward.