Source code for the Q3 engineCompiling the Quake 3 1.29h Source
After searching for awhile on the internet, I couldn't find any useful information. The information I did find was outdated and only by using my own skills was I able to apply the little information I had found. So this site is here to show you the way.
Firstly you will need the source, go to either fileplanet or q3center or you can download it from my site.
Now before installing the source, I recommended having quake 3 installed to c:\quake3 (any other drive will do). Having done this, just run the install program and point it to your quake 3 directory. Having down this go to where the quake3 source is installed (c:\quake3\code and c:\quake3\ui) and in each directory, remove the read-only attribute from all the files.
In each sub directory of the code directory (c:\quake3\code) there is a batch file (game.bat, cgame.bat, q3_ui.bat). Each of these batch file is supposed to compile that part of quake mod. However, the batch files don't work (under windows 98 anyway) and need to be replaced with the same batchfiles that are available for the 1.27 source code. Again you can get these from fileplanet or q3center or from this site
Okay, we are almost ready to compile, now we need to set up the PATH environment. Add the following line to the end of your autoexec.bat (c:\autoexec.bat):
PATH=C:\quake3\BIN_NT;%PATH%
You can now reboot, or just re-execute autoexec.bat. Now you are ready to compile the source code. However, the compilation of game will fail because of a warning. In order to fix this problem without affecting the rest of the source, make the following changes:
In g_local.h and syscalls.c change the definition of trap_Trace from
void trap_Trace( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask );
to the following
void trap_Trace( trace_t *results, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask );
Save your changes and now you will be able to compile the source. You may get some warnings with ui and cgame however these will still work.
Making a Quake 3 Mod
Create a directory for your mod (mymod) and copy the contents of the code directory to your mod directory. Now edit the first line of game.q3asm, q3_ui.q3asm, cgame.q3asm (and ui.q3asm if your doing a team arena ui, I don't understand this can somebody email me) to place its output to your mod directory. Eg.
-o "\quake3\mymod\vm\qagame"
Compile your mod. You should get a batch of files in your mod's vm directory (c:\quake3\mymod\vm). Zip the vm directory with winzip or another zip program. Make sure the zip file keeps the directory structure, ie. when it is extracted it extracts the files to the vm directory. Now rename the zip file to pak0.pk3. Launch quake3 and go to the mod section. You should now see your mod in the list (in this example 'mymod'). To give other people your mod all they need is to place the pak file into their mymod directory.
To learn how to write mods, go to http://www.planetquake.com/code3arena. Most of the tutorials are based on 1.17 source code, (meaning the line references are out) however most still appear to work.
Stay tuned for more.
grom
- http://www.planetquake.com/code3arena/modsource.shtml
http://www.planetquake.com/code3arena/modsource.shtml
