This is the final episode in the “How to make a First Person Shooter Series”. So far we’ve covered creating levels, adding characters, lights, triggers and level changes. Now in this video I'm going to cover adding custom players, elevators, heads up displays and packing your game into an executable.
Before you could add actors you first need to have actor files that you can add to the game. There are two ways of going about this, you can either make your own or you can download one set of already been made. To make your own you'll need a 3d modeling program. The one that’s recommended for use with reality factor is called MilkShape 3D which will run you about $35.00. Also using MilkShape 3D and the conversion guide that you can find here, you can convert models into your game as well. I'm going to be using models that I've downloaded for free at this website.
Once you’ve created or downloaded the actress that you want, you want to put them in your program, files, reality factory media actress folder. Now go back to the reality factory folder and open up the tools folder and then double click on actviewer.exe. Then just choose your video mode and go to file and open up one of your actor files. Here you can view the animations under the motion section and the joints under the bone section. You want to write down the different animations for each actor as we’ll need them later. You also want to find out the name of the right forearm bone as we’ll need that later also, then you can close out of it.
Next we’ll need to create a new script for these actors. So open up notepad and start a new document. We’re going to create five sections that give the actor functionality. I’ll briefly explain what each one of these means, but you can find the full script and copy it from the website following link below. Start by enclosing everything inside two curly brackets, then create a section called spawn like this. In it we’re going to create eight sub sections that give the actor tribute at spawn. First we’ll need to turn off the console then we’ll set its health attribute, we’ll set it to find a target, we’ll make its field of vision 360 degrees, we’ll make it hostile, we’ll make it friendly to other enemies and we’ll make it friendly to other pawns, and then we’ll set it to a group called enemy.
The next section is the die script where we’ll set the die animation or whatever your actor’s dying animation was called that you wrote down. Then we’ll set it to fade out and remove it from the game after it dies. For the alert script, we’ll set the distance that it can detect the player by. We’ll set its waiting animation and then we’ll call it attack animation whenever it detects the player.
Now under the attack script we’ll set it to rotate and walk towards the player and we’ll set it to fire the gun by telling that the gun type which you can find in the player.ii file, the forearm bone to move which we wrote down and we’ll set it to affect the health of the player when its shot, then this “if” statement sets the actor to keep moving until it reaches the player and then to stop. Lastly, we’ll set the lost target script so that the actor changes to idle into alert whenever the target is out of range.
Next go to file and save and call it badguy1.s with the type all files to your reality factory/scripts folder. Now we need to add the enemy to the gaming files. So when notepad go to file and open and navigate to your reality factory/install folder and then open up the pawn.ii file. Add a new section called badguy1 and then add the actor name and set it to the .act file for the actor, then you can set the rotation to make sure the actor standing upright in the game then you can also scale it up or down, set the fill color, ambient color and whether its affected by gravity and its initial animation and its shadow size. Next just save the file and close out of it.
Now you can watch the reality factory game editor and add a new pawn entity. Set the pawn type to badguy1 the script name to badguy1.s and the spawn order as spawn. Now you can test your game to see if it works.
To customize heads up display you're going to create your graphic choosing a multilayer image editor such as photo shop or paint.net. To save time of uploaded images I'm going to be using in this tutorial to my form so that you can download them and follow along. There are four bit map files in one paint.net project file that you can open up with paint.net. Extract the bit map files to your reality factory media bit map directory where you'll find all the other graphics that are used in the heads up display. The graphic side created will be used to indicate the ammo for our disc shooting weapon. You'll notice a gun shell graphic—a gun indicate graphic and are corresponding alpha graphics. Each graphic will need a corresponding alpha in order to work.
Next go you your reality factory install folder and open up the player.ii file. In it you'll see a section named after gun shelves. The ones I will be monitoring will be the discs but you can choose whichever one you want. Now open up the hud.ii file and create a new section with the same name as the gun shell that we’ll be monitoring. Make the type horizontal and set the flame and frame alpha equal to the gun shell bip map and its corresponding alpha. Set the frame x and frame y equal to the position where you want it to be on the hud. For instance mine is set to be just below the health bar. Then set the indicator in indicator alpha to the gun indicate bip map and its corresponding alpha. Set the indicator offsets to zero and set the width to 256. Now save it and close it and test out your game. You should see the indicator level go down whenever you start shooting the disc launcher.
Another cool thing that you can add to you game is the stuff that moves whenever the user interacts with it such as doors or elevators. I'm going to show you how to make an elevator but you can use the same method to make doors. First in the game editor, create a new square brush by selecting the templates tab, the square and then hitting enter on your key board. You should see it appear in one of the four views. Then using the modify brush button you can resize it to the size of a platform and place it where you want it to be used. With it still selected, select the models tab, click on add model and name it elevator. Then click on animate and then stop animate and set the key time to one. This will set the initial position for one second. Now hit animate again and this time move the platform up to the height that you wanted to reach. Then hit stop animation and set the key time to three. Hit animate again and stop animation again and set the key time to eight. This moves a platform up in two seconds and imposes it at the top for five seconds. Now hit animate one last time and move the platform back down to its starting position then hit stop animation and set the key time to 10.
The last step is to click on the templates tab and add a moving a platform to your project. If you're creating a sliding door you would want to add a door entity instead. With the entity selected change the model to elevator and change the player only to true. Now you can compile your game and you should have a working elevator whenever the players steps on.
I showed you in the last video how to zip up your files for distribution, but a way to make it look even more professional is to convert it to an executable. So following the same steps as in the last video zip up your game as if you're getting it ready for distribution. Then next you'll need to download a free program called packet builder which you can find here. This program will convert zip files to executable files.
Next you want to download the packet shell extension from this website so that we can integrate the program into Windows Explorer. So once both of these are downloaded you can just right click on your zip file and choose convert to self extracting exe. Now you can send it to your friends so that they can play it as an executable.
One thing that I didn’t cover that I meant to was adding weapons. This is because it would have made the video about 10 minutes longer. However, I have laid out the steps for adding custom weapons to your game in my forum, so be sure to check that out. Also check out tinkernut.com on Facebook and Twitter.
Alright that’s it for this tutorial and for more go to tinkernut.com.
Transcription by:
Scribe4you Transcription Services