furrycat's Milkshape weapon modding tutorial
Importing the model with gsmhacking
This information is out of date and only retained for completeness. You should use GSkinViewer to convert your model. Just load it into the viewer and save it as GSM.
This is the fun part. The moment you've been waiting for. It's time to take the Milkshape file and make it into a GSkinMesh.
You'll need gsmhacking version 3.1.37 or later in order to import a Milkshape file and write out a GSM.
The options you need are
--import-milkshape (which can be
-I) to import Milkshape data into gsmhacking, and
-o) to specify the GSM file to create.
gsmhacking's commandline options are case-sensitive but you already
knew that because you studied the documentation before reading this far.
Warnings and errors
gsmhacking may spit out various warnings or error messages. Here's what they mean.
WARNING: creating bogus shared triangle lists
You can safely ignore this message :)
WARNING: vertex has reference count zeroImportant: if you get this warning you will probably find that your model's textures get screwed up...
An extraneous vertex, not part of any triangle, was found in the scene. Most likely it was left over when you deleted some faces or vertices. gsmhacking will ignore the vertex and proceed but you should find and delete it from your mesh.
WARNING: unassigned material group
You have created a material group but not applied it to any triangles. gsmhacking will ignore the group and proceed but you should delete it from the group list and - if it is the only group to use a material - delete the material as well.
ERROR: model has no bones
You forgot to add joints into your model. Go back and read the tutorial again.
no vertices have been assigned to bones
You added the joints but didn't assign vertices to any bones. It's your lucky day because gsmhacking will assume you meant to assign all vertices to the root (which is what you should have done) and perform the assignment for you. Nonetheless, you should go back and read the tutorial again.
ERROR: some vertices were not assigned to a bone - can't use this model
You assigned some vertices to a joint but some others were left unassigned. gsmhacking can't compensate for this so it is a fatal error.
ERROR: assignment ID out of range
There are two main possiblities why you might have received this error.
- Some vertices are assigned to a non-existent bone. Most likely you created a new vertex and forgot to assign it to a bone. Milkshape will have automatically assigned it a bone reference when you created it. Alternatively, you may have created some vertices and then deleted the bone they were assigned to (perhaps because you wanted to start from scratch?).
- You didn't create the groups in order. For example you might have made your weapon, added a FLASHLIGHT and then gone back to tweak the weapon. That can trigger this error. If this is the case, the error is gsmhacking's fault and your model is actually fine.
GSkinViewer might be able to compensate for these errors, and definitely should deal with the second case. You should be using GSkinViewer anyway.
ERROR: panic! can't find parent bone
You've been naughty.
WARNING: version mismatch
The file you are trying to convert was saved with a newer version of Milkshape than I have tested gsmhacking with. You should let me know about this!
incorrect file header: this is not a .ms3d file
The file you are trying to convert is not a valid Milkshape 3D file.
can't read Milkshape .ms3d file
This is a generic error message which signifies that gsmhacking couldn't read the Milkshape file for one reason or another. The exact problem will be reported before gsmhacking emits this error..
ERROR: out of memory for ...
Either you ran out of memory (surprise!) or you hit a bug in gsmhacking. Report it to me.
You may encounter other errors, complaints or bizarre behaviour if you attempt to convert a character model or animation. Currently you can only use gsmhacking to convert weapons.
The major issue at the moment is that some texture maps don't look "right" in certain cases. If I knew what the cases were I'd have fixed this by now :(
As hinted above, it appears that incorrect maps appear when bogus vertices are found. You should ensure that you weld all your vertices prior to exporting the weapon. Although this may not be the problem. I told you this was a work in progress...
Thanks to Emerica, I realised that gsmhacking was flipping normals when converting the model. This bug was fixed in gsmhacking 3.1.37.
As of version 1.1, GSkinViewer can load MS3D files and save GSMs.
Jump to a section
| intro | part 1: Basic weapon concepts | part 2: Weapon orientation | part 3: Materials | part 4: Bones | part 5: Importing the model with gsmhacking |