A link to a .pdf can be found here: http://ai.planetnexuiz.de/Guides-Tutori ... V0.5.2.pdf (RECOMMENDED)
HOWTO: Create models for Nexuiz
Written by: Kuroto 'ai' Robert
Version: 0.5.2
Last updated: 2008-10-14
www.kurotorobert.com
Introduction:
Welcome to the complete guide as how to create models for Nexuiz. With models I mean weapons, ammo, player models and even any other models you want to have in a map, I'm going to be calling them misc models.
The applications I'm going to be explaining for now is Autodesk Maya 2008 and Blender for two simple reasons. Autodesk Maya 2008 just because that's the program I am using and Blender just because it's a free modeling application. If you want another application to be included send me a line and I'll see what I can do about it. Keep in mind I need to know how that application works. However, it if is a rather known application there's a good possibility I will be able to include it.
If you have some information or you see something that is missing/incorrect please don't hesitate to contact me.
My contact details:
kuroto.robert@gmail.com
ai – On the Alientrap forums (www.forums.alientrap.local). You can send me a PM or whatever.
Applications used and/or required (either or):
Blender - www.blender.org (free).
Autodesk Maya 2008.
Milkshape.
Plugin(s) to be able to export to Half-Life(2) SMD.
Basic knowledge as how these applications works.
Modeling knowledge.
------------------------------------------------------------------------------------------------------------------------
Autodesk Maya 2008 Section:
Getting started:
OK, now the whole thing begins. I'm not gonna give a whole lesson before actually digging into the good stuff. I'm going to be starting with Autodesk Maya 2008, Blender users have to go to the 'Blender Section'. (Not yet done). I have only tried this with Maya 2008, as far as I know it should work with earlier versions as well, don't know about future versions.
I'm going to assume you have at least basic modeling knowledge and other knowledge to help you in your work i.e. texturing/rigging/animating etc.
Step 1 – Getting plugins:
You will need to install an SMD plugin for Maya. There are two ways of doing it, you can either use 'Pralls SMD exporter' or 'Valves SMD exporter'. Now, I have not gotten my hang around Pralls SMD exporter and it lacks good documentation. I always got corrupt files when using it and incorrect '.qc-files' (explained later).
I am using Valves SMD exporter, these work great, however, you will need the 'Source SDK' in order to use it. It comes when you buy Half-Life 2: Episode 2 (I read). However there might be other ways to attain it. I also think you need Steam, which I believe will be installed if you buy either Half-Life 2 or the Source SDK.
Pralls SMD Exporter - http://mitglied.lycos.de/prallvamp/ (free)
Valve SMD Exporter – Have to buy Half-Life 2 (Possibly Episode 2) and/or Source SDK
Step 2 – Installing plugins:
Prall: Go to the website mentioned above and download the SMD exporter. It should have a readme of how to install it, just follow those steps.
Valve: Installing this is going to take a few steps. After I followed these everything worked perfect for me.
Valve step 1.
Go here (or your equivalent path to Steam):
C:\Program Files\Valve\Steam\steamapps\[username]\sourcesdk\maya\2008
Valve step 2.
There should a 'runmaya.bat' file. It currently is 'read only' and you will have to make it editable. Usually Right-clicking → Properties, and uncheck the 'read only' box. Klick ok,
Valve step 3.
Open 'runmaya.bat'. This step is if you got Maya installed somewhere custom, for example I got it in: G:\Program\Maya2008\bin\
So what you want to do now is edit the path to Maya of this line:
set PATH=%SOURCESDK%\bin;"C:\Program Files\Autodesk\Maya%MAYAVER%\bin\";%PATH%
to use your actual path to Maya:
G:\Program\Maya%MAYAVER%\bin\
So you basically just tell where your Maya is being installed and just change the location. Everything else should stay the same.
Valve step 4:
This should already be correct if you have installed Source SDK, but you can check this to be sure.
Check that the environment variable %SOURCESDK% works in your run window. Try 'Windowskey + r' to bring 'run' up (or just press Start – Run) and type %SOURCESDK% to open it. If a folder to your Source SDK doesn't open then you gotta create the environment variable.
If a window does open to your Source SDK folder then you can go ahead to step 5.
In case the window didn't open do this:
Hit Start button → Right click on Computer → Properties → Advanced System Settings → Click the Advanced tab → Click Environment Variables.
In 'System Variables' click 'New' and enter the following details:
Variable Name: SOURCESDK
Variable Value: Enter path to your Source SDK folder: C:\Program Files\Valve\Steam\steamapps\[username]\sourcesdk
Hit 'OK' and retest %SOURCESDK% in run.
Valve step 5:
Double click 'runmaya.bat' → [WARNING: In Vista, you have to run-as-administrator. Otherwise Maya might not load the plugin!]
Valve step 6:
When Maya loads, go to the menu: Window → Settings/Preferences → Plug-in Manager.
Click the 'Loaded' and 'Auto Load' checkboxes next to the 'vstSmdl0.mll' plugin (it's right at the top for me).
Now you can go under menu: 'File' and import stuff theoretically. Exporting with this plugin and importing again works fine. However when I import Nexuiz models I get some error stating that no *.c file was found. (Doesn't matter if it is player models or weapons)
So I use 'Pralls SMD exporter' to import models from Nexuiz, works great. So be sure to get if if you want to import any models which aren't Half-Life specific based.
Valve step 7:
NOTE: You will have to repeat steps 5-6 every time you want to play with SMD's in Maya. If there's a way to just copy the plugin to Mayas folders that might work as well. However, I haven't tried that. Otherwise just make a shortcut to that 'runmaya.bat' file and plot it on the desktop.
If you are on Vista do NOT forget RUN AS ADMINISTRATOR.
Thanks to 'Focusedwolf' for the steps. If you want to read them and his forum thread go here (don't know how long this link will work):
http://forums.insmod.net/index.php?s=d9 ... ntry255719
Here's another thread he posted to get some help. It is on the steam forums:
http://forums.steampowered.com/forums/s ... p?t=697499
Step 3 – Preparing for export (This step not necessary):
This step is only here to “bug-proof” your models position and rotation. If you're creating a model where the Y is 'World up' the model will be rotated 90 degrees in one direction. So if you create a player model, the model will be tipped over on the ground and “sleeping”, so to speak.
To prevent wrong rotation of the model you can set the world to a Z-up. You can do that by going here:
Window → Settings/Preferences → Preferences. In the window that pops up go to: Settings. At the top you can see 'World Coordinate System' and 'Up axis', choose 'Z' then click save.
Now you should see the model laying down, rotate it so that it stands again.
This is how Nexuiz sees models. Nexuiz is using a Z-up world. So in the future instead of changing the world coordinate system, you can just simply rotate it in the correct direction.
Exporting:
On to exporting models. I will be talking about misc models for now, such models are anything that you can see laying on the ground, like ammo boxes/cells, flag models, weapons, or even totally random things like decorative models.
NOTE: Misc models/Decorative models can be placed in maps wherever you want. If you have GTKRadaint/NetRadiant just go to the orthographic view and: Right-click → misc → misc_model. And from the window that pops up just browse to the models location. The model has to be a .md3, .md2, .mdl or .ase file type. .smd models are not supported by GTKRadiant. I tried them by specifying the path to a .smd model and it didn't show in game.
Keep in mind that adding decorative models also makes the map-size bigger.
Step 1 – Choose right option:
So to get exporting. Select the model(s) you want to export in Maya, go to File → Export All/Selection and choose it's option box. At top in 'General Options' as the file type choose the option for your current model.
If you just have a static model without animations go with 'Valve SMD Model'.
If you have an animated model, such as a stick on on top of the stick there's an animated ball jumping up and down, then choose 'Valve SMD Animated Model'.
If you have a physics model choose the 'Valve SMD Physics Model'. However this option will probably never be used for Nexuiz, as the physics for Nexuiz and Half-Life 2 are different. You can pretty much ignore this option all the time.
Lastly, if you just have animations, for instance bones for a player model and they are animated you will choose the last option 'Valve SMD Animation'. This option does not/should not have any geometry.
Step 2 – Setting preferences and other settings:
Now I won't be explaining all the options here yet. Mostly because I do not know what all of them does yet. I'll be explaining what I know and what you need to get an actual model working in-game.
First of scroll down, if you have a static model all you have to do is just choose that option for file type and export. In the 'General' section I have all the boxes unchecked and as 'Up axis' I have it set to 'Y'. It doesn't seem to matter what you have it set too. Milkshape will still always go by the rotation of the actual model. This option will be written into the .qc-file if you choose to create one and if you keep that option in the file maybe it will matter in-game after compiling this .qc into the actual .smd model. I haven't tried yet.
'Timeline' is going to be grayed out for 'Valve SMD Model' as no animations are allowed in this type of file. So no worries here for static models.
In the 'Automation' section I keep 'Everything' checked. Just because it's fun, but it's not necessary. However, none of these options seems to be used by Nexuiz. These options seems to be important if you want to create models for Half-Life 2 or something. If you check 'vtex' for instance the textures will be converted into 'vtf' files. Such files are not used by Nexuiz. Nexuiz is simple and can use normal .tga files, which is what we will be using.
The 'Qc' part can be used if you want. Checking 'Create' creates a .qc-file. However, the information stored there is wrong to Nexuiz and we will (actually Milkshape will) create a new one, or replacing that existing one.
Checking the other options 'Collapse' and 'Center' only adds parameters to the .qc-file. So you see, those are not necessary either.
As for the 'Studiomdl' checkbox I have no idea. It says that Studiomdl will be run after export, but nothing happens for me. So I just ignore this option.
With the settings done as you want them click 'Export' and you are one step closer to a complete model to be used in Nexuiz.
Converting/Compiling the exported model to a .md3:
Next step is to create a correct .qc-file for the model.
Step 1:
Import the model into Milkshape. File → Import → Half-Life SMD...
A window will pop up asking what to import, if you don't have a skeleton or don't want to rename the bones uncheck these options. But 'Triangles' has to be check if you want to import geometry (your model), otherwise you won't be getting anything.
Once the model is imported you will be able to see how the model will look like in Nexuiz. If it is not how you want it, for instance if it is laying down on one axis you will have to go back to Maya, change that axis and re-export.
This is not necessary but, if you have created texture(s) for it and it doesn't show in Milkshape, go to the 'Materials' tab to the far right. Just above the scroll-down list, and below two tiny sliders you can see four buttons, two long ones and two short ones.
Click on the topmost long button, it may say 'debugempty' and click on it. Now a window pops up and you will have to browse to where the texture is located. If you click the small 'None' beside the big ones you will be removing that texture.
Now, these will only show the textures inside Milkshape, this is not necessary to do if you want them to show up in Nexuiz.
Step 2:
Once you're satisfied with the model and it's orientation go to: Tools → Quake III Arena → Generate Control File...
Now you will need to specify a location and a name for the file.
NOTE: The name of the .qc-file (Control File) and the exported (to be) .md3 model has to have the same name. I.e. if you imported a model into Milkshape named 'BananaPhone.smd' and you intend to export it as 'BananaPhone.md3' you will have to name that .qc-file to 'BananaPhone.qc'.
Step 3:
You will have to edit the generated control file. Open the recently created .qc and look for these two lines (or similar):
$model "models/players/model/model.md3"
and
$skin "models/players/model/skin.tga"
You will have to change those to the actual folder-structure Nexuiz is using. So change to this:
$model "models/misc/BananaPhone.md3"
and
$skin "textures/BananaTexture.tga"
You will have to place your texture inside the folder 'textures' and your model in the appropriate folder as well e.g.:
Model: G:\Games\Nexuiz\data\models\misc\BananPhone.md3
Texture: G:\Games\Nexuiz\data\textures\BananTexture.tga
Step 4:
Once you have created a .qc-file you should be getting relevant information inside it. Now you can go to: File → Export → Quake III Arena MD3...
Specify where you want to export it, it has to be exported in the same folder as the .qc-file (with the same name as the .qc-file) otherwise Milkshape will whine and say it is missing.
Testing model in-game (.md3 only):
Time to test the results!
If you haven't already place the model and any textures into the appropriate folders for Nexuiz. If you have created a misc model, something that isn't currently in use in Nexuiz you will have to create a map in order to test it out.
By opening GTKRadiant/NetRadiant → Right-clicking in the orthographic view → misc → misc_model. Then browse to the model.
If you have created a model which you want to replace an existing one, such as a weapon or ammo or whatever, you can do that by just simply replace that file which is currently in use.
For instance, if it is a new flag model then you would have put your model in this place and name it appropriate:
Nexuiz/data/models/ctf/flag_blue.md3
You would need to replace that current 'flag_blue.md3' otherwise you won't be able to see that model as 'flag_blue.md3' is something that's hard-coded.
HOW TO CREATE A PLAYER MODEL WILL COME SOON ENOUGH. THIS IS THE END OF THE GUIDE FOR NOW.
A BLENDER SECTION WILL ALSO COME WITH TIME. JUST BE PATIENT.