Inside3D tutorials.

Inside3D
 • Front Page
 • Articles
 • Downloads
 • Forums
 • Hosting
 • Help Wanted
 • Interviews
 • Reviews
 • Staff

 
Allied Sites
 - AI Cafe
 - Bot Epidemic
 - Dark Places
 - Flat Earth
 - FrikBot
 - Ghoulish Art
 - Kilbert3D
 - Quake Info Pool
 - QSG: Quake Standards
 - Rusted Fork
 - Stroggs Gone Mad
 - More...
 
Quake
 - Getting Started
 - QuakeC Specs v1.0
 - QuakeC Tutorials
 - Quake Mod Index
 
Quake II
 - Getting Started
 - dll Sourcecode
 - Coding Tutorials
 
.dll Central
 - Getting Started
 - Learning
 - dll Primer
 - dll in C
 - dll in Delphi
 - Compilers
 
Jedi Knight
 - Getting Started
 - COG Specs
 - Sound Specs
 - Tutorials
 
Level Editing
 - Tutorials/Tips
 
 
Telefragged!!!
Created By: ShockMan
eMail: qfiles@quakemania.com
Difficulty Scale: Medium-Hard


Step 1
Ok.. in this tutorial we are gonna make a Poison Axe... Thanx to the guy's that did TF, for the idea, but NOT for the code... this is totaly my own code... but thanx anyways...

First open up weapons.qc, search for the W_FireAxe function and replace it with this:

void() W_FireAxe =
{
    local   vector  source;
    local   vector  org;

    source = self.origin + '0 0 16';
    traceline (source, source + v_forward*64, FALSE, self);
    if (trace_fraction == 1.0)
        return;
        
    org = trace_endpos - v_forward*4;

    if (trace_ent.takedamage)
    {
        trace_ent.axhitme = 1;
        GetPoisoned(trace_ent);            // I added this...
        SpawnBlood (org, '0 0 0', 20);
        T_Damage (trace_ent, self, self, 10); // changed the last number to 10
                                              // instead of 20 to make the axe 
                                              // not do so much damage...
    }
    else
    { // hit wall
        sound (self, CHAN_WEAPON, "player/axhit2.wav", 1, ATTN_NORM);
        WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
        WriteByte (MSG_BROADCAST, TE_GUNSHOT);
        WriteCoord (MSG_BROADCAST, org_x);
        WriteCoord (MSG_BROADCAST, org_y);
        WriteCoord (MSG_BROADCAST, org_z);
    }
};


Step 2
Now add this code before the W_FireAxe function:
void() OnPoisonThink =
{
    if (self.waterlevel >= 2) // if you get to water it stops
    {
        remove(self);
        return;
    }
    T_Damage (self.owner, self, self, 5); // do damage
    self.nextthink = time + 1; 
};      

void(entity ent) GetPoisoned =
{
    local   entity poison;

    poison = spawn (); 
    poison.owner = ent; 
    poison.movetype = MOVETYPE_NONE;
    poison.solid = SOLID_NOT;
        
    setmodel (poison, "");
    setsize (poison, '0 0 0', '0 0 0');             
    setorigin (poison, '0 0 0');
        
    poison.nextthink = time + 1;
    poison.think = OnPoisonThink;
};


Step 3
Now it shall war both in multiplayer and in single :)






The Inside3D content and design is copyrighted by the Inside3D team, and may not be re-produced or copied without proper consent. All rights reserved. Any work credited to any author not part of InsideQC is copyrighted by that author. If you have any feedback, suggestions or flames please send it in to the author. Inside3D is hosted by telefragged and the design was originated by project-9.