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:

Accessing OJP's Repository with TortoiseSVN

  1. Install TortoiseSVN.  You can get the latest version @ tortoisesvn.tigris.org .  This tutorial was written for TortoiseSVN v1.4.0.
  2. Create a new folder in Windows Explorer.  This folder will contain your local (working) copy of the OJP repository. (Screenshot 1)
  3. Right click on the new folder and click on SVN Checkout.  (Screenshot 1)
  4. Paste in https://OpenSVN.csie.org/ojp/ for the URL of Repository.  (Screenshot 1)
  5. Click Ok.
  6. 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.
  7. 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.

Using OJP Enhanced's Autobuilder

Files needed to for this process: 

  1. Microsoft Visual C++ 2005 Express Edition
  2. Windows® Server 2003 SP1 Platform SDK Web Install
  3. TortoiseSVN

Before Starting:

  1. Install Microsoft Visual C++ 2005 Express Edition
  2. Install Windows® Server 2003 SP1 Platform SDK
  3. Install TortoiseSVN

Steps:

  1. Configure Visual Studios Express to be able to use the Windows® Server 2003 SP1 Platform SDK
    1. Update the Visual C++ directories in the Projects and Solutions section in the Options dialog box. (Screenshot 1, Screenshot 2, Screenshot 3, Screenshot 4)
    2. Update the corewin_express.vsprops file.(Screenshot 1, Screenshot 2)
    3. In a text editor comment out lines 441 - 444 of AppSettings.htm by putting a // in front of them.  (Screenshot 1, Screenshot 2)
  2. Setup TortoiseSVN to access the OJP repository.
  3. Update the repository.
    1. Right click on the folder containing the repository and click on SVN Update. (Screenshot 1)
  4. Compiling OJP DLL's, making OJP PK3's, and making an OJP Installer.
    1. Go to <Hard Drive Name>\<OJP Repository Folder>\Enhanced\ where you will find the following files: CompileOJP.bat, MakePK3.bat, MakeWindowsInstaller.bat, and ojp_enhanced_installscript.iss. (Screenshot 1)
    2. If you do not want to make an installer and just want to make the .pk3's (IE, ojp_enhanceddlls.pk3 and ojp_enhancedstuff.pk3) you need to run the CompileOJP.bat batch file. After the CompileOJP.bat batch file is complete you need to run the MakePK3.bat batch file. After the MakePK3.bat batch file is complete, 2 pk3's (ojp_enhanceddlls.pk3 and ojp_enhancedstuff.pk3) should be found at <Hard Drive Name>\<OJP Repository Folder>\Enhanced\.
    3. If you do wish to make an installer, just run the MakeWindowsInstaller.bat batch file, after it is complete an InstallOJPEnhanced.exe will appear at <Hard Drive Name>\<OJP Repository Folder>\Enhanced\.
  5. Setting the correct revision number.
    1. To know which is the correct revision number you must right click the repository folder followed by clicking the SVN Update option. You will spot "Completed At revision <number here>" at the window that is opened after the updates are applied if there are any updates to apply.  (Screenshot 1)
    2. To have the correct revision number on your compiled OJP you must first edit bg_public.h (notepad is recommended) which is located at <Hard Drive Name>\<OJP Repository Folder>\Enhanced\source\game\. Once inside the file, find CURRENT_OJPENHANCED_CLIENTVERSION and edit the revision number to the correct one.  (Screenshot 1)
    3. You must then edit the ojp_enhanced_installscript.iss script file (notepad is recommended) which is located at <Hard Drive Name>\<OJP Repository Folder>\Enhanced\. Once inside the file, find AppVerName and edit the revision number to the correct one.  (Screenshot 1)
    4. To prevent conflict when updating the repository, you need to revert the files edited. Right click on the repository folder, select TortoiseSVN, and select "Revert...".  Only use revert if the only change you've made was to update the revision number!  (Screenshot 1, Screenshot 2)

Compiling and Debugging OJP

This section covers how to compile and/or debug OJP in Visual Studios 2005.  This Tutorial is Incomplete!

Compiling:

  1. Open the solution file (.sln).
  2. Select Build->Configuration Manager from the menu bar.
  3. On the Active solution configuration pulltab, select Final.
  4. Click Close.
  5. Select Build->Build Solution from the menu bar.
  6. The resulting dlls will be in the /ojpbasic or /ojpenhanced folders (depending on which distribution you're compiling).

Debugging:

  1. Open the solution file (.sln).
  2. Select Build->Configuration Manager from the menu bar.
  3. On the Active solution configuration pulltab, select Debug.
  4. Right click on your JK2game project in the Solution Explorer.
  5. Click on Set as Startup Project.
  6. Right click on your JK2game project again.
  7. Select Properties.
  8. Click on Debugging under Configuration Properties.
  9. Set Command to point to the jamp.exe in your GameData folder wherever your copy of JKA is installed.
  10. 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
  11. Set Working Directory to "../..".
  12. (Skip this step if you last compiled in the Debug solution configuration) Select Build->Rebuild Solution from the menu bar.
  13. 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:

Code Preprocessors

This is a list of known code preprocessor flags used in the OJP source code:

Editing Guidelines