Setup ioquake3 mod workspace in XCode 3.2

Since I am new to all this mod stuff I thought I better write down how I did. I am using Xcode 3.2.4 and r2202 of the ioquake3 source code. For compiling I use the ioquake make-macosx.sh script. Lets get started:

  1. Checkout source code:
    svn://svn.icculus.org/quake3/trunk ioquake
  2. Build the code:
    ./make-macosx.sh
  3. Run ioquake to see that everything is working:
    ./build/release-darwin-x86_64/ioquake3.x86_64
  4. Now I create a copy of the build/release-darwin-x86_64 folder in the build folder. I name it release-macosx. It is in here that we will test our mod (the release-darwin-x86_64 folder is always deleted before compiling so all our .pk3 files will be deleted when we build and that is why I make a copy)
  5. Take the pak0.pk3 file from the Quake III Arena CD and put it in build/release-macosx/baseq3/
  6. Download the latest point release (1.32b) .pak3 files for baseq3 and missionpack and add them to build/release-macosx/. These can be found here: http://www.quakeiii.nl/files/ (and other places)
  7. Create a folder in release-osx to hold our mod e.g
    mkdir build/release-osx/MyMod
  8. Now we will make a small script that will copy the game files from the compilation folder (where make-macosx.sh puts them) and to our mod folder:
     
    #!/bin/sh
    
    #Filename: copy.sh
    
    cp build/release-darwin-x86_64/baseq3/cgamex86_64.dylib build/release-osx/MyMod/
    cp build/release-darwin-x86_64/baseq3/qagamex86_64.dylib build/release-osx/MyMod/
    cp build/release-darwin-x86_64/baseq3/uix86_64.dylib build/release-osx/MyMod/
    
  9. If you want to make your own maps also create a maps folder:
    mkdir build/release-osx/MyMod/maps

    This is the place where the q3 engine will look for .bsp maps

  10. Now it is time to fire up XCode – start with creating a new project with template: “Mac OX S/Other/External Build System”
  11. Now right click on your project (in the left tree view) and choose “Add/Existing Files…”
  12. Navigate to the “code” folder (ioquake/code), select all folders and click “Add”. We have now added all the source code – time to create a build target
  13. Right click “Targets” (left tree view) and choose “Add/New Target”. Select “Mac OS X/Other/Shell script target”. Give the target a name and click “Finish”
  14. Right click “Run script” (targets/targetname/Run script in left tree view). Choose “Get info”. In the General tab under “Script” add:
    ./make-macosx.sh
    ./copy.sh 
    
  15. Now to run the game I made a small script called run.sh:
    #!/bin/sh
    build/release-osx/ioquake3.x86_64 +set sv_pure 0 +set vm_cgame 0 +set vm_game 0 +set vm_ui 0 +set fs_game MyMod +map q3dm1
    

    This will run our mod MyMod with the map q3dm1

  16. Now you are done! Start modding and when you want to compile just hit “Build” from the “Build” menu (output from the script will automatically turn up in XCodes “Build results” window). To run the game just type ./run.sh in the terminal
  1. Thanks for the post Niklas (really helped me out). After getting myself setup using your blog post I was trying to test out a really simple mod – changing the speed of rockets (http://wiki.ioquake3.org/Hello,_Qworld) however whenever I compile the code and run the binary the game is unchanged.

    Did you have much luck with writing your own mods? Could you share any tips on what modifications you made?

    • Hi muzzy1,

      Yes I have made the same modifications as you and it worked for me. Are you sure the files are copied into the MyMod directory after compilation? Is the rights correct on the MyMod folder?

  2. I had the same problem as Muz.
    As long as I didn’t tell ioquake to use shared libraries instead of QVMs!

    Just start ioquake with
    build/release-osx/ioquake3.x86_64 +set sv_pure 0 +set vm_cgame 0 +set vm_game 0 +set vm_ui 0 +set fs_game MyMod +map q3dm1

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>