This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [TOOL] Item-Sparse to Item_Template  (Read 10748 times)

Epicurus

  • Registred Member
  • Race Changer
  • *****
  • Posts: 33
    • View Profile
[TOOL] Item-Sparse to Item_Template
« on: March 09, 2014, 11:26:14 pm »
Hello Modcraft,

I created a simple script, written in PHP, that automatically converts comma delimited strings from Item-Sparse.db2 and Item.dbc and converts them into an SQL statement which you can later add to your database or modify further.

The final output is for TrinityCore (World) Database 4.3.4. To prevent conflicts between item-sparse.db2 and world.item_template, I added 500000 to the entry ID.

Personally, I don't like working in windows environments - I'm more of Linux guy. The current db2 to sql converters require that you have an active MySQL connection to run the conversions, and I'd rather not install that software on windows (which is the OS I use to model edit for convenience purposes). Rather than bothering with that, I made this simple tool which my devs and I can access via the Administration panel of my server's website.

This tool does not convert the raw Item-Sparse.db2 into a readable format, there are many db2 to csv converters on the web for you to use. Once the file is in csv format, just copy paste the line representing the item you want to convert into the textarea, and copy the corresponding line from item.dbc into the input field.

Press "Convert" and you're done. The statement is ready for insertion into the database / further modification.

The script can be easily modified to fit your needs, be it bulk conversions or straight-to-database insertions.

I hope this helps some of you. Thanks again for this great community. I learned most of what I know about model editing and level design on this forum.

Cheers!
Epicurus

[attachment=0:fos98fh2]itemSparse_to_itemTemplate.zip[/attachment:fos98fh2]
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Milly

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 503
    • View Profile
Re: [TOOL] Item-Sparse to Item_Template
« Reply #1 on: March 10, 2014, 03:36:42 am »
Thanks for sharing. Seems like a pretty cool tool for people who wanna add/edit custom items like it was back in 3.3.5a. Though I personally prefer to keep my mods entirely client-side :) Also, a few things:

Quote from: "Epicurus"
The current db2 to sql converters require that you have an active MySQL connection to run the conversions
If I'm understanding correctly, this is not true at all. My converter runs just fine without a MySQL server. I've made a tutorial about DBC/DB2 to SQL which you can find here: viewtopic.php?f=61&t=7453

Quote from: "Epicurus"
there are many db2 to csv converters on the web for you to use.
Do you mind sharing? I've looked into this before and never found any DB2 to CSV converters.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Epicurus

  • Registred Member
  • Race Changer
  • *****
  • Posts: 33
    • View Profile
Re: [TOOL] Item-Sparse to Item_Template
« Reply #2 on: March 10, 2014, 04:32:49 am »
Hi Milly,

Carlos Ramzuel's DB2-> CSV converter has never failed me and is the the one I prefer to use. He doesn't share the source, as far as I know, but I haven't had any need to modify the program.

[attachment=0:nmsi62u9]WoWParser2_Build98.zip[/attachment:nmsi62u9]

Hope that helps!

Epicurus
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

PhilipTNG

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 709
    • View Profile
Re: [TOOL] Item-Sparse to Item_Template
« Reply #3 on: March 12, 2014, 02:16:19 am »
Sweet! I'm sure this will help out a crap load of people.  I always did it with a db2 to csv converter and then re-parsed it in excel into an sql file. LOLOLOL.  I'm sure this takes out that headway of extra work, though I gotta ask, how were you doing it before you put this tool together for yourself?  What Archaic Medieval methods were you using?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Epicurus

  • Registred Member
  • Race Changer
  • *****
  • Posts: 33
    • View Profile
Re: [TOOL] Item-Sparse to Item_Template
« Reply #4 on: March 12, 2014, 07:50:47 am »
Hi Anthony,

I never thought I would actually need something like this - until the situation presented itself. I was doing bulk conversions by switching between excel sheets and trying to determine what column represented what, then re-arranging and removing/adding necessary data.

That's great for porting large amounts of values (like, all values from another expansion) in a short amount of time, but when one of my devs asked me to create a few custom items with cloned cata item values... well, that can't be done in a bulk conversion. So I started out by ctrl-F, copy paste the line, go into item.dbc, ctrl-F again, insert the missing values into the sparse data, make modifications, insert into dev server database, see if I messed up copying data, all good? insert into live server.

A few items in I decided to just create another web app to handle the process and stick it on the admin section of my server's website. Funny isn't it? We humans. We only invent ways to simplify tasks when the need arises (i.e, after we toss the monitor across the room out of frustration).

By the way, thank you for your tutorials, Anthony.

Cheers,
Epicurus
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Carbinfibre

  • Registred Member
  • MWCS Enthusiast
  • *****
  • Posts: 1
    • View Profile
Re: [TOOL] Item-Sparse to Item_Template
« Reply #5 on: March 12, 2014, 02:05:52 pm »
Can't simply just put the .php file into my xampp "htdocs" and type localhost/something like i thought i could lmfao
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Epicurus

  • Registred Member
  • Race Changer
  • *****
  • Posts: 33
    • View Profile
Re: [TOOL] Item-Sparse to Item_Template
« Reply #6 on: March 12, 2014, 06:57:00 pm »
Hi Carbinfibre,

First, make sure your server is configured to run PHP scripts. Next, add the following to the top of index.php:

Code: [Select]
<?php
require('/path_to_include/file.php');

I'm assuming there is no raw html in that file. If there is, don't forget to close the php tag with ?> .

Epicurus
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

PhilipTNG

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 709
    • View Profile
Re: [TOOL] Item-Sparse to Item_Template
« Reply #7 on: March 14, 2014, 01:21:31 am »
Quote from: "Epicurus"
Funny isn't it? We humans. We only invent ways to simplify tasks when the need arises (i.e, after we toss the monitor across the room out of frustration).

By the way, thank you for your tutorials, Anthony.

Cheers,
Epicurus

Yes it's pretty funny, I used to make custom items in my item_template by hand for a few months XD, after getting frustrated with it I  went and took a 6-7 week learning session on some minor php/javascript and made that Skyfire 406 item creator on my website - http://anthonys-toolbox.org/index.php?page=cdisc

And what tutorials?  lol. if you found any of my stuff useful, that's awesome!! Most of my stuff are badly explained, hehe.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Epicurus

  • Registred Member
  • Race Changer
  • *****
  • Posts: 33
    • View Profile
Re: [TOOL] Item-Sparse to Item_Template
« Reply #8 on: March 14, 2014, 05:39:24 am »
Nice item creator dude, I have something very similar in my admin's tool kit. It's so much more intuitive to click check boxes with human read-able labels, than it is to look at a chart and pull out a calculator to set up which races can use said item. It really has helped my GMs shine. I always prefer to develop web interfaces over programs because multiple people can access the same application and collaborate in real time (without the need to download a compiled program).

I'll admit, I did have to watch some of your videos over again to organize all the information, but that is irrelevant. All the information required was available and that's the important thing. Now if someone would just do the same thing for Hozen, Jinyu and Female Pandas we'll all be happy! xD
« Last Edit: January 01, 1970, 01:00:00 am by Admin »