Step Six: Coding I

CODING I

I'll explain how to get the JACoders "modbase" version of the Jedi Academy MP code SDK, how to compile it using Xcode and how to use the debugger for your mod.

TOOLS NEEDED

  • Xcode - if you are on Lion or Mountain Lion, it is free on the App Store
  • GitHub for Mac (optional!)

GETTING THE SDK


The JACoders "modbase" version of the SDK has many useful bug and exploit fixes over the original SDK, so it's probably the best version to start from. It can be downloaded from the jasdk_modbase github repository. If you have git or the GitHub for Mac application set up, you can click on the "Clone in Mac" option, or clone the repository using the provided link to the .git. If you just want to get started quickly, you can download a zipped version of the current modbase SDK by clicking the "ZIP" button.

GitHub window

If you've download the .zip version, extract the archive. Regardless of exactly how you got the SDK, you should have a folder that looks something like this:

SDK folder

COMPILE THE SOURCE


Open up the macosx folder inside the src folder. Inside there are three .xcodeproj files, which are the Xcode projects for cgame, game, and ui.

The project files automatically put .pk3 files for cgame, ui and game in your secondary base folder when you build, so there are a couple of settings you might have to change for it to work properly.

For each project, go to the "Build Settings" panel for the corresponding target. If you have the App Store version, change the value of JKJAAPPSTORE from 0 to 1. If you want the files to go into a folder other than base, change JKJAMODNAME - note that the folder must already exist alongside the secondary base folder. Finally, if you're using the Steam or App Store versions, JKJANAME should be Jedi Academy, or Jedi Academy MP otherwise.

Targets

We'll start by following the standard Raven example of changing rocket launcher speed. This is handled server-side, so open up the game.xcodeproj project file in Xcode`.

Find the g_weapon.c file, where we'll be making the changes. On line 87, the Personal Rocket Launcher section of #defines begins.

Game project

Change the first #define to read:

#define ROCKET_VELOCITY             100

This should make the rocket launcher fire rockets that travel more slowly.

Hit "⌘ - B" or go to "Product -> Build For -> Running". The project should now build successfully.

TESTING IT IN-GAME


Now launch Jedi Academy MP. You should be able to easily outstrip your rockets.

If you bring up the console, the gamedate should match the day that you built the mod on.

You might have some problems starting up the game due to some of the security settings in "modbase". If you get stuck at the "Starting up..." screen in Jedi Academy MP, bring the console up and set g_maxConnPerIP to a bigger number.

Gamedate

DEBUGGING


You can debug your mod by launching Jedi Academy MP as usual, and then doing "Product -> Attach to Process -> Jedi Academy MP" in Xcode. Breakpoints that you set in Xcode will work as you'd expect.

Alternatively, you can go to "Product -> Scheme -> Edit Scheme…" and set the executable to Jedi Academy MP (or the main Jedi Academy application if using the App Store or Steam versions). This will allow you to launch the game using the "Run" command.

FINAL RELEASE


For the final release, you should build your .bundle files using "Product -> Build For -> Archive".

This article is my 10th oldest. It is 610 words long, and it’s got 0 comments for now.