Code3Arena

PlanetQuake | Code3Arena | Tutorials | Tutorial 1

menu

  • Home/News
  • ModSource
  • Compiling
  • Help!!!
  • Submission
  • Contributors
  • Staff
  • Downloads

    Tutorials
    < Index >
    1. Mod making 101
    2. Up 'n running
    3. Hello, QWorld!
    4. Infinite Haste
    5. Armor Piercing Rails
    6. Bouncing Rockets
    7. Cloaking
    8. Ladders
    9. Favourite Server
    10. Flame Thrower
    11. Vortex Grenades
    12. Grapple
    13. Lightning Discharge
    14. Locational Damage
    15. Leg Shots
    16. Weapon Switching
    17. Scoreboard frag-rate
    18. Vortex Grenades II
    19. Vulnerable Missiles
    20. Creating Classes
    21. Scrolling Credits
    22. Weapon Dropping
    23. Anti-Gravity Boots
    24. HUD scoreboard
    25. Flashlight and laser
    26. Weapon Positioning
    27. Weapon Reloading
    28. Progressive Zooming
    29. Rotating Doors
    30. Beheading (headshot!)
    31. Alt Weapon Fire
    32. Popup Menus I
    33. Popup Menus II
    34. Cluster Grenades
    35. Homing Rockets
    36. Spreadfire Powerup
    37. Instagib gameplay
    38. Accelerating rockets
    39. Server only Instagib
    40. Advanced Grapple Hook
    41. Unlagging your mod


    Articles
    < Index >
    1. Entities
    2. Vectors
    3. Good Coding
    4. Compilers I
    5. Compilers II
    6. UI Menu Primer I
    7. UI Menu Primer II
    8. UI Menu Primer III
    9. QVM Communication, Cvars, commands
    10. Metrowerks CodeWarrior
    11. 1.27g code, bugs, batch


    Links

  • Quake3 Files
  • Quake3 Forums
  • Q3A Editing Message Board
  • Quake3 Editing


    Feedback

  • SumFuka
  • Calrathan
  • HypoThermia
  • WarZone





    Site Design by:
    ICEmosis Design


  •  
    Code3Arena Tutorials

    Welcome to the tutorials section. Here you'll find an ever-increasing collection of step-by-step tutorials showing you how to do all sorts of weird and wonderful things with quake3.

    We've written these tutorials assuming that you're new to quake3 coding. We recommend that you start at the first tutorial (the first 5 or so are easier than the rest) and code each one for yourself. The best way to learn about quake3 coding is by browsing the code and making the changes yourself. After you've done all the tutorials you should be ready to code your own mod !

    The tutorials here have been contributed by both the staff at planetquake and people from all over the quake community. (Thanks to everyone who has contributed !) If you have a great tutorial idea yourself, why not send it in ? Check out our submission page for how to do this.

    If you spot an error in a tutorial, please email the author directly. If you have questions regarding quake coding (or getting your compiler to work or similar problems), PLEASE read our Help!!! page first.

    Below you'll find a description of each tutorial. Good luck, have fun and remember - "West si-ide".

    Tutorial#1: "Mod making 101" by SumFuka

    Welcomes you to mod making. Gets the motivation going for writing your own, starting with that all important good idea. Includes a reminder to eat and bathe occasionally - by the author of Rail Arena.
     

    Tutorial#2: "Up 'n running" by SumFuka

    Covers all you need to do to use Microsoft Visual C++ for building and modifying the Quake3 source. Covers where the DLLs' will compile too; and how to build the bytecode for the virtual machine.
     

    Tutorial#3: "Hello, Qworld!" by SumFuka

    First test of your compiler. Creates the "slow rocket" modification described in the source release notes. Don't forget to remove it afterwards!
     

    Tutorial#4: "Permanent haste" by SumFuka

    Quake 3 on speed! Another quick modification that makes every player and bot run as if they had the haste rune. Searches through the source code to find references.
     

    Tutorial#5: "Armor piercing rails" by SumFuka

    Give Xaero hell! Changes the source code so the railgun goes through walls. A working example of how to use vectors.
     

    Tutorial#6: "Bouncing rockets" by AssKicka

    Shoot yourself in the back! Introduces a new console command for enabling/disabling bouncing rockets. Shows how to use an existing feature of the code rather than writing it yourself.
     

    Tutorial#7: "Cloaking" by AssKicka

    Adds another console command for a cloak device that decreases health when used. An excellent example of "consequences"; or how to make sure the changes you make don't "break" the game.
     

    Tutorial#8: "Ladders!" by Calrathan

    Replaced by jump pads, you can now put vertical ladders back in. Uses friction to hold you in place, and covers the simple map changes required to activate the code. A good introduction to movement modifications. There's also a strong reminder that both client and server need to be in sync.
     

    Tutorial#9: "Saving your favourite server" by HypoThermia

    A quick delve into the menu user interface and the built in server browser. After helping you understand the browser code, it adds a button that allows you to add a favourite server without connecting. Along the way we'll fix a bug in the browser code.
     

    Tutorial#10: "Flame Thrower" by AssKicka

    A big tutorial - not for the faint hearted! Covers what you do to add a new weapon into the game. In this case it's the flamethrower from AssKicka's SolidGround mod. Lots to do here: referring to shaders, models, and graphics in the source code.
     

    Tutorial#11: "Vortex Grenades" by AssKicka

    These vortex grenades will suck in a nearby player and then explode. There's some nice vector use here (in a useful function called G_Suck). You could easily modify this function for other uses and call it G_Blow (eheh). And a handy findradius function is in this one too.

    Tutorial#12: "Grapple" by Matt Ownby

    The grapple was actually coded into q3 but they chose to disable it before releasing the game. No worries, Matt Ownby has managed to unleash it. Works fine in ctf too.

    Tutorial#13: "Lightning Discharge" by The SARACEN

    For the nostalgic quake players out there, relive those quake1 dm3 discharge moments. This one defines a new lightning discharge 'event' and 'meansOfDeath' and shows how the game and cgame qvm's work together.

    Tutorial#14: "Locational Damage" by Calrathan

    This is an advanced locational damage implemention - not only does damage vary according to the height you hit them (above shoulders, body, legs etc) but direction is important too - a frontal face shot does a whopping 5.0x damage. Nice use of vectors for determining 'where did the shot come from ?'.

    Tutorial#15: "Leg Shots" by McBain

    A follow-on from a locational damage tutorial, this one slows down a player when the are shot in the leg. A player regains their speed by dying (Duh!) or grabbing a health pack.

    Tutorial#16: "Weapon Switching" by WarZone

    This is a very useful tutorial that should be standard for all new mods - it allows a player to define an intelligent weapon switching order. Each player in a game can have their own ordering (which is displayed when each level loads). Get to know all the functions for switching next/prev weapon, running out of ammo, picking up weapons etc.

    Tutorial#17: "Scoreboard frag-rate" by HypoThermia

    An adaptation of the scoreboard so you can see your frag-rate. Allows a fairer comparison when you join a match part the way through.

    Tutorial#18: "Vortex Grenades II" by TeknoDragon

    An extension to the Vortex Grenades tutorial. Grenades now accelerate the player. There is an emphasis on improvements and tweaks to the original tutorial.

    Tutorial#19: "Vulnerable Missiles" by Lancer

    Fed up of being a missile magnet? Become the Riviera Kid and hold your own by shooting them down. Inspired on an old Q2 QDevels tutorial, it's been updated to Q3 by Lancer!

    Tutorial#20: "Creating Classes" by Fritz

    An article that shows just how simple it is to get classes code up and running! Includes a mini example with railgun, BFG, and lightning classes based on chosen model.

    Tutorial#21: "Scrolling Credits" by Iain McGinniss

    Complete your mod with a cinematic quality scrolling credits list. A total replacement for the original static Id credits page, including full source for download.

    Tutorial#22: "Weapon Dropping" by [SuB]paranoid

    An old favourite that greatly enhances teamplay. Don't know why it was missing from Quake 3, but now you can put it back in!

    Tutorial#23: "Anti-Gravity Boots" by Burning

    A neat little tutorial that'll make you feel like you're walking on the moon. You may want to extend this in your mod by adding s/fx and power drain.

    Tutorial#24: "HUD scoreboard" by HeffX

    Puts a useful scoreboard in the HUD display... so you don't have to stop fragging to see how you're doing!

    You can use this as a basis for any scoreboard related information that you want to display on the HUD. The size of the HUD scoreboard flips to a smaller font when there are a large number of players.

    Tutorial#25: "Flashlight and laser" by Drive C:

    Shows how to add a flashlight and laser aiming dot into Quake 3. Conceptually each item has behaviour that differs only in the way it's drawn on screen, and this tutorial shows how strongly related ideas can (and should!) use the same code.

    Tutorial#26: "Weapon Positioning" by Carnage

    A sweet tutorial for left, right, or central weapon positioning. While the old Q2 weapon positioning affected aiming, this effect has gone with Q3A's accurate reticule. You can now put visual weapon positioning back in and go on a nostalgia trip!

    Tutorial#27: "Weapon Reloading" by Drive C:

    Those of you that want a touch of realism, the need to prepare for combat, or the terror of finding you're unable to fire for a few moments, will want to add this to your mods.

    Almost exclusively a server side mod, there's also a simple little HUD modificaiton that adds data on clip information.

    Tutorial#28: "Progressive Zooming" by Kilderean

    A sweet little client side tutorial that replaces the standard Q3 zoom mode with a smooth zoom in, in the same style as Unreal Tournament.

    You can use this tutorial as the basis for a sniper rifle, or just to improve the existing zoom mode.

    Tutorial#29: "Rotating Doors" by Valkyrie

    The only kind of doors you've been able to use in Q3 so far were sliding Star Trek ones - until now!

    Realism mods and original projects can make good use of rotating doors, just take a look at Half Life. All mod coders should implement this rotating door code: independent map makers can then use this kind of door if they want. Although the modifications to the source code are extensive, they're all localized into a few files and large chunks of code, rather than lots of fiddly changes all over the place.

    Included in the tutorial is a link to a test map and map source, so you don't have to fiddle around with Q3Radiant to test the code.

    Tutorial#30: "Beheading (headshot!)" by Kilderean

    This tutorial covers the nasty business of removing the head part of the player model. Continuing on the Unreal Tournament theme, it wraps this up into an implementation of the "headshot!" kill, using the railgun.

    The blood thirsty amongst you are going to love this!

    Tutorial#31: "Alt Weapon Fire" by HypoThermia

    This tutorial provides a skeletal framework for adding an alternative fire mode for weapons. It gives you the same advantages that existing weapons have: instant starting up of animation in the client, server side damage and effects, and access to the prediction code in bg_pmove.c.

    There's also some info on how to test your mod on a server if you don't have a network, or access to an Internet server. Finally, there's a simple test to show you what the problem was in the first place.

    Tutorial#32: "Popup Menus I" by HypoThermia

    Ever wanted to add a simple dynamic menu system to your mod? This code gives you the framework for a popup menu system that works in-game. The menu pops up on a simple key bind, and allows you to structure related commands in recursive sub-menus.

    Tutorial#33: "Popup Menus II" by HypoThermia

    The framework in part I needs a working example to flesh it out. This adds a full bot command menu system, for use in Team DM or CTF games. There are also some helper functions that get you access to information usually under the control of the server.

    Tutorial#34: "Cluster Grenades" by Chris Hilton

    Beef up the grenade launcher with a rather nasty area effect: grenade fragments that explode on contact! Inspired by the tutorial at QDevels, this is part of the MaxCarnage mini-mod provided by Chris for the benefit of all.

    Tutorial#35: "Homing Rockets" by Chris Hilton

    Watch your enemies *squirm* as they try and evade these missiles! More code from the MaxCarnage mini-mod donated by Chris to Code3Arena.

    Tutorial#36: "Spreadfire Powerup" by Hal9000

    Enhance the strength of the weapons in your mod with a powerup that triples the number of shots! Taken from SmashV2 mod donated to C3A by Hal9000.

    Tutorial#37: "Instagib gameplay" by Malcolm Lim

    Include the railgun Instagib gameplay into your code. Includes hiding of items, and how to keep bots moving around the map.

    Tutorial#38: "Accelerating rockets" by Doug Hammond

    Extend the available entity movement types with this nifty tutorial. There's a detailed discussion of the do's and dont's in creating a new type, as well as an example of a first version that didn't work as expected.

    Tutorial#39: "Server only Instagib" by Steven Conway

    Another take on the Instigib game type, this moves all the code changes into the server. It touches the AI code changes needed to keep the bots moving around the map, and enables RailCTF play too.

    Tutorial#40: "Advanced Grapple Hook" by Kilderean

    Make your grapple do more for your mod, taken from the Q2 inspired PureCTF ModSource code. This tutorial shows how to optionally enable the grapple, implement a fast mode, fix some problems with jump pad prediction, and enable bot usage.

    Tutorial#41: "Unlagging your Mod" by Neil "haste" Toronto

    When you're done adding this code to your mod you'll find all players will have a level playing field with hitscan weapons. It removes one of the biggest issues between high and low ping players.

    The meat of the tutorial covers the difficulties introduced by timedelays between the client and server - the bane of HPB's everywhere. It's well written and very accessible: you'll have a clearer understanding of code and issues that usually leave big headaches.