Getting OJP Source Code
OJP's source is stored under what is called "revision
control", meaning that the files are stored on a remote server in a way
that remembers the changes that have been made to files. This
remote server is called the repository.
There are two ways to access these files:
- HTTP - Using your web browser you can directly
access the latest version of all of OJP's files by going here.
However, this method doesn't allow users to download the entire
repository at once; to examine different revisions of files;
or to commit changes. This method is not
recommend except for casual examination of individual files.
-
TortoiseSVN - This program allows full access to the OJP repository
from the comfort of Windows Explorer. It also lets users to
automatically "update" their working copies with the latest code from
the repository with the click of a button. OJP's developers
use TortoiseSVN. See
Accessing OJP's Repository with TortoiseSVN.
- Install TortoiseSVN. You can get the
latest version @
tortoisesvn.tigris.org . This tutorial was written
for TortoiseSVN v1.4.0.
- Create a new folder in
Windows Explorer. This folder will contain your local
(working) copy of the OJP repository.
- Right
click on the new folder and click on SVN Checkout.
- Paste in https://OpenSVN.csie.org/ojp/
for the URL of Repository.
-
Click Ok.
- Click Yes
to accept the security certificate for the repository. The
resulting initial download of the repository is long,
so now would be a good time to break for a snack or bathroom break.
-
Congradulations, you now have a working local copy of the OJP
repository! At this point, you might want to consult the Compiling and Debugging OJP
tutorial if you're interested in playing around with OJP's code.
This section covers how to compile
and/or debug OJP in Visual Studios 2005. This
Tutorial is Incomplete!
Compiling:
- Open the solution file (.sln).
-
Select Build->Configuration Manager
from the menu bar.
- On the Active
solution configuration pulltab, select Final.
- Click Close.
-
Select Build->Build Solution from
the menu bar.
- The resulting dlls will be in the
/ojpbasic or /ojpenhanced folders (depending on which distribution
you're compiling).
Debugging:
- Open the solution file (.sln).
-
Select Build->Configuration Manager
from the menu bar.
- On the Active
solution configuration pulltab, select Debug.
- Right click on your JK2game
project in the Solution Explorer.
-
Click on Set as Startup Project.
-
Right click on your JK2game project
again.
- Select Properties.
- Click on Debugging
under Configuration Properties.
-
Set Command to point to the jamp.exe
in your GameData folder wherever your copy of JKA is installed.
-
Add the following to the beginning of your Command Arguments
"+set fs_cdpath "<your JKA /GameData>" +set fs_game
"<ojpbasic/ojpenhanced>" +set fs_dirbeforepak 1 +set
sv_pure 0 +set viewlog 1". Where <your
JKA /GameData> is the location of your /GameData
folder of your JKA install. And
<ojpbasic/ojpenhanced> is either ojpbasic
or ojpenhanced based on which
distribution you're using. Example:
+set fs_cdpath "d:\games\Jedi Knight Academy\GameData" +set fs_game
ojpenhanced +set fs_dirbeforepak 1 +set sv_pure 0 +set viewlog 1
-
Set Working Directory to "../..".
- (Skip this step if you last compiled in the Debug
solution configuration) Select Build->Rebuild
Solution from the menu bar.
- From
the menu bar, select Debug->Start Debugging.
Troubleshooting Debugger Problems
Problem | Solution |
Modified dlls don't take effect. Modified
dlls get overwritten. | Doublecheck
Command Arguments setting. The sv_pure 0 settings is
especially important. |
I'm
getting a assert error whenever someone presses alt fire while flying
the Asteroids version of the Y-Wing! | It's a bug in
the Y-Wing's NPC file. Its weapon should be set to WP_BLASTER instead
of WP_NONE.
The bug is harmless as it doesn't break anything. It's best
to
either fix the file or just not fly the Y-Wing while debugging. |
Build Configurations
This is a list of the
possible build configurations of the OJP source code and what they do:
- Debug - Configured
for debugger. Flags set to generate additional debugging
related code and messages. This mode also supposedly is a bit
more forgiving about memory issues.
- Debug(Final)
- This is the Final build configuration simply set up to run with the
Visual Studios debugger. This is the recommended standard
work configuration.
- Final -
Configured for building project for final release. Code is
optimized for speed and all debugging related stuff is
removed. Use this mode if you're compiling your code for
release to the public.
- Release
- Unknown
Code Preprocessors
This is a list of known code preprocessor flags used in the OJP source
code:
- BUILDING_REF_GL
- Unknown, doesn't seem to be used.
- JK2AWARDS
- This enables the awards system originally used in Quake 3.
Unfortunately, the system does not work if enabled.
- MISSIONPACK
- Unknown (probably Quake 3 related), doesn't seem to be used.
- QAGAME
- This preprocessor indicates that it's the compiler is compiling for
the game side of the .dll code.
- UI_EXPORTS - This preprocessor
indicates that it's the compiler is compiling for the ui side of the
.dll code.
- _USRDLL
- Used to be used by the Visual Studios compiler to properly compile
the .dlls. It's not used anymore.
- _WINDOWS - Indicates that the
program is a Windows application. Used by compiler I think.
Editting Guidelines
- Document
your work as much as possible. Be sure to add mentions of
your work in the readme and other project documents.
- Make
your work as clean and tight as possible.
- Follow
the coding guidelines. Try to keep your code as separated
from
other code as is reasonable. Label EVERY coding change (from
basejka)
with appropriate coding tags. If you're creating a new
feature, you'll
get to determine what the tag name will be. Try to pick
something that
is simple and easy to search for.