We've gotten some requests to make a tutorial on how to import a custom prefab (object) into Blockade Runner, and as I started writing this tutorial last night, Blockade Runner modder Keptin had already made a video series detailing not only how to import a prefab into Blockade Runner, but also how to model and texture it as well.
My thoughts: "Thanks Keptin! Now I don't have to make a written version." I was almost done with it though and decided it'd be good to have both versions.
So check out Keptin's video tutorial here
for part 2) or read the tutorial below to find out how you can add your own custom object to Blockade Runner!
This tutorial involves the following:
- 3D Studio Max (Blender and Wings 3D are not supported for direct import into Blockade Runner in 0.55.1, but will be included with 0.55.2)
- Photoshop CS4
- nVidia DDS PluginYou can alternatively use
Free Modelling Software:
(click here to see export settings
(click here to see export settings
Free Texture Editors
Free DDS Converters
- DDS Converter 2.1
- DDS Plugin for Gimp
(untested with Blockade Runner)
- (any application that can export to "DXT3 | 8bit alpha" should work)THE BEGINNING
For this tutorial we're going to add this new laser gun.
We'll start by making sure that the object is in the correct position in the 3d modeler.
For Blockade Runner to position the object correctly we'll need to position it in positive space. Relative to the grid center it would be above (positive Z), to the right (positive X), and away (positive Y).
Now we want the laser gun to take a total of 3 voxel spaces in Blockade Runner. Make sure you set the unit scale in 3dsmax to be units instead of meters, as each unit in 3dsmax is a centimeter inside Blockade Runner! (100 centimeters=1 voxel)
To make sure the object is within the space we want we'll change the grid spacing to 100 units (Grid & Snap Settings > Home Grid).
Now we can scale the object to whatever voxel size we want, in this case one voxel wide, one voxel tall, and three voxels long or 100 x 100 x 300 3D Max units.
The top and bottom flange do go past our intended space but I want the object to be stackable and small enough to put in small spaces so we'll leave it alone.ADDING THE FILES TO BLOCKADE RUNNER
Next, we'll go to the folder ../Blockade Runner/Content/Prefabs and create an all new folder. We'll name it something related to the object that's easy to remember (we have to refer to it in a minute), in this case we'll name the new folder "lasergun".
Now we'll export our model as an .obj into our new lasergun folder, and make sure we name it "model.obj". (Blockade Runner uses just the folders to differentiate between the prefabs so the object doesn't need a specific name besides "model.obj")
Next we'll get the model's texture set up. Make a new texture in a texture editing software, and make sure it is exactly 256x256. Save the texture as a DDS. The format needs to be "DXT3 ARGB 8 bpp | explicit alpha" and must
include mipmaps. Save the texture in our lasergun folder as "texture-diffuse.dds"
<- Test texture
We'll follow the same steps to get the object's normal map, saving in the same folder, and naming it "texture-special".
Now that we've got our Model and texture finished we can move onto actually adding the prefab into Blockade Runner!LET BLOCKADE RUNNER KNOW IT EXISTS!
Blockade Runner automatically detects how many voxel spaces our object will take unless we give is specific instructions. Our Laser Gun object will automatically take up a 3x1x3 voxel space because of the top and bottom flange in this case.
We want it to take up 1x1x3 however, so to make sure Blockade Runner knows what size we want our laser gun to be, we'll use a settings.xml. Go back to ..BlockadeRunner/Content/Prefabs and go into the "TV" folder. Copy the settings.xml there and paste it into the lasergun folder.
Open the settings.xml using notpad. The <size> section is where we instruct Blockade Runner what voxel dimensions our Laser Gun prefab is. Under Width=" we'll put in 1, under Height=" we'll put 1, and under Length=" we'll put in 3. Now the model will take up a 1x1x3 area in Blockade Runner. Success!
Finally, we'll add the prefab into BR. Go to BlockadeRunner/Content/Data and open the Solids.xml with notepad
The Solids.xml is responsible for all of Blockade Runner's type of blocks and prefabs (with the exception of frame), each line under <Solids> represents a voxel block or object and its name, description, model path, and things of that nature.
Copy the bottom most line within the <Solids> category, then paste it at the end of the list (before </solids>) Now that we have a copy of a prefab's properties all we need to do is change the model directory, description and name.
The name at the start of the line is what will display in game, so here we'll rename it to "LASER_GUN" (without the quotes). The underscore translates to a space in-game.
Next we'll skip to the end of the lasergun's property line to change where it is getting its model from. We're looking for is Modelpath="", not to be confused with TexturePath="" which is already "texture" (which is what we named our textures).
The Modelpath="" is already directed to ../BlockadeRunner/Content/Prefabs and just needs the final directory of where the model is. So we'll put the name of our Laser Gun's folder into the quotes, it should read ModelPath="lasergun".
To make sure we can actually find our Laser Gun after we add it to Blockade Runner we'll go to the Category="" section of the line (near the middle). We'll rename it to the appropriate weapons category, Category="W_Weapons".
Now we'll give it a new description, find the DescLong="". This is what we'll see when we hover over the weapon in-game. We'll keep it short and just insert "It's a laser gun." into the quotes.
We could also change the mass and other options but this will do for now.
Now we're all set to see it in-game. Save the solids.xml and enter Blockade Runner.
Now when we go to the Offensive category, then to the weapons sub-category we can see our brand new laser gun prefab.
Kind of looks like a fish.
There we are, all done!
And be sure to check out Keptin's video tutorial!Part 1Part 2