Modcraft - The community dedicated to quality WoW modding!

Content creation => Modelling and Animation => Tutorials => Topic started by: Jack on February 14, 2010, 07:57:23 pm

Title: [TUTORIAL] Custom Item (Model Export, Attachments, DBC&SQL)
Post by: Jack on February 14, 2010, 07:57:23 pm
Particles and Ribbons still missing


This tutorial is suited for the creation of objectcomponent-items: helmets, shoulderpads, weapons, shields - items with an external model file without collision and mostly without animation.
This tutorial does NOT include the creation of geoset related texturecomponent items!

Difficulty:
Intermediate

Tools used:
-3dsToM2.exe
-Autodesk 3ds Max 2010
-Attachmentadder.exe
-M2Modder.exe
-Milkshape 3D
-Photoshop CS3
-WotLK Model Viewer
-WoWImage.jar




1. The Model
You've managed to create your own model and texture using one of the thousand tutorials out there? That's great, now I'm going to show you how to get this model ingame!




1.1. Reference Model
First of all you'll need a reference model in order for your model to be the right size compared to the player model.
Open up Model Viewer and navigate to the Human Model ("CharacterHumanMale") or whatever Reference Model you'd like to use.
With it showing click on "File -> Export Model Snapshot" and save it as .ms3d extension, since the other ones seem to be broken.

(http://imagr.eu/up/4b7843ddbda46_1.png)

(http://imagr.eu/up/4b7844238750a_2.png)

Model Viewer now exports the model with its UVs intact and the used texture files to your preferred location.
Start up Milkshape 3D and open the newly created reference model. Go to "File -> Export -> Autodesk 3DS" in order to save the model as a file format 3ds Max can handle easily.

(http://imagr.eu/up/4b78443511b7b_3.png)

In 3ds Max you can now choose to import this reference model and using the scale tool you can size your item down to fit the reference model in size.

(http://imagr.eu/up/4b784448649a4_4.png)




1.2. Correct Rotation

(http://imagr.eu/up/4b7844609cdd3_RotationHelper.png)

Using my RotationHelper.png it should be easy for you to rotate your model correctly. Something you shouldn't forget either is that the center of the document (where the fat black lines cross) is equal to the attachment point on the model, so make sure to line your item up right so it fits the model afterwards.




1.3. Export Option[/size]
In order to be able to export the model right you need to transform all polygons to triangles (this will have no negative effect on your UV maps or textures, don't worry if you haven't done it up to now)
The easiest way to convert all polys to tris is using the "Subdivide" Modifier. Apply it to your model and use an enormously big value as size. I use 100000 most of the time.

(http://imagr.eu/up/4b7844844625a_5.png)

Once this is done and your desired item object is selected simply go to "File -> Export Selected" and save it as a .3DS file. In the upcoming window make sure to have the check on preserving the texture coordinates.

(http://imagr.eu/up/4b78449f5bc10_6.png)
Title: Re: Custom Item (Model Export, Animated Texture, Particles etc)
Post by: Jack on February 17, 2010, 12:05:00 pm
2. Conversion
In order to work for the client your model and texture need to be converted to World of Warcraft file types, such as .blp (texture) and .m2 (model).




2.1. Converting the Texture[/u]
Open the texture file in photoshop and go to "Image -> Mode" and make it 8bit Indexed Color.

(http://imagr.eu/up/4b784671864af_7.png)

Go ahead and save this texture file as .png and the texture's done.
In the window where you are able to choose between Interlaced and Without go without.
Open WoWImage.jar ,take the .png file and drag&drop it onto the "Encode" field.

(http://imagr.eu/up/4b78469236584_8.png)




2.2. Converting the Model[/u]
In case you'd like to have animated texture please read "3. Animated Texture" first!
The next thing you want to do is convert the model. First of all create a new directory very close to your c: root in order to have a short directory path. I use "C:c" most of the time.
Into that directory drop your model file (.3ds) as well as the 3dstoM2.exe and go to "Start -> Run" and enter "cmd" in the popping up window and you should get to the command prompt.

(http://imagr.eu/up/4b784758e2c33_9.png)

Now enter "cd c:" and hit enter, "cd X" where X is your conversion directory, in my case it's "cd c".
Still in the command prompt enter "3dstoM2 filename.3ds filename.m2 filename00.skin" where filename is your model file name.
Now you just enter the number of textures your model uses, their texture paths, texture types (on items this is actually of the time "0") and texture flag ("0" if you don't want animated texture).

(http://imagr.eu/up/4b784784b3e28_10.png)

For further information of flags and types see http://madx.dk/wowdev/wiki/index.php?title=M2/WotLK (http://madx.dk/wowdev/wiki/index.php?title=M2/WotLK)
Title: Re: Custom Item (Model Export, Animated Texture, Particles etc)
Post by: Jack on February 17, 2010, 12:06:40 pm
3. Enchantment Attachmentpoints
This is an optional step, you do not have to do this in order for your item to work. It's just that enchantments won't be visible (they still do have an effect on the stats though!)
Every item has got enchantment attachmentpoints for the enchantment visuals to be located at. You have to create those manually using the Attachmentadder.exe.
Just drag&drop the .m2 file onto the .exe and it'll start.
Now you have to add 5 attachmentpoints with the IDs "0" to "4". The Bone is always "0" except if you would have converted it using the MDXtoM2 tool with working animation, but since this tutorial covers only 3dstoM2 your model will not have any animation other than texture animation.
Now comes the tricky part: the x, y and z value. Go back to 3dsMax into your .3DS file (right before conversion), the one that is correctly scaled and rotated.
Now create a very, very small dummy box (all sides 0.01 big) and move it to the place where you'd like your attachmentpoint to be. You can now simply copy the x, y and z value of the center of this cube into the attachmentadder.exe like this:

(http://imagr.eu/up/4b784b743b0c7_11.png)
Title: Re: Custom Item (Model Export, Animated Texture, Particles etc)
Post by: Jack on February 17, 2010, 12:06:58 pm
4. DBC Changes
Grab a hold of the ItemDisplayInfo.dbc because now you need to add a DisplayID for your new model so it can be used in the Item SQL DB.
It should be pretty easy to stick to http://madx.dk/wowdev/wiki/index.php?title=ItemDisplayInfo.dbc but I'll briefly explain the steps needed for an item anyways.
As "ID" you choose something you will remember and something that is still available. This is going to be your DisplayID.
For every objectcomponent item you only have one model - except for shoulders. So just add the model and texture path for the "left" (column 2 and 4) and ignore the right ones - except for shoulders, you add the model and texture path of the right shoulder pad there and the left one on the "left" stuff obviously.
Column 6 "Icon" refers to the path of the Icon .BLP so make sure to set this one as well.
Every other Column can be left blank or set to 0 for any regular objectcomponent Item. (In case you want sounds you can play around with Column 13)




5. Add to Patch
Now it's time to add the data you created to a patch. Here's a quick overview of the files you have to include in this patch - figure out how to create a patch in another tutorial. The items in brackets ( ) are for shoulders only, which required two different (for example mirrored) models.




6. SQL
Last but not least you have to create an entry of that weapon on your private server. You could of course simply modelswap with some item but that's totally lame and it's not a really "custom" item, so we don't do that here.
The problem here is that different PS cores have different SQL structure, so there's not much to say about this in general. I suggest to you though to create a new SQL batch using the generators of http://wow-v.com/ (http://wow-v.com/" onclick="window.open(this.href);return false;) in order to get started. Once you know which column does what for your server you can enter new items into the DB directly.
Title: Re: Custom Item (Model Export, Animated Texture, Particles etc)
Post by: Tigurius on February 18, 2010, 11:56:39 am
The texflags don't animate the Texture, they just wrap them.
For animation, you'll need UV-Animations (http://www.madx.dk/wowdev/wiki/index.php?title=M2/WotLK#UV-Animations)
Title: Re: Custom Item (Model Export, Animated Texture, Particles etc)
Post by: Jack on February 19, 2010, 07:39:50 am
Thanks for pointing that out :)
I suppose there's no tool except hex editing to do this? Of there isn't I'll just drop that part in the tutorial, since it's supposed to be for "near beginners" as it's something most people would like to do and I don't want to confuse them.
Title: Re: Custom Item (Model Export, Animated Texture, Particles etc)
Post by: Tigurius on February 19, 2010, 02:13:30 pm
Yeah, most likely drop it.
Title: Re: [TUTORIAL] Custom Item (Model Export, Particles, Ribbon etc)
Post by: gorq on June 26, 2010, 01:05:14 am
wt!! Fantastic i was looking for this :D Thanks a lot ;)
Title: Re: [TUTORIAL] Custom Item (Model Export, Attachments, DBC&SQL)
Post by: SirFranc on March 01, 2011, 06:42:56 pm
What i'm supposed to do in case 3dstom2.exe crashes before asking me the textures to be loaded? O.o
Title: Re: [TUTORIAL] Custom Item (Model Export, Attachments, DBC&SQL)
Post by: TheBuG on March 01, 2011, 08:59:04 pm
Quote from: "SirFranc"
What i'm supposed to do in case 3dstom2.exe crashes before asking me the textures to be loaded? O.o

You most like have to many (Sub)meshes, you'll have to reduce them.

Atleast, that's what's Tigurius told me, although I was creating custom buildings, rather than weapons. And I still can't fix it! :<
Title: Re: [TUTORIAL] Custom Item (Model Export, Attachments, DBC&SQL)
Post by: Jack on March 01, 2011, 11:01:31 pm
I think I remember being able to convert successfully using the old 3dstoM2.exe (the one without collision), but the program I really get to work is GMES for 3.x, it also features OBJ to M2, without collision, animations, bones, multiple textures and with credits spammed into the file data but at least it works (once you've got it to run, which can be a pain in the ass) so you guys might wanna try that.
Title: Re: [TUTORIAL] Custom Item (Model Export, Attachments, DBC&SQL)
Post by: TheBuG on March 01, 2011, 11:38:15 pm
Tried GMES, worked like poop to me, I'd be happy to be spammed with credits, but instead I got spammed to death with errors during the conversion.
Title: Re: [TUTORIAL] Custom Item (Model Export, Attachments, DBC&SQL)
Post by: SirFranc on March 02, 2011, 01:30:06 am
Quote from: "Jack"
I think I remember being able to convert successfully using the old 3dstoM2.exe (the one without collision), but the program I really get to work is GMES for 3.x, it also features OBJ to M2, without collision, animations, bones, multiple textures and with credits spammed into the file data but at least it works (once you've got it to run, which can be a pain in the ass) so you guys might wanna try that.
No i guess is my model that is wrong somewhat.. one of the 3 submeshes make it crash : /
Title: Re: [TUTORIAL] Custom Item (Model Export, Attachments, DBC&SQL)
Post by: Jack on March 02, 2011, 10:37:49 am
Quote from: "TheBuG"
Tried GMES, worked like poop to me, I'd be happy to be spammed with credits, but instead I got spammed to death with errors during the conversion.

You have to change all your windows languages and formats to english standards, at least that was what caused my problems.

Did you guys triangulate and export the models correctly? Maybe remove Smoothing Groups, etc. At least for GMES there's a small tutorial video where he demonstrates the correct export settings.

And for the other converters they either crash when loading the model (mdx to m2) or seem to work perfectly fine but crash modelviewer and WoW.exe when loaded ingame (3ds to m2), so I might not be the right person to talk to when encountering problems with the converters  :?
Title: Re: [TUTORIAL] Custom Item (Model Export, Attachments, DBC&SQL)
Post by: junit on June 13, 2011, 09:17:33 pm
I have a problem. I created a model and i followed this tutorial, but when i start a wowmodelwiever and open my model, the wowmodelviewer crash. And  the model isn't see in the noggit.
Title: Re: [TUTORIAL] Custom Item (Model Export, Attachments, DBC&SQL)
Post by: Endzsi on April 03, 2012, 06:48:49 pm
Hello!
I created a gameobject, and I tried to load it up into the game based on the above description. I change DBC. I write 1 column the display info 2 column modelpath. Every other column I left 0. becouse I cant write nothing, only number. I change SQL too. first column ID, second type 5, becouse the model is chandlier. Next column display info, what I write DBC. And the five column a name. But a little blue white chequered cube appears on the game within. I would like to ask what I ruined according to you. Greet too.

Postscript: My English knowledge very little, I am sorry for it if I wrote something down wrongly
Title: Re: [TUTORIAL] Custom Item (Model Export, Attachments, DBC&S
Post by: weard3 on October 01, 2012, 11:08:18 pm
Was i the only one that dindt understand steps 4 and 5? by the way that link in step 4 is dead
Title: Re: [TUTORIAL] Custom Item (Model Export, Attachments, DBC&S
Post by: Ascathos on October 02, 2012, 01:36:31 pm
Quote from: "weard3"
Was i the only one that dindt understand steps 4 and 5? by the way that link in step 4 is dead
ItemDisplayInfo.dbc (http://pxr.dk/wowdev/wiki/index.php?title=ItemDisplayInfo.dbc)

Else, this is actually quite self-explaining.... add them into the .DBC, add files into required folder, test - repeat...
Title: Re: [TUTORIAL] Custom Item (Model Export, Attachments, DBC&S
Post by: ragequit on October 30, 2012, 01:33:20 pm
Maybe a dumb question, but does this still work in MoP or till which WoW patch does this work?
Title: Re: [TUTORIAL] Custom Item (Model Export, Attachments, DBC&S
Post by: Ascathos on October 30, 2012, 06:35:18 pm
Quote from: "ragequit"
Maybe a dumb question, but does this still work in MoP or till which WoW patch does this work?
MoP and Cata use different logical settings, so you may hit technical issues. Once you resolve these (kind of the way MoP->Cata is), you should get similar or the same result.
Title: Re: [TUTORIAL] Custom Item (Model Export, Attachments, DBC&S
Post by: Seyler on January 06, 2013, 09:17:06 am
A  '3dsToM2.exe' Link please? If there's one in the previous replys, I didn't read them so... I would be proud if you could do it dear Jack.

Thanks, Seyler.
Title: Re: [TUTORIAL] Custom Item (Model Export, Attachments, DBC&S
Post by: Ascathos on January 06, 2013, 12:58:37 pm
Quote from: "Seyler"
A  '3dsToM2.exe' Link please? If there's one in the previous replys, I didn't read them so... I would be proud if you could do it dear Jack.

Thanks, Seyler.
search.php (http://modcraft.io/search.php" onclick="window.open(this.href);return false;)

I am certain this is going to help you.
Title: Re: [TUTORIAL] Custom Item (Model Export, Attachments, DBC&S
Post by: lyonar on December 04, 2013, 08:25:05 am
Everything is working great in the tutorial, and the model is a 'head sized' m2, but I'm having issues at the display ID part.

I've made an item with the display ID but no matter what model and texture path I set, I get the blue box.

From what I can gather that is due to it not actually being able to find the model, because in noggit/model viewer the model shows properly. So I guess what I'm asking for is clarification into the model path/where it needs to be in the MPQ.

Any help is appreciated! Thanks.
Title: Re: [TUTORIAL] Custom Item (Model Export, Attachments, DBC&S
Post by: ayahne on December 04, 2013, 02:54:58 pm
Check Your PNG & blp files its need to be at the fallowing formats: 64x64 128x128 256x256 etc... otherwise it won't work well.