Remove this ad


Posts: 19

Site Admin


Mar 12 12 3:54 PM

Tags : :

This tutorial was created by jukki

hello everyone. Wana learn to code like a pro. Wana make a small mod. Wna have unlimited ammo, god mode, etc. wana make better quake. well you gotta learn code first. Here i will tell you basics about qc quake coding.

first what you need is qc source, quake, text editor (notepad works but i like to use qcide) complier (if you use qcide it has built in complier) and some knowledge.

progs.dat source
quake(not giving link because you must have full version to run mods, shareware doenst work)
complier FTEQCC
FRIKQCC (your call i prefer frik)
knowledge (can that be downloaded?

ok you got your files. Lets startwhat is what.
// is comment. If you add this everyhting after it in that line will be passed and not added to code when complied. It is very good because you can tell other coders what happens in that code

if //statment. It checks if (something is something etc) and callse function under it
else //if statement above is not right it will call function under it
else if// basicaly both of the aboove merged together. now if statement is no right it caheck if else is right and calls the fnction

void //is a function
float and .float// is a variable. difference betwen float and .float is that float is for all and .float is for single entity
vector is basicaly 3 variables in one variable mostly used for cordinants
self is the entity that 'owns' the function
other is someone else in unction (like in touch function other is the one who touched self)

local float/vector/entity is a variable/entity that is precentet only in that function.

(in if statement)
== is equal to
!= is not equal to
&& and (can be used ike this if (self.ammo == 5 && self.weapon != IT_SHOTGUN))
|| or (can be used ike this if (self.ammo == 5 || self.weapon != IT_SHOTGUN) nowit check if any of thouse variables is correct)
> is greater than
< is lower than
>= is greater or equal
<= is ower or equal

Here is a function. You are doing them all the time

void (float super) awesome_code =
{//(remeber to put thease under void)
local .float fire_times;
if (self.ammo < 10)
{// (NOTE USE TABUATOR FOR THEASE THINGS. easier to see code) {} will have function inside them self
self.fire_times = 10 - self.ammo; // this gives fire times a value and it is 10 - self.ammo mening how many shots you have fired
if (self.fire_times <= 5) //if firetimes is lower than 6
centerprint (self, "WARNING. half ammo remaining); // this function prints a mesage to your screen
}//end of this function

so yeh. (btw dont copy paste that it doesnt work. it is just example)
now if we add that code to one of our files something have to call it

if you add this code to function
awesome_code();//calls awesome_code function

now it would call it.

homework. try to make center print

BUT HEY. if we save the code it wont do nothing to quake O.o
lets complie it. if you are using qcide just press ctrl + F7
if you are not using it then grab the complier you downloaded to same folder where all your source files are. now run it. If ou idnt do anything tocode yet it should complie without problems.just make sure it in same folder ass progs.src file

did it complie if yes good. now go to folder where ou placed source folder. you notice that there is a new file, progs.dat. take it and using pakexplorer (google) place and owerwrite progs.dat in pak0 with your progs.dat

done launch quake and enjoy XD
Quote    Reply   
Remove this ad
Remove this ad
Add Reply

Quick Reply

bbcode help