version 1.41
Last Updated: March 25, 2007
Tutorial created by neural-link, with lots of information from SARACEN. Thanks to Master of
Miscellany (for telling me how to edit the batch files) and Raven Software
This tutorial is for the EF Multiplayer (Holomatch) code, and wont work with the Singleplayer code. However I have some very brief notes on EF Single Player and EF2 code.
Tutorial Sections:
Tools Used | Setting Things Up | Starting a Fresh Code Base | Test a Quick Mod | Making Your Mod Show Up on the Mod List in the Game | Compiling | Additional Notes | EF Single Player Code Compiling? | EF2 Compiling?
Tools Used
Tools needed:
- Knowledge of C programming
- EF 1.20 source code
EF Multiplayer code OR ef1_20readytogo (1.18MB) - Text Editor
Notepad or Crimson Editor (Crimson Editor is free)
Crimson editor has syntax color highlighting making the code easier to read, and allow for powerful searchings.
Setting Things Up
I recommend downloading the ef1_20readytogo code off of my site. It has batch files that are already edited, which would be too lengthy to explain what had to be changed.
The Game Source is broken out into 3 areas:
game - governs the game, runs on the server side.
cgame - governs the client side of the game, runs on the client side.
ui - handles the ui on the client side.
First off you need to get the EF 1.20 source code and put it in your root directory of your computer so it ends up being.
C:/stvoy
You might have to rename the folder code-dm to Code-DM I'm not sure if it is case sensitive.
Windows 95 and 98 users need to do the following:
Edit your autoexec.bat file to include a path to c:\stvoy\bin_nt
(example)
SET PATH="C:\stvoy\bin_nt"
and reboot. If you dont know where the autoexec.bat
file is, it is in your C:\ directory. It can be edited it with any text editor, like Notepad or in
DOS.
Windows 2000 and XP users need to do the following:
Right click My Computer, pick the advanced tab, click on Enviroment Variables. In System Variables, click on
Path and pick edit then add
;C:\stvoy\bin_nt
to the very end of the line, and yes that semicolon needs to be there.
Starting a Fresh Code Base
To prevent problems from editing the original code and so you always have a fresh start for new mods, create a source directory inside your mod's subdirectory C:\stvoy\yourmod\Code-DM From now on, when I refer to the source directory, I mean the new one you just made under your mod's directory.
From inside C:\stvoy\Code-DM copy the cgame, game, ui and qcommon directories to your new source directory.
Now find the three *.q3asm files in Code-DM\cgame, Code-DM\game and
Code-DM\ui folders. Edit each one of these so that the first line has the exact directory\filename that the
outputted *.qvm file for each should be, inside the quotes, the first line of cgame.q3asm should read
-o "C:\stvoy\yourmod\vm\cgame"
the first line of game.q3asm should read
-o "C:\stvoy\yourmod\vm\qagame"
and the first line of ui.q3asm should read
-o "C:\stvoy\yourmod\ui"
Now, open Code-DM\game\g_local.h You see that line that says #define GAMEVERSION "baseef"? Change the baseef to something relevant your mod's subdirectory
(example)
#define GAMEVERSION "YourMod"
Now open Code-DM\game\bg_public.h and do the same sort of thing for the line #define
GAME_VERSION "baseef-1" and change it to something like
(example)
#define GAME_VERSION "YourMod-1"
Test a Quick Mod
Slow Stasis Projectiles - TestMod
make sure to copy the stuff as indicated in the above section, so you dont change the original code so you always have a fresh
start for new mods.
----------------------
1. Open the g_local.h file in the C:\stvoy\TestMod\Code-DM\game and change the GAMEVERSION define from baseef to TestMod
2. Save g_local.h
3. Open the g_weapon.c file in the C:\stvoy\TestMod\Code-DM\game
4. Go to line #706 and change the 1100 to 300. The old line reads:
#define STASIS_VELOCITY 1100 //800 //650
The new line should read
#define STASIS_VELOCITY 300 //800 //650
5. Save g_weapon.c
6. Goto C:\stvoy\testmod\Code-DM\game and run the game.bat file. This ultimately produces a qagame.qvm in the \TestMod\vm\ path.
7. Make a TestMod path under your STEF directory. This will be a sibling to baseef
8. Move qagame.qvm to \YourSTEFPath\TestMod\vm\
which would be C:\Program Files\Raven\Star Trek Voyager Elite Force\TestMod\vm\
if you installed with the
default.
9. Run STEF with the following command line stvoyhm +set fs_game TestMod
If you dont know how, open a new file in a text editor and type
stvoyhm +set fs_game TestMod
and then save it as TestMod.bat and then click it. And it
will start it for you.
10. TestMod should be the referenced game and you should be able to catch up with and outrun your rockets.
You might get a syntax error due to the batch files I edited, but it should still compile fine. Also if you get the following error (when you are running the game):
Client/Server game mismatch: baseef-1/testmod-1
that means you have to run the game with the pureserver option off or just make the YourMod.bat file
stvoyhm +set fs_game YourMod +set sv_pure 0
and that will turn pureserver off for you.
Making Your Mod Show Up on the Mod List in the Game
You need to create a description.txt file inside your pk3 file in your mod directory
before it will show up on the in-game menu. Create a description.txt
file and put the mods name in it, this is the name that will show up in the Mod list. Use WinZIP or Pakscape to
create your pk3 file. Add the description.txt file to your pk3 file and store it
in your TestMod directory. You can now put create a vm directory and place the qvm files in the vm directory in your pk3 file.
Compiling
Just a quick note to those who are unfamiliar with Quake III programming - whenever you make a modification to one of the source code files, you usually only need to run the *.bat file in that directory (this will recompile the *.qvm file that that source file is a part of). However, if you make any modifications to any of the Code-DM\game\bg_*.* files, you need to recompile all three *.qvms. And it's also worth mentioning that you should NEVER edit either of the Code-DM\game\q_shared.* files - they are both part of the source code to the game engine and so any changes made to those files would require recompiling stvoyHM.exe - which nobody but Raven Software can do!
Now Run STEF with the following command line stvoyhm +set fs_game YourMod
If you dont know how, open a new file in a text editor and type
stvoyhm +set fs_game YourMod
and then save it as YourMod.bat and then double click it.
And it will start your mod for you.
Now you can edit the code and compile without using an expensive compiler! You might get a syntax error due to the batch files I edited, but it should still compile fine. Also if you get the following error (when you are running the game):
Client/Server game mismatch: baseef-1/testmod-1
that means you have to run the game with the pureserver option off. It may reset it to on, so make sure it is off before you start or just make the YourMod.bat file
stvoyhm +set fs_game YourMod +set sv_pure 0
and that will make the turn pureserver off for you.
Additional Notes
It is best to know the C programming language before you begin. Its possible to modify the code without any knowledge, but that isnt programming, its screwing around! After all if you don't know the language well enough, things that should take a minute to do will take you much longer. If you have trouble figuring out something, try looking for a similar effect or feature elsewhere in the code, often you can take a look how something was done elsewhere and modify that to your needs in another situation. You can ask others for help, but don't expect them to code everything for you.
Since Elite Force is based on the Quake3 engine, the following sites will be of help
Code3Arena - probably the best Q3 coding site on the
net.
Quake Style - Q3A coding tutorials.
Juz's Tutorials - a few tutorials , but good
EF Single Player Code Compiling?
Again this tutorial is NOT meant to compile the single player code.
EF's Single Player (SP) code is in C++ so if you decide to edit the single player code I recommend that you USE Visual C++ to compile the Single Player code. You can use other compilers (there are free ones), but it may take some configuration. I won't write a tutorial on compiling the SP code, because its just too easy to setup with Visual C++. Download the EF Single Player code here
EF2 Compiling?
EF2 is in C++ and I would recommend that you USE Visual C++ to compile your EF2. You can use other compilers (there are free ones), but it may take some configuration. Compiling the code for EF2 will effect both multiplayer and single player modes. I won't write a tutorial on compiling the EF2 code, because its just too easy to setup with Visual C++. Download the EF2 Source Code here
