Before you begin:
You must already know how to create models and use your prefered modeling interface(3D Studio Max, Lightwave, Gamespace, Milkshape, etc...). You must have Milkshape so you can convert your models from any format to Lightwave 5 and create the necessary UV data file.
A great resource for learning how to model in 3d Studio Max, Lightwave, and Gamespace can be found at 3DBuzz.
Single Frame Models
Single frame models are the easiest to create and get imported into Anachronox. Single frame models are typically used for stationary objects such as weapons, signs, trees, statues, etc. They are objects used in the game that will not have movement, but may have textures that change.
To get a single frame model into Anachronox, simply create the model in the modeling package of your choice, and import it into Milkshape.
For 3DS Max objects import each frame of the model into Milkshape using Milkshapes built in Auodesk 3DS Max import plugin. Then export each frame following the directions below.
Then just export the object from Milshape as a Lightwave 5 format file using CCCPs Lightwave export plugin, into a directory you will be using for this model.
Now we have to create a UV file for this object. lw2md2 requires a .uv coordinate file or it will not even attempt to convert it into a .md2.
Using Laguna's md3d-uv exporter plugin, create a .uv file of the same name as the model in the same directory you used to create the .lwo(lightwave) file.
Remember in the directory you are using, you must have three files before you use lw2md2 to convert your single frame model into a format that can be used in Anachronox. You must have the Lightwave file of your object(.LWO), the UV texture data(.UV), and the texture(.BMP)!
Now unpack lw2md2 into the directory prior to the one you have been using to save your files.
Open a command prompt and change your directory to the one you unpacked lw2md2 too(i.e.: c:\lw2md2).
Execute the command
Substitute the directory and filename above with the ones you are using.
Your screen should show what's in the picture.
You will then find a .md2 in directory you upacked lw2md2.
If you get any errors then you did something wrong. Reread the instructions. As a last resort you can post me a message at the email address at the top of this webpage.
Something to remember: The filename of the resulting .md2 will be the name of the directory you have your model files in. For example; if you have your model files in the directory c:\lw2md2\temp and your model files are eye.lwo, eye.uv, and eyetex.bmp, the resulting file will be named temp.md2. Thus you should name the working directory the same name as what your model will be named.
That's all there is to creating the files necessary to import a model into Anachronox. Now lets put that into a map and take a look at it.
Before you begin:
You should already have the knowledge of creating your own maps and have created some map to run experiments on. If not you should read the section on AnachroRadiant.
Before you can place a newly created model into Anachronox you must copy the .md2 file that was created using lw2md2 in the instructions above and a texture of the model into the \anachronox\data\models\ directory. I recommend you use .tga textures for you final model. TGAs support Alpha channels for transparencies and more. The .tga texture can easily be created by saving the .bmp texture you created for your model as a .tga in most paint programs.
Now you must edit entities.dat and create an entry for your model. Open \Anachronox\anoxdata\models\entities.dat into a text editor of your choice.
Insert the line
ob_eye|models/mymodels/eye.md2|1.0|1.0|1.0|general|-16|-16|0|16|16|64|noshadow|1|54|8.0|8|1|0|0:0|0|0|none|myeye anywhere in the file. Substitute ob_eye and the directory for the name you used for your model and the location of the model for where you saved your model in the anachronox\data\ substructure. In the above line you can see that I save all of the models I create in the directory anachronox\data\models\mymodels\.
For a description of the data format of entities.dat see the Appendix.
Save your modified file. If you get an error saying it can't save then entities.dat has it's read only flag set. You will need to remove this before saving. You can easily do this by right clicking the file in Windows and select properties. When the properties page opens, uncheck the READ ONLY flag, and apply the change. You will now be able to save any changes you make to the file.
Now you will need to make an entry into a .map file. You can either do this by manually editing a .map file, use your prefered text editor to do this, or use the newly created AnachroRadiant to do it.
Or you can load a map that comes with Anachronox and create a Planet Script to use your model. See Planet for more information.
In this example I will be using AnachroRadiant.
Before the new model will show up in AnachroRadiant as an Entity you must edit Entities.def which you will find in the AnachroRadiant directory. For more information on AnachroRadiant and editing entities.def see the section on AnachroRadiant.
Add the entry :
ob_eye|models/mymodels/eye.md2|1.0|1.0|1.0|general|-16|-16|0|16|16|64|noshadow|1|54|8.0|8|1|0|0:0|0|0|none|tester. Be sure to substitute the name and directory to the ones you actually used, and save the file.
Now load AnachroRadiant and the map of your choice.
Place the new object somewhere on your map. If you did everything correctly your new object should appear under ob/ob_eye, or the name you used.
Save your map and compile it.
Again if you did everything correctly your Anachronox screen should look like the following when you load the map.
Pat yourself on the back. Everything went fine.
But the model is positioned wrong, it's in the floor! You will need to edit a few values in Anachroradiant to get the model to face the correct direction
Go back to AnachroRadiant.
Add the key and values:
to the object. For more information on adding Key/Values see AnachroRadiant.
Raise the model up on the Z Axis to pull it up out of the floor. Save and compile the map then load it up in Anachronox.
You should be presented with screen of your single frame model.
To view your model in Particleman you must copy the model and texture into the anachronox\data\models directory. If you do not do this the model will appear in Particleman but without a texture applied. This is becuase Particleman searches for resources(textures) in the anachronox\data\models directory!