Modcraft - The community dedicated to quality WoW modding!

Legion- / WoD- / Mop- / Cata-Modding => Tools => Topic started by: Luzifix on December 29, 2015, 01:40:36 pm

Title: [TOOL] ADB/DB2/DBC <-> CSV convert
Post by: Luzifix on December 29, 2015, 01:40:36 pm
(http://cdn.lost-code.de/dbconvert/icon.png)
Current Version: 0.0.6 ALPHA

ADB/DB2/DBC <-> CSV convert


Download


[paragraph:364lsxr8]You can download the converter from my CDN:
http://cdn.lost-code.de/dbconvert/dbconvert.zip (http://cdn.lost-code.de/dbconvert/dbconvert.zip" onclick="window.open(this.href);return false;)[/paragraph:364lsxr8]

Requirements


[paragraph:364lsxr8]The converter requires NET Framework 3.5 (https://www.microsoft.com/en-US/download/details.aspx?id=21)[/paragraph:364lsxr8]

How to use


[paragraph:364lsxr8]Before you can convert a db2 or dbc to csv, you most be sure you have a map for it.
the maps you found in the map.xml file.
If you have a map for your db2/dbc, you most only drag the db2/dbc over the dbconverter.exe and its work.

Allow DataTyps: uint8, int8, uint16, int16, uint32, int32, uint64, int64, string/char/std::string, float/single, double[/paragraph:364lsxr8]

Changelog


[paragraph:364lsxr8]Version 0.0.6 ALPHA

Version 0.0.5 ALPHA

Version 0.0.4 ALPHA

Version 0.0.3 ALPHA (WARNING: Version 0.0.3 cant read the old CSV files)

Version 0.0.2 ALPHA

Version 0.0.1 ALPHA
[/paragraph:364lsxr8]

Contributing


[paragraph:364lsxr8][/paragraph:364lsxr8]

Screenshots


[paragraph:364lsxr8](http://cdn.lost-code.de/dbconvert/screenshot1.jpg)
http://cdn.lost-code.de/dbconvert/screenshot1.jpg (http://cdn.lost-code.de/dbconvert/screenshot1.jpg" onclick="window.open(this.href);return false;)

(http://cdn.lost-code.de/dbconvert/screenshot2.jpg)
http://cdn.lost-code.de/dbconvert/screenshot2.jpg (http://cdn.lost-code.de/dbconvert/screenshot2.jpg" onclick="window.open(this.href);return false;)

(http://cdn.lost-code.de/dbconvert/screenshot3.jpg)
http://cdn.lost-code.de/dbconvert/screenshot3.jpg (http://cdn.lost-code.de/dbconvert/screenshot3.jpg" onclick="window.open(this.href);return false;)

(http://cdn.lost-code.de/dbconvert/screenshot4.jpg)
http://cdn.lost-code.de/dbconvert/screenshot4.jpg (http://cdn.lost-code.de/dbconvert/screenshot4.jpg" onclick="window.open(this.href);return false;)

(http://cdn.lost-code.de/dbconvert/screenshot6.jpg)
http://cdn.lost-code.de/dbconvert/screenshot6.jpg (http://cdn.lost-code.de/dbconvert/screenshot6.jpg" onclick="window.open(this.href);return false;)[/paragraph:364lsxr8]
Title: Re: [TOOL] DB2/DBC <-> CSV convert
Post by: Chase on December 29, 2015, 07:25:01 pm
Why don't you auto detect the types like other dbc converters.
Title: Re: [TOOL] DB2/DBC <-> CSV convert
Post by: schlumpf on December 29, 2015, 08:11:27 pm
Quote from: "Chase"
Why don't you auto detect the types like other dbc converters.
that kind of auto detection nearly always is broken. either crawl dbcmeta in the binary, or require such a crawled definition.
Title: Re: [TOOL] DB2/DBC <-> CSV convert
Post by: Luzifix on December 29, 2015, 11:01:50 pm
Quote from: "schlumpf"
Quote from: "Chase"
Why don't you auto detect the types like other dbc converters.
that kind of auto detection nearly always is broken. either crawl dbcmeta in the binary, or require such a crawled definition.

Yes auto detect the types of the columns is not really good.
And DBC and DB2 Maps you found really simple. In Any Trinity based core you found it

SkyFire 5.4.8:
DB2: https://github.com/ProjectSkyfire/SkyFi ... tructure.h (https://github.com/ProjectSkyfire/SkyFire.548/blob/9931f8d0f0233a1a6dbb185278d6795b8f949704/src/server/game/DataStores/DB2Structure.h" onclick="window.open(this.href);return false;)
DBC: https://github.com/ProjectSkyfire/SkyFi ... tructure.h (https://github.com/ProjectSkyfire/SkyFire.548/blob/9931f8d0f0233a1a6dbb185278d6795b8f949704/src/server/game/DataStores/DBCStructure.h" onclick="window.open(this.href);return false;)
Title: Re: [TOOL] DB2/DBC <-> CSV convert
Post by: Luzifix on December 30, 2015, 03:39:21 am
Screenshot from GUI version http://i.imgur.com/iPVtdKQ.png (http://i.imgur.com/iPVtdKQ.png" onclick="window.open(this.href);return false;) (currently in development)
Title: Re: [TOOL] DB2/DBC <-> CSV convert
Post by: Amaroth on December 30, 2015, 11:09:50 am
I didn't have chance to test this tool yet so I don't know any drawbacks/bugs it can have but if it really works clearly then damn good job.
Title: Re: [TOOL] DB2/DBC <-> CSV convert
Post by: Luzifix on December 30, 2015, 03:28:30 pm

//Update v0.0.2

Title: Re: [TOOL] DB2/DBC <-> CSV convert
Post by: azeroc on January 02, 2016, 04:05:01 pm
Tried quickly dumping down Item-sparse.db2 on the tool and it converted to .csv fine, however, if I took that same .CSV and dumped it on the tool, then it would error out with this:
Info: Open File Item-sparse.csv...
Info: Read Mapping...
Info: Read Header...
Info: Write DB2 Records...
Error: Index was outside the bounds of the array.

I double-checked map.xml and the format of Item-sparse.db2 was indeed correct (I was using MoP 548 Item-sparse.db2). Item.db2, however, converted without problems between CSV and DB2.
Title: Re: [TOOL] DB2/DBC <-> CSV convert
Post by: Luzifix on January 02, 2016, 06:06:18 pm
Quote from: "azeroc"
Tried quickly dumping down Item-sparse.db2 on the tool and it converted to .csv fine, however, if I took that same .CSV and dumped it on the tool, then it would error out with this:
Info: Open File Item-sparse.csv...
Info: Read Mapping...
Info: Read Header...
Info: Write DB2 Records...
Error: Index was outside the bounds of the array.

I double-checked map.xml and the format of Item-sparse.db2 was indeed correct (I was using MoP 548 Item-sparse.db2). Item.db2, however, converted without problems between CSV and DB2.

can you upload the CSV ?
Title: Re: [TOOL] DB2/DBC <-> CSV convert
Post by: azeroc on January 02, 2016, 07:23:41 pm
Here ya go:
https://mega.nz/#!f9BFnL7A!2A96AHxM5Jhg ... gWAw2d09ng (https://mega.nz/#!f9BFnL7A!2A96AHxM5JhgEN-Nn-vu6v-G838oJKBESgWAw2d09ng" onclick="window.open(this.href);return false;)
Title: Re: [TOOL] DB2/DBC <-> CSV convert
Post by: Luzifix on January 03, 2016, 12:00:46 pm
Quote from: "azeroc"
Here ya go:
https://mega.nz/#!f9BFnL7A!2A96AHxM5Jhg ... gWAw2d09ng (https://mega.nz/#!f9BFnL7A!2A96AHxM5JhgEN-Nn-vu6v-G838oJKBESgWAw2d09ng" onclick="window.open(this.href);return false;)

Your Problem is fixed with the new Update 0.0.3
Title: Re: [TOOL] DB2/DBC <-> CSV convert
Post by: Luzifix on January 03, 2016, 12:01:18 pm

//Update v0.0.3

Title: Re: [TOOL] DB2/DBC <-> CSV convert
Post by: azeroc on January 04, 2016, 08:15:40 am
Quote from: "Luzifix"
Quote from: "azeroc"
Here ya go:
https://mega.nz/#!f9BFnL7A!2A96AHxM5Jhg ... gWAw2d09ng (https://mega.nz/#!f9BFnL7A!2A96AHxM5JhgEN-Nn-vu6v-G838oJKBESgWAw2d09ng" onclick="window.open(this.href);return false;)

Your Problem is fixed with the new Update 0.0.3

Yup, it has been. Much thanks!
Title: Re: [TOOL] DB2/DBC <-> CSV convert
Post by: Synric on January 06, 2016, 05:27:11 am
I could be wrong, but I think to convert spell.dbc we also need support for uint64. wowdev is 64+32 for SpellFamilyFlags, trinitycore is flag96 (which is just uint32+uint32+uint32). It's a clean convert with the only change on converting CSV back to DBC being replicating the final spell with a new spell ID, incase you need to test it yourself.
Title: Re: [TOOL] DB2/DBC <-> CSV convert
Post by: Luzifix on January 06, 2016, 12:44:53 pm
Quote from: "Serendipity"
I could be wrong, but I think to convert spell.dbc we also need support for uint64. wowdev is 64+32 for SpellFamilyFlags, trinitycore is flag96 (which is just uint32+uint32+uint32). It's a clean convert with the only change on converting CSV back to DBC being replicating the final spell with a new spell ID, incase you need to test it yourself.

Thx for the info, its come with the next update :)
Title: Re: [TOOL] DB2/DBC <-> CSV convert
Post by: Luzifix on January 07, 2016, 04:47:53 pm
@Serendipity with the 0.0.4 Update i add the uint64 & int64 support for Spell.dbc

// UPDATE

Title: Re: [TOOL] DB2/DBC <-> CSV convert
Post by: detonatorss on January 10, 2016, 08:22:40 am
Quote from: "Luzifix"
@Serendipity with the 0.0.4 Update i add the uint64 & int64 support for Spell.dbc

// UPDATE


So how you will make the structure for more than one version of wow for example in the xml you can use

<wotlk></wotlk>
<cata></cata>
<mop></mop>

or

<spell type=wotlk></spell>
Title: Re: [TOOL] DB2/DBC <-> CSV convert
Post by: Luzifix on January 10, 2016, 03:39:08 pm
which is a bit complicated, dbc dont have a version in the header. db2 have a build in the header this i can used but currently you most rename your dbc/db2 line Spell335.dbc and create a map for Spell335 in the map.xml
Title: Re: [TOOL] DB2/DBC <-> CSV convert
Post by: detonatorss on January 11, 2016, 06:39:27 pm
Quote from: "Luzifix"
which is a bit complicated, dbc dont have a version in the header. db2 have a build in the header this i can used but currently you most rename your dbc/db2 line Spell335.dbc and create a map for Spell335 in the map.xml

but you can tag it in the xml, in the parser you culd add a function to parse the type for example
Title: Re: [TOOL] DB2/DBC <-> CSV convert
Post by: Luzifix on January 15, 2016, 11:17:36 am

// UPDATE



(http://cdn.lost-code.de/dbconvert/screenshot6.jpg)
http://cdn.lost-code.de/dbconvert/screenshot6.jpg (http://cdn.lost-code.de/dbconvert/screenshot6.jpg" onclick="window.open(this.href);return false;)
Title: Re: [TOOL] DB2/DBC <-> CSV convert
Post by: Luzifix on January 20, 2016, 01:51:48 pm
What for feature you went ?

i think currently about multi file convert over the command line:
Code: [Select]
dbconverter.exe Item.db2 Item-sparse.db2 Creature.dbc ...
Title: Re: [TOOL] ADB/DB2/DBC <-> CSV convert
Post by: Luzifix on January 22, 2016, 08:07:20 pm

// UPDATE 0.0.6


Title: Re: [TOOL] ADB/DB2/DBC <-> CSV convert
Post by: spik96 on January 24, 2016, 08:30:50 pm
I have an error trying to convert CreatureDisplayInfo.db2 :

Code: [Select]
--------------------------------
ADB/DB2/DBC Converter 0.0.6 ALPHA
Create by Luzifix
E-Mail: luzifix@schattenhain.de
--------------------------------
Your version is up to date.

Info: Open File creaturedisplayinfo.db2...
Info: Load DB2 Mapping...
Info: Load Header...
Error: Signature of file contains not 'WDB2'

Press a key to exit...

I believe my map is correct : http://pastebin.com/spRNEf3f (http://pastebin.com/spRNEf3f" onclick="window.open(this.href);return false;) .
EDIT : Nevermind, too recent version for the program.
Title: Re: [TOOL] ADB/DB2/DBC <-> CSV convert
Post by: schlumpf on January 24, 2016, 08:37:52 pm
Quote from: "spik96"
I have an error trying to convert CreatureDisplayInfo.db2 :

Code: [Select]
--------------------------------
ADB/DB2/DBC Converter 0.0.6 ALPHA
Create by Luzifix
E-Mail: luzifix@schattenhain.de
--------------------------------
Your version is up to date.

Info: Open File creaturedisplayinfo.db2...
Info: Load DB2 Mapping...
Info: Load Header...
Error: Signature of file contains not 'WDB2'

Press a key to exit...

I believe my map is correct : http://pastebin.com/spRNEf3f (http://pastebin.com/spRNEf3f" onclick="window.open(this.href);return false;) .

well, exactly as it says.. the file you dragged on it is in the wrong format.
Title: Re: [TOOL] ADB/DB2/DBC <-> CSV convert
Post by: spik96 on January 25, 2016, 01:26:57 am
Yeah, I noticed that shortly after posting my message, I'm so dumb.
I have a bug, tho, when reconverting from CSV to DBC the  character has become " .
Example CreatureModelData.dbc when reading the DBC with myDBC editor :
http://i.imgur.com/Bwx7NjL.png (http://i.imgur.com/Bwx7NjL.png" onclick="window.open(this.href);return false;)
Will happens with all DBCs with  inside.

Really problematic since the DBC is not functional.
Title: Re: [TOOL] ADB/DB2/DBC <-> CSV convert
Post by: Luzifix on January 25, 2016, 08:29:25 am
Quote from: "spik96"
Yeah, I noticed that shortly after posting my message, I'm so dumb.
I have a bug, tho, when reconverting from CSV to DBC the  character has become " .
Example CreatureModelData.dbc when reading the DBC with myDBC editor :
http://i.imgur.com/Bwx7NjL.png (http://i.imgur.com/Bwx7NjL.png" onclick="window.open(this.href);return false;)
Will happens with all DBCs with  inside.

Really problematic since the DBC is not functional.

With what you edit your CSV file ?
Title: Re: [TOOL] ADB/DB2/DBC <-> CSV convert
Post by: spik96 on January 25, 2016, 02:32:05 pm
Quote from: "Luzifix"
Quote from: "spik96"
Yeah, I noticed that shortly after posting my message, I'm so dumb.
I have a bug, tho, when reconverting from CSV to DBC the  character has become " .
Example CreatureModelData.dbc when reading the DBC with myDBC editor :
http://i.imgur.com/Bwx7NjL.png (http://i.imgur.com/Bwx7NjL.png" onclick="window.open(this.href);return false;)
Will happens with all DBCs with  inside.

Really problematic since the DBC is not functional.

With what you edit your CSV file ?

This one was edited with Microsoft Excel 2010. I have not yet tried to see if this happens with other softwares.
Title: Re: [TOOL] ADB/DB2/DBC <-> CSV convert
Post by: Luzifix on January 25, 2016, 03:08:44 pm
Excel change formatting of the CSV. Try it with Notepad++ or some other text editor :)
Title: Re: [TOOL] ADB/DB2/DBC <-> CSV convert
Post by: yunfan on March 29, 2016, 03:55:19 am
Nice job, thank you, this is what I need, thank you very much for your work
Title: Re: [TOOL] ADB/DB2/DBC <-> CSV convert
Post by: Steff on March 29, 2016, 11:55:01 am
http://www.ronsplace.eu/Products/RonsEditor (http://www.ronsplace.eu/Products/RonsEditor" onclick="window.open(this.href);return false;)

try this.
Title: Re: [TOOL] ADB/DB2/DBC <-> CSV convert
Post by: fean on March 29, 2016, 09:36:27 pm
I'm having a little bit of an issue there. I have tried to convert TaxiNodes.db2 to CSV.
As said here (http://www.model-changing.net/files/file/38-db2dbc-csv-convert/?tab=reviews#replies), I have copied the info from TrinityCore source to the map.xml : http://pastebin.com/RrKSEGtB (http://pastebin.com/RrKSEGtB" onclick="window.open(this.href);return false;)

When I drag my TaxiNodes.db2 to dbconvert.exe, I have this :

(http://www.feangren.net/scloud/2016-03-29_21-35-08.png)
(Key was absent from dictionnary)

Have I done something wrong ?
The db2 was taken from the retail version of the game (6.2.4), so it should still be the DB2/WDB2 format (and not the one from Legion).
Title: Re: [TOOL] ADB/DB2/DBC <-> CSV convert
Post by: Semga on April 23, 2016, 02:17:26 pm
enGB and ruRU locales db2 from 6.2.3 not working for me. Problem with strings reading is that reading strings code always reading out 4 bytes as 0 value so it always references to string dictionary with key 0 and getting empty string. But strings located in dictionary with strings sizes offsets.
(http://i.imgur.com/jDb7buU.png)
For the second: problem with not found key. It's happening in DB2File.cs, somewhere near line ~320.
(http://i.imgur.com/ai7r8E5.png)
And the last thing: maybe it's just my problem, but converting Item-sparse.db2 to csv giving me a lot of NaN values. And I guess it will fail on backward conversation from csv to db2 because of that.
Title: Re: [TOOL] ADB/DB2/DBC <-> CSV convert
Post by: ter884 on May 28, 2016, 01:15:19 pm
(CriteriaTree.DB2) when converting breaks, not enough
Title: Re: [TOOL] ADB/DB2/DBC <-> CSV convert
Post by: frathir on July 12, 2016, 10:17:53 pm
Hey,
How do you make a map.xml file for your db2 file?
Title: Re: [TOOL] ADB/DB2/DBC <-> CSV convert
Post by: elireth123 on July 17, 2016, 03:55:23 am
DB2 sparse_item has a problem.

When you convert CSV DB2 has errors and when you convert CSV to DB2 only leaves a file 1 kb.

What I can do?

My version is 6.2.4 WOD
Title: Re: [TOOL] ADB/DB2/DBC <-> CSV convert
Post by: TheRealDavidTwo on October 03, 2016, 06:11:27 pm
Will you be adding in WDB2 support?
Title: Re: [TOOL] ADB/DB2/DBC <-> CSV convert
Post by: Luzifix on October 03, 2016, 06:28:44 pm
Use this https://github.com/WowDevTools/WDBXEditor/releases (https://github.com/WowDevTools/WDBXEditor/releases" onclick="window.open(this.href);return false;) :) i work with barncastle now