Weapon import

From Mod Wiki

Jump to: navigation, search

This tutorial will run you through the basics of getting your own modelled weapon into STALKER.

This tutorial will only teach you how to get a basic BOX weapon into the game and do some really basic animation work using Maya.

This tutorial is not to try and make the biggest worst mother of all weapons...(although you have to admit...a box IS a pretty bad-ass weapon to use.) It is simply to teach the basics so that you can all work from the basics.

The way I see it, if you can do this tutorial (which I hope you can, by the end of going through it), then you'll be able to expand upon your weapon creation abilities and even item creation, vehicle creation and actor creation.

They all work off the same principles, just some like the actor creation is more advanced.

Note that this tutorial is also available as a formatted PDF.


Required tools

  • Maya 8.5 (If you can get it working on Maya 2008 or an earlier version, great stuff, but I recommend Maya 8.5 for the purpose of this tutorial)
  • X-ray plugins (Instructions are written later on how to install these)
  • STEAM installed (This is for the SMD plugins for Maya)
  • STALKER Gamedata Extractor
  • Latest version of STALKER (Currently 1.0005, but I am using 1.0004)

And of course you also need some patience and focus. I will try and make this process as easy as possible.


Make sure that you have all of the above files on your computer before you continue.

You must have a patched version of STALKER and you need to have extracted your gamedata files to a gamedata folder.

Using the database extractor

This is NOT HARD but I thought I'd throw in some instructions anyway.

  1. Once you've downloaded the extractor, place it inside of the directory:
    C:\Program Files\THQ\S.T.A.L.K.E.R. - Shadow of Chernobyl
  2. Make a new folder called "gamedata"
  3. Open the extractor program "Extractor.exe" and select the game's main folder.
  4. Select all files and extract them to a new gamedata folder: C:\Program Files\THQ\S.T.A.L.K.E.R. - Shadow of Chernobyl\gamedata
  5. Open the file called "fsgame.ltx" in the same S.T.A.L.K.E.R -Shadow of Chernobyl folder.
  6. Find the line that says $game_data$ = false| true| $fs_root$| gamedata and change the "false" to "true" so it looks like "$game_data$ = true| true| $fs_root$| gamedata.

That is all you need to do.

Why you need steam

You need steam so that you can get the plugins to Import SMD files. It is not necessary, but it can help. (!!!WARNING!!!: After just finding out that all my measurements were messed up in Maya after installing these plugins. For example, I have a level that is 1.2kmx1.5km, and it has no problems with the settings being in meters, HOWEVER, if I create a new scene with the same settings and import my level, it is more like 1.2mX1.5m rather than km, and the view plane is messed up completely.

I DO NOT recommend installing the plugins, however, I have left these instructions here IF you want to take the risk.

You need to go to STEAM and download the "source SDK" and Install it.

Then you need to double click on Source SDK so that it copies the files to your HDD.

This is all you need to do in STEAM, so you can now close STEAM.

Installing the plugins

  1. Go to C:\Program Files\Valve\Steam\SteamApps\'''username'''\sourcesdk\Maya\4.5
  2. Copy the folders "Prefs" and "scripts" to:
    C:\My Documents\Maya\8.5
  3. Then go to:


  1. Copy the "scripts" folder to:
    C:\My Documents\Maya\8.5
  2. Copy the "icons" folder to:
    C:\My Documents\Maya\8.5\prefs
  3. Copy the "plug-ins" folder to:
    C:\Program Files\Autodesk\Maya8.5\bin

The plugins for the smd importer/exporter are now installed.

X-ray material plugins

You will need the X-ray Mtl plugins so that you can export your models to a format that is recognized by the X-ray Engine.

(NOTE: You need to have downloaded the SDK before beginning this step)

Installing the plugins

  1. Go to where you installed the SDK, and find the scripts_plugins folder:
    C:\Program Files\X-Ray SDK\scripts_plugins
  2. Copy the folder called "scripts" into:
    C:\My Documents\Maya\8.5
  3. Now go to the folder called "ver-8.5" and copy the "plug-ins" folder and the "BugTrap.dll" file to:
    C:\Program Files\Autodesk\Maya8.5\bin
  4. Inside of the "scripts_plugins" folder in the SDK folder, go to the bat file "createDiskX.bat" and view it with notepad:
    You will notice that there are 2 lines similar to this:
    "C:\WINDOWS\system32\subst.exe" X: /C
    "C:\WINDOWS\system32\subst.exe" X: "C:\Program Files\X-Ray SDK\level_editor"
  5. IF your SDK is installed on another drive, for example mine is installed on my D drive, you need to change the text to this:
    "C:\WINDOWS\system32\subst.exe" X: /D
    "C:\WINDOWS\system32\subst.exe" X: "D:\Program Files\X-Ray SDK\level_editor"
  6. Save the bat file.
  7. Copy the "X-ray_path.ltx" file to:
    C:\Program Files\Autodesk\Maya8.5\bin

Your scripts are now set up.

Creating a batch file so for the X drive and Maya to open at the same time

This is to save you the trouble of having to map the X drive every time you restart your computer and use Maya. (this was suggested by Micheal Anderson "Mikool" back when I wrote the level creation tutorial).

This bat file will Map the X drive for you and also Start Maya at the same time to save you the hassle of manually starting the X drive from the start menu before opening Maya.

Simply create a new text document and copy and paste these lines into it:

ECHO "run creatediskx"
call "D:\Program Files\X-Ray SDK\scripts_plugins\createDiskX.bat"
ECHO "load Maya"
start Maya.exe

Save the bat file and make a shortcut to use this instead of Maya 8.5, you will need to press a key when the file prompts you to.

Loading the Scripts inside of Maya 8.5

Now it's time to open up Maya and load the X-ray material plugin to see if it is installed correctly.

  1. Now that Maya 8.5 is open, go to "windows > settings/preferences > preferences"

  2. A new window will appear, Scroll down the bottom and tick the tick boxes as shown in picture below:

(If you get an error when trying to tick the boxes, I have had this problem, and you will need try and reinstall the plugins again, as far as I know that was what fixed my problem).

Now Maya 8.5 has all the necessary plugins and you can begin!

But first, lets just close down Maya for the time being.


STALKER uses OGF files to store model data such as the animations, bones, meshes etc, so theGF2SMD converter will convert the OGF files to the SMD format (which is used by Source games, hence why you need to get the SMD plugins from the source SDK.).

The reason we will use this tool is so we can see what weapons use what bones, and if your system is good enough and you wish to edit a weapon from stalker, you can use this tool so that you can open STALKER's model files in Maya 8.5.

However, you will need a 64bit OS and a 64bit version of Maya to import the weapons without hassle. If you have a 32 bit OS and Maya you WILL run into memory loss errors and it's just a pain to import with 32 bit software. However you need a 32bit version of Maya to export the SMD files I am told

I would also like to note that you DO NOT have to import the smd file into STALKER, but I willhow you how. This section is mainly to show you the details you need inside the smd files. If you don't wish to do this, you can skip ahead.

(Alternatively you can download the milkshape3d trial and open SMD files and their animations without any issues at all regardless of your operating system, I recommend using Milkshape 3d instead of Maya if you just want to view what bones do what. Even when the trial runs out, you can still view ogf files, and that's all we want to use it for anyway, so :) )

BUT, here is what you need to do:

  1. Extract OGF2SMD to a folder anywhere on your HDD, I put mine on the C:\
  2. Go to:
    C:\Program Files\THQ\S.T.A.L.K.E.R. -Shadow of Chernobyl\gamedata\meshes\weapons\knife
  3. Copy the "wpn_knife_hud.ogf" to:
  4. Delete or rename the "hud.ogf" file that is already in the folder, and rename"wpn_knife_hud.ogf " file to "hud.ogf"
  5. Go to the folder that says "smd" and delete everything inside except for the bat file if there are any files inside. And create a folder called "knife"
  6. Go back to where your "hud.ogf" file is and open the file called "smd.bat" to convert the ogf file.
  7. Go back into the "smd" folder again and copy the .smd files to your "knife" folder (this is justo keep things organized for when or if you decide to convert more ogf files).

Go to your "knife" folder and right click > open with on the file that says "reference.smd" and take note of the bone that says "wpn_knife_0" (You will see why later)

(Follow these steps if you wish to import the smd file (NOTE: Only do this if you wish toedit a weapon model or animation, otherwise you don't need to open the smd files, if you don't wish to do this step, you can skip to step 8 of the larger sized font.)

  1. Open Maya 8.5
  2. Go to file > import SMD and select the reference.smd file inside of:
  3. When it asks to load textures, click cancel each time.
  4. The entire process takes about 10minutes, however I haven't successfully imported the knife model with32bit windows XP, so once again I recommend using a 64bit operating system with more than 2gb of RAM for this process.
  5. When the model is imported, you can select the mesh (not the bones) and separate the hands from theweapon. By following the picture below:
  6. Delete the hands and bones.
  7. When you extracted the ogf2smd.rar file, you may have noticed a file called "hands.mb" was extractedas well. Go to Maya and click file>import and find the "hands.mb" file and open it.
  8. You now should have a knife model and new hands with bones. You can now proceed to the large font ofstep 8 to continue the tutorial. Later I will explain what you do from this point onwards but instead of a knife, I will be using a simple box.
  9. When you extracted the OGF2SMD.rar file, you would have noticed it extracted a "hands.mb" file. Open that file.
  10. You will notice you will have 2 hands and some bones (ooo scary!) so now we're reading to create our weapon or import one you have already made. But for purposes of this tutorial we are going to make one inside the same scene.
    First we need to make the normals on the hands nice and smooth, so simply select the hands, go to Normals >Soften Edge up in the menu.
  11. Make sure that you are in the "polygons" tab like in the image below:
  12. The area where all the strange icons are, is called the Shelf, to the far left of the shelf there is abox icon, create a box like shown in the picture below (if you don't know how to create a box, follow the tutorials which you can find in help > learning movies.

Bones, weights and animation

Hooray, you've made it this far, and now we're going to be doing the fun stuff.

NOTE that I am NOT an animator, however I will be one. I was going to forget about animation until it was necessary, because I watched an 8 hour tutorial by gnomon and it scared me away from animation, it made animation sound super complex, and it's NOT, if you've done any 2danimation with flash or other programs that use keyframes, then this is pretty much the same thing in 3d.

So, lets get started shall we?

Setting up the bones.

  1. Go to the animation tab as shown:
  2. Click on the "joint tool" icon which looks like this: Image:Wi47.jpg
  3. Click behind your box so that your scene looks like this:
  4. Now while you have the new joint selected, hold down shift, and click on the joint behind it which is called bip_01_neck.
  5. Now double click on the icon shown here to connect the joints: Image:Wi48.jpg
  6. A new window will pop up, select "Parent Joint" and click Apply.
  7. You should now see this:
  8. Now click on the joint that you made before. Make sure you only click on thecircle/sphere and not the long bone section.
  9. It will look like this when selected:
  10. Now you have it selected, you need to view it's properties. So in the top right corner of Maya, there are 3 icons that look like this:

    Click on the last icon, and you'll notice the side of your screen will change.
  11. Click on the grey/blue bar that has "joint1" written inside of it and rename it to"wpn_knife_0" then press enter like so.

And this is all we need to do with the bones for now.

Creating a material and applying it to our weapon

In order for our weapon to be recognized by the X-ray engine we need to assign it a material. If you don't do this, the object will appear to be white in the actor editor, and it won't export the model.

Now we have our materials set up inside of Maya (we did that previously), I would like you to double check to make sure the plug-ins are activated.

  1. Go to Window > Rendering Editors > Multilister as shown below:
  2. Now a window will pop up with some cylindrical objects and other stuff. Go to edit>create and a new window will pop up that looks like this:
  3. Click on the X-ray Mtl button in the "Materials" tab as shown below: (If you can't see the button, then you haven't installed the plug-ins correctly)
  4. Now click on the middle button in these icons in the top right that we used before Image:Wi49.jpg and the material properties will appear on the right-hand side of the screen.
  5. Now click on the black and white checkered box next to "colour". A new window will pop up Just like the one in the picture above (Create RenderNode window). Click on "file" inside this new window"
  6. Now a new properties menu will appear on the right, click on the little folder icon to find your texture (remember to follow the tutorial in the X-ray SDK that I mentioned before):
  7. Now go back to the "multilister" window and double click your new material. Then in the properties, you should have these settings:

    However you can have a look at the link Docs:Creating a scene in Maya for a full list of the different shaders and what they do.
  8. Now select your box weapon and then right click on your material

>edit>assign then click OK on the next popup to apply the material and texture.

Combining the mesh and deleting history

This part is quick and simple, we just need to combine the weapon (box) mesh to the arm mesh and delete the history on it to prevent errors occurring later on.

FIRST though, I will say to SAVE YOUR PROGRESS as an .mb file or .ma file, it doesn't matter. Just call it "progress.mb" for now.

  1. Click on your box and then click on the mesh (only the mesh) on the arms.
  2. Make sure that you are in the polygons menu now, you can select this bygoing to the menu shown here:
  3. Go to Mesh >Combine as shown below:
  4. Now making sure only the mesh is selected, go toEdit >Delete by type>history, as shown below:

Rigging, weighting and animation

I'll remind you that I am not going to go into rigorous and complex animation for this tutorial. I am just showing you the very basics of everything, otherwise this tutorial would take me weeks to write. Rather than a few hours.

Rigging the mesh

  1. Select the mesh and click on a bone in the scene.
  2. Now go to the "animation" menu:
  3. Go to Skin >Bind Skin >Smooth Bind as shown below:
  4. Make sure that the "animation" tab is opened like so:
  5. Save the file again.

Weighing the model

  1. First Click on the Mesh of the arm.
  2. Now in the Animation shelf click on the paint weights tool which looks like this:
  3. You will notice once you do this, the mesh will go black, go to the properties for the tool (you should know how to do this by now). Now move the camera over to the thumb.
  4. Go to the next page to see what does what in the properties:
  5. Image:Wi25.png
    1. Brush size
    2. This is where you select which bone you want to paint the weight for.
    3. Just set this to 1
  6. For now click on bip01_l_finger02 to start with (this is the tip of the right thumb (which is strange because it shows as being the left thumb).
  7. Now you'll see a faded white colour on the thumb, if not, go to the other hand and look. You need to paint the weight on the thumb tip and all fingertips for each fingertip bone. (shown in picture after step 8)
  8. Next you need to select the bone "bip01_l_forearm" and paint everything down to the wrist like so:

  9. Now repeat on the other arm and fingers. And this will prevent the arm mesh from lagging behind when you move the bones.
  10. Now select the bone "wpn_knife_0" and paint your box weapon completely. Like so:
  11. Save the scene as "reference.mb" now.
  12. Now select the mesh and go to file> export selection.
  13. Export the file as X-ray_skin_export (*.ob*) and call it reference.ob....or anything else you want. Since it's our canvas for animation, I like to just call it reference.ob

Basic animation

Now we're going to do some really basic animation and I'll show you some things that are handy with animation. Remember this is BASIC, don't expect rocket science!

  1. First, we're going to move the arms forward to a position which looks like the character is carrying the box, click on the joints indicated in the picture below:
  2. Now the first animation we're going to create is a simple "draw" animation; The player pulls the weapon out, and brings it into view.
  3. Click on the wpn_knife_0 joint and shift click on both forearm joints as shown in the picture below:
  4. Now click the icon that looks like this Image:Wi51.jpg which is at the right end of your animation Shelf.
  5. Now if you click on the joint wpn_knife_0 you'll notice that the 2 forearm joints will be purple (shown in picture below). Now you can simply move the wpn_knife_0 joint and you'll notice that the arms move with it.
  6. Go to Windows >Settings/preferences >Preferences
  7. In the new window choose these settings shown in the picture below and save the settings:
  8. Go to the bottom left of your screen and change the number in the 2nd box to1.00 (surrounded by red box in picture). And notice that figure 1. in the picture is your timeline for animation, it will be spread across down the bottom in 30 frames for the time being.
  9. SAVE the scene as an .mb file first Call it "reset.mb". Now we can start setting keys. Make sure that wpn_knife_0 is selected and go to frame 30 and press "s" to set a keyframe. (NOTE: You do not HAVE to create thereset.mb file, you can simply just delete the frames in a scene once you've exported the animation.
  10. Now click on the first frame like shown in the previous picture, and move the bone down to where you think the player wouldn't see the box and the hands on screen. And press "s" to set a keyframe again.
  11. Now on the bottom right corner, you will have some icons. You'll really only want to focus on the play button and how many frames you want in your animation for the time being.
    (figure 1. is the amount of frames in your animation, figure 2. is the play buttons etc)
  12. Now, I wasn't going to put this into the tutorial but I think it's a very important aspect of fine tuning your animations. On the left hand side of your screen there is a viewport changing icon which will split your screen with your perspective view on top and graph editor on the bottom indicated in the picture below:
  13. You will notice there are a few buttons up the top of this window. The ones Iwant you to take note of for now are these ones:

    It's hard to explain what each do without a video, but say for example you have a box that animates to quickly go up and down every 10 frames for 30 frames, as if the box is being shaken up and down, and you want it to look natural, you can select the first icon in the picture and it will smooth the animation out, I think it is set to this by default, so say for example you want the box to be very jerky with movement with no smoothing, you would click the icon that looks like a straight line (linear motion)
  14. Now that we have a simple animation, click on the mesh (not the bones) and go to file >export selection, and export the file as anX-ray_skin_motion_export (*.skl*) file. Call it "draw". Now we have exported an animation. We will do a few more animationsnow.
  15. To make things easier, go to file >open and open up your "reset.mb" file. (You don't need to save the animation you were just doing, but if you want to, you can if you want to edit it later) (NOTE: You don't have to open reset.mb remember, you can just delete the keyframes instead)
  16. Select the wpn_knife_0 bone now click on frame 1 and set the keyframe.
  17. Now go to frame 30 and move the box down out of sight and set the frame again.
  18. Export the animation again as an skl file and call it "hide"
  19. Open reset.mb again.
  20. Lets do an idle animation now. So for this, we can simply click the 1st frame and set it, then copy that frame and paste it to frame 30.
  21. Go to frame 15 and move the box down a tiny little bit as if the player wasbreathing22. Remember that if you don't like the looks of your animation, you can go tothe graph editor and change the type of animation path that your animation houses.
  22. Export the animation again as an skl file and call it "idle"
  23. Finally we want attack animations, with the knife model there is actually 4 animations for attack. So in our example, our first attack animation will swing down and stop, the 2nd animation will be where the 1st attack stops and returns to the normal position, and the same goes for the alternate attack, so lets open up reset.mb again, select the wpn_knife_0 and put a keyframe at the first frame again.
  24. We're just going to do a simple push forward animation, so change the amount of frames in your animation to something like 7 will be fine (Ihope you remember how to do that, it's the text box near the play buttons)
  25. Go to frame 5 and pull the box backwards a bit and set the frame27. Copy frame 1 to frame 7 and then move the box a little bit forward of the default position and set the frame in frame 7.
  26. Export the animation as an skl file and call it "attacka"
  27. This time don't re-open reset.mb, but instead, delete the key at frame 5' and swap frame one over with frame 7.
  28. Export again as "attackb"
  29. We won't worry about doing the secondary attack right now, but if you want, you can make an alternate attack.
  30. Now we are all done, we can close down Maya.

Working with the actor editor

If you have used any of the editors before, you'll find that they are all very similar in layout andfunctionality which is excellent because it means less confusion for the end user.

Lets start this shall we.

  1. Go to C:\Program Files\X-Ray SDK\level_editor and open ActorEditor.bat (the exe files do not work)
  2. Go to the top right corner of your screen and go to file >load, now find yourreference.ob file and open it.
  3. You should now have your model in the actor editor like below.
  4. Now click on where it says "bones" on the right hand side of the screen.
  5. You will notice down the bottom right corner of the screen has changed in the item properties. You first need to click on "reset IK" which is represented as "Re..." (shown in picture below as step 1.)
  6. Then you will be asked if you want to reset the IK, click on "YES"
  7. Now in the same properties screen in the bottom right, click on "All" (shown in the picture as step 2.)
  8. Above where you clicked on "bones" before, you need to click on "Motions" then go back down the bottom right hand corner of the screen again.
  9. Click the append button which is represented as "Ap..."
  10. Now a browse window will popup. Browse to the .skl files that you created. Select them all and click "open" to load the animations into your scene. (NOTE: since the SDK is buggy, yesterday when I imported the Katana, Ihad no issues importing animation, but today, when I tried importing them, I got errors, all I will say is that if you get any errors, try and import the animations individually, and ignore any error message you get. Some errors that I ran into were: (Dammit, now the errors have disappeared....thats what I'm talking about with being buggy)
  11. Your animations will appear on the right under the motions section like shown below:
  12. Click on "draw" to start with and look at it's properties down the bottom right. You will also notice that in the viewport your model will animate.
  13. You will notice that the animation loops. The only animation we want to loop, is our idle animation, so to stop it looping animations (attacka, attackb, draw, hide), you need to tick the boxes shown in the picture below, while you're here, make sure to select "default" as the bone part orthe model wont export also make sure "idle" has a default bone part:
  14. Check to look at your animations to see if any are looping other than "idle".
  15. Go to file >export> export OGF to:
    D:\Program Files\THQ\S.T.A.L.K.E.R. - Shadow of Chernobyl\gamedata\meshes\weapons\knife

You can make your own folder, but for now just export to the knife folder and called your weapon "wpn_box_hud.ogf" (you can also call it anything you like, but for this tutorial that's what it'll be called)

If you get any errors, make sure you check that you have set the bone part to default on all of the animations.

The final stretch, editing the knife.ltx file

  1. Go to: C:\Program Files\THQ\S.T.A.L.K.E.R. - Shadow of Chernobyl\gamedata\config\weapons and copy the file w_knife.ltx so you have a backup.
  2. We are now going to do some editing of the w_knife.ltx file, so open up the w_knife.ltx file with notepad.
  3. The only bits we need to worry about, are the bits highlighted below:
  4. You may or may not have noticed that in Maya, our model was facing in a minus direction, which means that we have to change the orientation of our model in the ltx file to -180 degrees. So where it says "Orientation" changethe values so it is "-180,0,0" .
  5. As a test, I noticed that our model is a bit too high, so you'll need to adjust the Y value (X,Y,Z) where it says "position", Depending on the model, you may need to change the value to more or less, but you should only need to give it a lesser value, so change it so "0,-.1,0" or lower if you'd like.
  6. Where it says "Visual" is where it is looking for the object file, which in our case is "wpn_box_hud.ogf", so change the line so it says: = weapons\knife\wpn_box_hud.ogf
  7. Now for our animations, since we use very similar names to the ones already in the w_knife.ltx file (idle, draw, hide) we don't need to edit those bits, but we do have to change the attack animations and the idle_sprint animation.
  8. So your settings should look exactly like the settings shown below:
  9. Save the file, and it's time to go into the game. Start a New Game, or go to multiplayer, and pull out your lovely pretty looking box. Test out the attack that we have, test out the range and damage of the attack etc, and see how it goes. Now you can run around killing enemies with your box o'death.


Personal tools