Creating a sword for Fallout

From Nexus Mods Wiki
Jump to: navigation, search

Overview

This tutorial shows all the main steps you need to follow to create a sword from scratch for Fallout 3. If you only want to change the textures of an existing sword or change its properties and bonus, just skip the first part of the tutorial.

Required tools

Creating a sword

The main steps to create a sword for Fallout 3 are:

  1. Create the sword in Blender and GIMP
    1. Make the sword's shape
    2. Add a material
    3. Add a UV map
    4. Create the textures and normal maps in GIMP
    5. Centre the sword and resize it
    6. Add a collision object
  2. Export the sword
  3. Adjust the sword in NifSkope
  4. Add the sword to the game using the GECK

Create the sword in Blender and GIMP

Make the sword's shape

This is the first step of the process. In this tutorial I am not going to explain how to use Blender to model 3d objects as there are already very good tutorials on the matter like this one: Blender 3d: Noob to pro. Once you have build your sword in Blender you can proceed to the next step.

Add a material

Adding a material
Adding a texture
Map Input: UV
Associating an image to the texture

While you are making the sword object or after finishing it you have to add a material to it. The game requires the material because all textures, UV maps and properties that define how it will be seen in game are to be associated to this material.

To create a material, in the Editing(F9) area press on the New button (the button encircled in the image Adding a material).

Next, in the Shading (F5) area press the red ball (Material buttons), and that will open the area that is shown in the picture Adding a texture. Here you can change the name of the materials on the Links and Pipeline tab, change the material properties and add a texture. The material properties can also be modified in NifSkope and it is easier to do it there, so in this screen we are only going to add a texture to the material. To do so press on the Add New button on the Texture tab.

Once you've added the texture two new tabs will appear: Map Input and Map To. Go to the Map Input tab and select UV as shown in the Map Input: UV picture. This is important so that the mesh interprets that the texture will follow the positions of the vertices of the UV map.

The last step is to associate the texture you've just created to a texture image. Right now you can associate any texture to it, it doesn't have to be the right one as this will be done later in NifSkope. To associate the texture image press the Texture buttons (F6) as shown in the Associating an image to the texture picture, and in the Texture type drop down list select Image. A window will pop up where you can select the texture dds image and, as I've explained before at this moment you can associate any dds file you have as we will associate the right one in NifSkope later.

Add a UV map

UV/Image Editor
UVUnwrap window

Once you've created the sword's shape and added at least one material to it, you have to colour it or it will be seen as transparent in game.

To do this the first step is to create the UV maps. The UV maps are projections in 2 dimensions of the mesh that is a 3 dimensional object. With the UV maps you are telling the mesh what part of the texture (that is a 2 dimensional image) has to be painted on each of the faces of the mesh.

To create the UV map:

  1. Subdivide Blender screen in two screens: right double click on the top of the screen and select Split area from the pop up menu. Then move the line until it is more or less in the middle of the screen, separating it in two sections of the same size.
  2. Select UV/Image Editor on the right screen as shown in the picture.
  3. On the left screen, where your sword is, do the following:
    1. in Edit Mode select the faces of the sword that you want to paint togheter.
    2. select the menu option Mesh -> UVUnwrap and you'll see a pop up window like the one shown in the UVUnwrap window picture. Select the option to generate the UV maps that works better for you. I usually select Unwrap or Project from View but you can try the different options and see which one fits your needs. If you use Project from View first move the sword until you see all the faces you've selected as you want them to be projected in the UV map because this option will paint them as they are shown on the screen.
    3. on the right screen you'll see the UV maps you've just created. You can work with them as you work with meshes resizing them, changing their position, moving their vertices, ...
  4. Once you have generated UV maps for all the faces of your sword, save a file with the UV map image. You will use this file you are saving as a pattern to paint the sword textures later. To save this UV map image on the right screen select the menu option UVs -> Scripts -> Save UV Face Layout and press OK. Select the folder and enter the name of the file where you want to save your UV map on the pop up window.

Create the textures and normal maps in GIMP

Normal map window

Next step is to paint the textures: to do this you can use a program like GIMP. You can immport the UV map image file you saved earlier into GIMP and use it as a pattern to paint the textures: this way you will know at any time what part of the sword you are painting.

Once you've painted the sword textures save them as dds as this is the image format that the game requires. If the images don't have transparent parts you can save them with DTX1 compression. If they have transparency, saved them as DTX3 or DTX5. Make sure that the Generate mipmaps flag is marked when you save the textures.

Once you've painted the textures you'll have to create the normal maps that are the image files that will give your sword a sense of volume. You can create the normal map from the texture you've just painted, to do it this way just follow these steps:

  1. Select Colors -> Color to alpha and then select black or 000000 as the source colour.
  2. Select Filter -> Map -> Normalmap. A window will pop up like the one shown in the Normal map window picture.
    1. pressing 3d preview you will be able to see in another screen how the changes in the parameters give more or less deep to the normal map.
    2. select the Wrap flag and change the value of Height source to Alpha.
    3. select a filter (I usually select 3x3 but you can try different filters and see which one works better for you)
    4. modify the scale value to add more or less deep to the normal map (I usually set this to 3 or 4)
    5. Press the OK button and the image will show now a blueish look: this is the normal map. Save it with the same name than your texture file + the _n.dds extension and choose the DTX5 compression. Make sure that the Generate mipmaps flag is selected when saving it.
Note: In Fallout light colours look very bright, and often they look too shiny. If you want to make your textures less shiny:
  • make your textures a little darker: for example, don't paint white parts in white but in a light grey.
  • make the normal map a little more transparent: if you are generating them from the textures, you can try the following:
    • before generating the normal map, add a black layer to the texture and merge it with the texture using a % of opacity (like 50%, or 25%).
    • merge down the black layer onto your original texture and then generate the normal map.

Centre the sword and resize it

Centering the sword

To make the sword look good in game regarding its position and dimensions, the easier thing is to use another sword that already works in game as a guide. Take into account that characters in game will hold the sword by its centre.

  1. Import another sword (in the example I am using the chinese officer sword)
  2. Align the centres of the two swords:
    1. In Object Mode select the imported sword and then select the menu option Object -> Snap -> "Cursor -> Selection". Doing this you have mved the cursor to the centre of the imported sword.
    2. Select your sword and then select the menu option Object -> Snap -> "Selection -> Cursor". Now the centre of your sword is in the same place the centre of the imported sword is.
  3. It may happen that your sword is in a strange position after moving its centre. You can fix by moving your sword in Edit Mode: select all its vertices and move or rotate them. When moving vertices in Edit Mode you are not affecting the centre of the object.
  4. Once the sword is centred and in the right position you can resize it using the imported sword as a guide.

Add a collision object

Adding a collision object
Setting the collision logic

The last step in Blender is adding a collision object to the sword so it won't go though the ground or other objects in game when you throw it.

Blender has an script that creates automatically collision objects for a selected mesh:

  1. Select the sword
  2. In Edit Mode select the menu option Mesh -> Scripts -> Hull as shown in the Adding a collision object picture.
  3. Select the option you prefer. If your sword has a complex shape, like in the example, select Convex.
  4. Press the OK button and accept the default precission (0.100).
  5. Wait while the script works and when it has finished you'll see a pink object that surounds the sword: that is your collision object.

Once the collision object is been created, select it and in Object Mode:

  1. Press the Object button (or the F7 key) and check that the value of Drawtype is equal to Bounds and that the value of Draw Extra is equal to Wire.
  2. Press the Logic button (or the F4 key) and in the area shown in picture Setting the collision logic:
    1. Set the type of collision to Dynamic, set a value for the mass (7 in the example) and check that the radius (the dotted sphere in the picture)is right: neither too big nor too small.
    2. Check that the button Bounds is press and that the polygon type is Convex Hull
    3. Press the Add property button and fill the three boxes that appear below it as follows:
      1. Select String in the first box
      2. In the second box, that already contains Name:prop type HavokMaterial. Once you've done this in this second box you'll see Name:HavokMaterial
      3. In the third box type HAV_MAT_METAL (if you want your sword to sound as metal. If you want it to sound as stone type HAV_MAT_STONE, if you want it to sound as wood type HAV_MAT_WOOD)

Export the sword

Ctrl+A
Exporting as a nif file

Before exporting the sword, in Object Mode select all the objects (the sword and the collision object) and press the keys Ctrl+A. Select the option Scale and Rotation to ObData from the pop up menu.

To export the sword do the following:

  1. In Object Mode select all the objects (the sword and the collision object).
  2. Select the option of exporting to a nif/kf file and enter the name of your sword file (sword.nif for example).
  3. In the screen that appears and that is shown in picture Exporting as a nif file:
    1. Press the Fallout 3 button.
    2. Press the Weapon button and select Metal (if your sword is made of metal. If not, select the best material for your sword), and set its weight (Mass).
    3. Deselect the options Flatten Skin and Export Skin Partition
    4. Press the OK button. This will save your sword nif file.

Adjust the sword in NifSkope

Copy the sword shape

Copying the shape of the collision object
Copying the shape of the sword

If we were creating the sword for Oblivion, in NifSkope we should only make minor adjustments: associate the right textures and modify the material values if required and that would be it. But for Fallout there is still required to make some other adjustments manually in order that everything works fine in game.

Do the following:

  • open two NifSkope instances. In one of them load your sword nif file (Sword.nif in the example) and in the other load the nif of another sword that works in game (the best thing is to use the same sword you used previously as a pattern to center your sword).
  • what you are going to do is to copy the shape of your sword in the existing sword nif, so it is best that you save the existing sword with a new name, like FalloutSword.nif, to prevent overwriting it.
  • To copy the collision object shape:
    • In your Sword.nif file select the bhkConvexVerticesShape node (see Copying the shape of the collision object image) and right click on it. Select Block -> Copy from the pop up menu.
    • Go then to the game sword file, FalloutSword.nif, select its bhkConvexVerticesShape node and right click on it. Select the Block -> Paste Over option from the pop up menu. You'll see how the shape of the collision object has changed to the one you created in Blender.
    • If you want you can change the value of the HavokMaterial to any of the available ones in the dropdown list as shown in the Copying the shape of the collision object picture. Changing this value will affect how the sword will sound when throwing it in game.
  • To copy the shape of the sword:
    • In your Sword.nif file select the NiTriStripsData node (see Copying the shape of the sword image) and right click on it. Select Block -> Copy from the pop up menu.
    • Go then to the game sword file, FalloutSword.nif, select its NiTriStripsData node and right click on it. Select the option Block -> Paste Over from the pop up menu. Now the shape of the sword in this file will be the one you created in Blender.
    • You can change the value of TSpaceFlag from 240, that is the default value that Blender sets when exporting, to 16 that is the value that the vanilla meshes use in game (see Copying the shape of the sword image). Once you've changed the value of this parameter go down a little and you'll see the parameters Binormals and Tangents. Right click on the green round arrows that are beside these two parameters and select Array -> Update. Then select the main node BSFadeNode at the top and from the top menu select Spells -> Batch -> Update All Tangent Spaces and wait until NifSkope finishes the calculations.

Modify textures and materials

Shader flags
Textures
Material properties

Fallout nif files use some new parameters, the Shader flags, that have to be set properly or the object will look bad in game (too shiny, too dark, etc) or even be completely invisible. To check or modify their values select the BSShaderPPLightingProperty node (see Shader flags image) and in the Block details look for the Shader flags property. In the image you can see the shader flags I've used for my sword.

Next step is to associate the texture files you created previously to the mesh. To do it select the BSShaderTextureSet node (see Textures image) and in Block details expand the Textures properties: you'll see that there is room for 6 image files but for most of the meshes you wil only use the first two. In the first place, at the top, link the colour texture (the dds file you painted with the sword colours) and in the second place link the normal map dds file.

Check that the texture files begin like this: textures\... as shown in the Textures image. If the links to the files begin like C:\Program files\Bethesda Softworks\Fallout3\Data\textures\..., or \textures\... the game may not be able to upload them and you'll see the sword black or purple.

The last step is to modify the material properties. Under the NiTriStrips node that contains the shape of your sword select the NiMaterialProperty node, right click on it and select Material: a window like the one shown in the Material image will pop up. In Fallout materials have no name so delete the nale that appears on the top box (if there is any). In this screen you can modify the values of the Specular and Emissive colours, the level of transparency (Alpha) and the Glossiness of the sword. You can also modify these values numerically if you select the material node and then select View -> Block details.

Once you've modified all these parameters, save the nif file of your sword.

Add the sword to the game using the GECK

Sword properties
Sword properties II

To add the sword to the game you have to use the GECK, and do the following:

  • create a new weapon, to do it the easiest is to look for an existing sword in game, double click on it to open the screen showing its properties and change the ID and name of the existing sword to a new ones (the ID and name are the two values that are at the top of the screen as shown in the Sword properties picture). After doing this, click on the OK button and the GECK will ask you if you want to create a new object. Answer yes.

Note: the GECK has a bad habit of showing lots of warning messages. When the first one appears click on the Cancel button and you won't see more of these warnings.

  • open again the properties window of the sword you've just created with the new ID and name and modify the values you want.

Some useful values are:

  • On the top part of the screen shown in the Sword properties image:
    • Script: if you want to add a script to your weapon type here the name of the script (you can leave this field blank).
    • Repair item list (right top): select the Form list that contains the items you want to use to repair your sword.
    • Equip type: select the weapon type and the animation that Fallout will use to equip it and attack with it.
    • Skill: indicates what skill is used to increase the efficiency of the weapon
    • Flags, Playable: check this flag to indicate that your character can use the weapon
  • On the Game Data tab shown in the Sword properties image:
    • Weight: the weapon's weight
    • Value: How much the sword costs in caps when it is at 100% health condition
    • Reach: the reach of the sword
    • The damage the sword does is calculated using a formula that combines several parameters. The more important are: Damage, Crit Dmg, Limb Dmg Mult, Crit % Mult and Base VATS to hit chance (this one influences how the weapon behaves in VATS).
    • Crit Effect: indicates if the weapon has any visual effect on the NPC or creature you attack using it.
    • Resist: indicates if the weapon has resistance to something (fire, electricity, ...)
    • On hit: indicates the NPC or creature you attack with the weapon is dismembered, explodes or only dies without any other gore effect.
  • On the Art and Sound tab shown in the Sword properties II image:
    • Inventory image: dds file that contains the icon of the weapon that will be shown in the Pipboy
    • Message icon : dds file that contains the icon of the weapon that will be shown on the messages that appear at the top of the game screen
    • Model: the nif file that contains your sword mesh (FalloutSword.nif in the example). Press the Edit button and a window will pop up where you will be able to select the file that contains your sword.
    • 1st Person Model Object: Static object that contains the mesh of your weapon that the game will use when you are in 1st person. You can use the same mesh than the one used in 3rd person view or create another more detailed mesh to be used when in 1st person.

Once you've adjusted your sword properties save and close this window.

To place the sword in the world:

  • select the cell where you want to place the sword in the Cell View section and double click on it to open the Render window.
  • drag the sword object you've created to the Render window and drop it.

To finish, save the esp file with your sword, activate it and play :)