Sorry, but I feel this tutorial isn't very good.
Since I wanted to create MD2 models using Blender, I found more or less the same way of you to make it. So, I wrote my own tutorial below (more complete, I think). I would like my tutorial/article (below) was published in this site. Thanks.
I found this method of creating MD2 models by myself, after a lot of searching and some experimentation. I'm using Linux, and I run the Q2Modeller under Wine.
Requirements:
It is impossible to explain how to use Blender in one paragraph. You must know how to use Blender before trying to create a MD2 model. Please read some Blender tutorials or Blender wikibooks, or watch some Blender video tutorials to learn how to use and model something in Blender.
The MD2 format only supports triangles, so, after you make your model, enter Edit mode, select all faces and convert them to triangles (spacebar->Edit->Faces->Convert to Triangles, or just press Ctrl+T).
Before or after converting to triangles, you must create an UV-Map for your mesh. Please read an UV-map tutorial or watch an UV-map video tutorial.
Then, use the Blender export to MD2 script. You need Python to be able to run the script. If you place the files export-md2-0.14.py and import-md2-0.14.py in correct directory (.blender/scripts), the "MD2" option will show in both Export and Import menus.
A framelist is a list of animations and respective frames (or number of frames, I don't know) for the exported model. If you are creating a mapmodel, you certainly won't want any animation. So, create a file with only the following line:
stop 0
And use this file as framelist for MD2 exporter. This will export the MD2 model containing only one frame of animation (in other words, no animation).
The MD2 exporter for blender is incomplete. The exporter lacks "GL_Commands" section, which is mandatory for a MD2 model, and Cube will crash if this section is absent. How to solve this? Open the recently exported model in Q2Modeller and just export it as MD2 (again). The Q2Modeller will create a working MD2 model.
Now, you only need to create a good texture for your model. Inside Blender's UV-map window, export the "UV face layout" (read or watch one of above tutorials for more information). Open the exported image in any image editor (like Gimp) and do all texture work there.
Alternatively, you can use the texture painter feature of Blender.
To add your model as a mapmodel, create a directory under "cube_main_directory/packages/models/". You may want to create a directory for all your models, and place your models in subdirectories of it (like dcp models that are distributed with cube).
Put both the texture and the 3D model in same directory. The MD2 model must have "tris.md2" name, and the texture must have "skin.jpg". Please note the lowercase used here. Although Windows does not care about case, other systems (like Linux) are case sensitive, and you should name your files in a way it will work on any system supported by Cube.
Now you have your files properly placed in directories, create a "yourmap.cfg" or "package.cfg" file to load your custom model. The process is similar to loading custom textures for your map. If you don't understand this well, please read the Cube documentation or ask.
The command to load mapmodels is:
mapmodel X H 0 0 "yourmapmodelname"
- The X parameter is the "square radius" of your model. In other words, it tells how many cubes in all four directions your model will occupy. For example, a value 1 will occupy 2x2 cubes, 2 will occupy 4x4 cubes.
- The H parameter is the height of your model, measured in cubes.
- The first zero is the default Z-offset above the ground for this model. For most of models, leave it zero.
- The second zero is a "snap value". This is not well documented and I do not know what this setting do.
- The last parameter is the name of your mapmodel. It should be inside quotes. The name is the directory where your mapmodel is. If you placed in packages/models/mymodel, this parameter will be "mymodel". If you placed in packages/models/myname/mymodel, this parameter will be "myname/mymodel".
I suppose you know how to add mapmodels in your map. (hints: "/newent mapmodel N" and "/entproperty" commands).
Some small hints:
- The "front side" of an MD2 model is located at "right side" of a Blender model. This means that an MD2 model is rotated 90 degrees. So, in Blender, you must press NUM3 to see the front of your object.
- No face is double-sided. This means the faces are only drawn if the "correct" side of it is facing to the camera. If you want a face to be visible by both sides, you must create two faces. Although this is natural to most 3D developers, I thought it was important to warn this to newbies.
- Cube does not support different light values for different regions of one mapmodel. In Cube, the entire mapmodel will have the same lighting value. This may result in ugly effects for large mapmodels under certain light conditions.
- Cube does not support animated mapmodels.
- One "cube" in Cube engine is equivalent to 16 "Blender units". Remember this and you will have less problems scaling your model.
- A mapmodel (like any entity) can only be placed on intersection of grid lines inside Cube. (this is a bit obvious, but useful for newbies)
I hope you like this article.