4 ms·
Right now I'm doing a project where I'm taking these XML files that store all the information for an MMO. Stuff like the stats for items. Quest strings. Item st
by navjack27 4y ago
Right now I'm doing a project where I'm taking these XML files that store all the information for an MMO. Stuff like the stats for items. Quest strings. Item strings. Just literally everything. I'm taking those files and I have to first do a bit of conversion on them. I found an online converter that goes XML to YAML. Now follow me here, it sounds dumb, but then I take that output and use a different website that goes from YAML to XML. This formats things in these schema lacking files way better. Then I do some find and replace in VS Code to put quotes around the values and also find any semicolons and replaces them with "" since in the original XML there would be semicolon delimited values for things but they don't make new columns because the game doesn't read the values like that. So you end up with something like this.
<ItemData>
<Item>
<Id>"1"</Id>
<Attributes>"1234""1235""1236"</Attributes>
<OtherThing>"Stuff"</OtherThing>
</Item>
</ItemData>
Then I import that into an excel file. Then I go to an access database and import that table into access. Then I go to another Excel file and import that database table as a reference. There is a method to that madness, trust me. Layers are good if you fuck up something. In that final Excel file I'm building up a bunch of formulas with vlookup and other functions to get the data from each dataset and connect them in order to pull up any gear in the game and get all the stats, the rolls, what happens if you enchant or masterwork it. I'll extend this to also pull up every quest and each step of every quest. This gigantic excel and access project will basically be a complete reference to everything in this game. I'm unaware of anything that does this outside of one website that only does items. But my project is for one particular version of the game unlike that website which is the latest thing and has many things that just aren't in the version of the game that I'm playing on.
Excel rules when you have just completely undefined data. Like, the devs just kind of did whatever with these XML files. You can't just assume every "row" will have every "column". Sometimes in the XML files that are a series, like, ItemData-1, ItemData-2, etc, just all of a sudden the "columns" will be a different order from the previous. Sometimes in the same file even. But the weird conversion stuff I did at the start somehow fixes this issue or at least prepares the XML better for Excel to import it better.
By the time I'm done this will be multiple gigs of sheets but I'm fairly certain Excel and Access can handle it.
Edit: The quotes allow me to do a neat thing when I encounter a cell that has multiple entries in it. I have a series of cells that do some math and text parsing to find out how many quotes there are and leave a number behind for another cell to do math with and basically in the end you get, for example, the correct amount of secondary item rolls, each with their ID numbers, which another cell does a lookup to get the string of the roll and then applies the value for the roll, example "Does $Value extra damage from behind", it will replace $Value with the correct number and then have the corrected string. Yes, many things are broken out into multiple cells instead of doing them all in one cell. I don't know yet if I'll need those intermediate steps for something else down the line so I'll be doing it a bit messy like that.