Rage through 32 single player levels and 6 deathmatch levels of sheer terror and fully immersive sound and lighting. Arm yourself against the cannibalistic Ogre, fiendish Vore and indestructible Schambler using lethal nails, fierce Thunderbolts and abominable Rocket and Grenade Launchers.

Post tutorial Report RSS Setting up a simple quake mod with a new feature

Setting up a small q1 mod, then adding a simple piece of code to the grunt's pain function, which checks if the grunt's energy gets under a certain amount (1/2 of his energy in this tut). Skin changing and .mdl modifying also...

Posted by on - Intermediate Client Side Coding

[page=Requirements]
Be sure that you've got:
- The full Qme version (the shareware one doesn't want to save a model file with 20+ frames)
- Frikqcc compiler
- QuakeC sourcecode
- Grunt model
- A painskin for the model

[page=First steps]
A Standard Quake QuakeC mod directory tree looks like that:

Quake - Your Quake1 Directory

  • insert_a_name_here - your mod directory
  • | - Progs - the models directory
  • | - Sound - the sounds directory
  • | - Src - the uncompiled sourcecode directory (no need to include it in a release)
  • | - Maps - directory with your compiled maps
  • | Progs.dat - the compiled sourecode file, generated by the compiler
  • \ ... - other miscelaneous things

Set up a painskin directory inside your Quake 1 directory. Make two subdirectories inside the painskin directory: src and progs. Unpack the FrikQCC compiler and the QuakeC sourcecode into the src directory, and copy the soldier.mdl file into the progs directory.

[page=Adding a painskin to the soldier model]
In the next step, we'll add a new skin to the normal soldier model.

Start up Qme 3.0 and load the soldier.mdl file into the program.

In the upper-left corner of Qme, there should be an available skin list for the model. It should look like that:

Tutorial Image

Click with your right mouse button on the list, and import the new painskin into the model. If the new painskin will appear over the original skin, move the painskin below it. Save the file. The model's painskin will be in the slot 1, and the normal soldier's skin will be in the default slot 0.

[page=Adding the new painskin code to the soldier]
Every .qc file in the QuakeC Sourcecode is like a normal text file, just with a different extension.

Open the soldier.qc file with wordpad or notepad, and find the army_pain function - it should be somewhere in the center of the file. The army_pain function itself is called every time the monster is hurt by something, ex. the player, or an other monster. Basically its purpose is to randomise the pain animation, but it'll also check the soldier's health amount and change the skin to the damaged one in our small mod when needed.

Add this just under the r variable declaration:

if (self.health < 15) // if the grunt's health gets under 15
   self.skin = 1; // change the grunt's skin to the slot 1 skin

Close the file. Compile the code with the FrikQCC compiler (frikqcc.exe).

[page=Ending]
Make a shortcut to your Quake executable (i recommend using a modern source port, like DarkPlaces) and add "-game painskin" as a command line parameter.

Start up Quake using the shortcut, and experience the new thrilling and brutal mod you've just made for the always living classic :)

Post comment Comments
leilei
leilei - - 5,721 comments

Why not use QuakeME 2.3 instead?

Ftp.sunet.se

Reply Good karma Bad karma+2 votes
bart2o Author
bart2o - - 1,863 comments

erm... i didn't know about it :paranoid:

Reply Good karma+2 votes
CRBthedevil
CRBthedevil - - 140 comments

Great turorial XD

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: