First Words
Hello Quakers, welcome to the first of (hopefully) many tutorials related to Quake 3 Arena. Having not seen some tutorials for this fine game come out for quite some time, I have decided to create some myself. The objectives of these tutorials are to show newcomers of Quake 3 developing how to go about making thier own mod. At the end of each tutorial we will have a working modification, and each Tutorial continues on from the last. In the end we should have a very nice mod made :)
OK, now that we have the objective of this site out of the way, lets begin.
Getting Started
If you want to make modifications it is highly recommended that you know at least one programming language. Its not neccesary however, but it will make life a hell of a lot easier.
Firstly, head on over to the files section and grab the Quake 3 Arena 1.32b Engine source.
Done? Good.
Create a new folder in your Quake 3 Directory called "Source". Extract the contents of the zip file here.
If you are using Visual C++ 2003, you are in luck, just load up the project files in the IDE and you are good to go!
However, if you are like me, and are using Visual C++ 6, download this nice tool : prjconverter. Just put that in your Quake 3 source/code directory and open up a command window. Change directory to your Quake 3 Source/code directory and type:
prjconverter quake3.sln
If all goes well, you will have some project files for Visual C++ 6. Good ey?
Setting Up
Load up Quake 3 in Visual C++, now we need to make sure that we are compiling the Win32-Release configuration. Click on Projects, and then Active Configurations. Change it to Win32-Release. Also unload the UI Project, it will create problems when we go to compile.
We also need to make sure that the Quake 3 project has botlib and renderer as its depedencies.
Right click on the Quake 3 project and set it as default project. Right click it again and hit dependencies. Make sure that Renderer and Botlib are ticked.
We want the .dll to appear in our Mod directory. By default gamex86.dll is compiled in the quake3\source\Debug directory (which we need to change).
Go to the "Project" menu and choose "Settings". Single-click on 'game' in the list of projects on the left hand side. We're going to change where the qagamex86.dll file is built. Click the "Link" tab and have a look at the "Output file name" - by default it's set to "..\Debug/qagamex86.dll". Change it to "E:\games\quake 3 arena\mod\qagamex86.dll". Change it to your path to Quake 3. Thats mine :)
Do this for cgame and q3_ui as well.
Now lets set up Quake 3 to run our mod.
Head to your Quake 3 Directory and make a new folder called "Mod". This is where we will keep all our mod related files.
Create a shortcut to Quake 3 Arena on your desktop, right click it and go to properties.
In the "Start In" add this to the end it , minus the quotes. " +set fs_game Mod +map q3dm1"
This tells Quake 3 to load up our mod "Mod" and load up a map "q3dm1"
Start a game with our shortcut, have a quick play, and exit out. Head to the mod Directory we made, and open up q3config.cfg. Scroll through it until you see:
vm_cgame 1
vm_game 1
vm_ui 1
Change them to:
vm_cgame 0
vm_game 0
vm_ui 0
This ensures that Quake 3 will load DLL files that we make later.
OK, now that we are all set up, lets get this show on the road!
Let The Mods Begin
Load up cg_weapons.c in your editor.
Go to line number - 320, you should see this:
/*
==========================
CG_RocketTrail
==========================
*/
static void CG_RocketTrail( centity_t *ent, const weaponInfo_t *wi )
As you may have noticed, this function is for the trail of smoke that emits from the rockets as they zoom past you.
Give it a read through.
Ok scroll down until you see :
smoke = CG_SmokePuff( lastPos, up,
wi->trailRadius,
1, 1, 1, 0.33f,
wi->wiTrailTime,
t,
0,
0,
cgs.media.smokePuffShader );
Lets change this around a bit.
Change it to this:
smoke = CG_SmokePuff( lastPos, up,
wi->trailRadius,
rand()*1, rand()*1, rand()*1, 0.50f, // MODIFICATION
wi->wiTrailTime,
t,
0
0,
cgs.media.smokePuffShader );
What We Did
We added a function here that randomizes a number ( rand() ). By adding this we have essentially told the game to randomize the color values ( 1,1,1,0.5f ) for the shader ( cgs.media.smokePuffShader ). This gives us a different color each time the rocket emits a smoke puff. We also adjusted the alpha channel from 0.33f to 0.50f so we can see the colors better. This makes the shader less opaque.
Go ahead and compile the code. Now place the cgame.dll, game.dll, and uix32.dll files into the mod directory we set up earlier. Now load up Quake 3 using our shortcut that we also made earlier.
Grab a rocket launcher, shoot a few rockets, and pat yourself on the back for giving the rocket smoke a hippy look.
Happy Fragging.
PSYKoR3
