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: Pastor
eMail: marklacroix@qtm.net
Difficulty Scale: Easy


Step 1
In this lesson we will make the nails stick into the walls. This is is made by editing the weapons.qc file, so open it up.


Step 2
Scroll down until after the launch_spike to spike_touch. Now what we have to do is take out the self.remove tag. Now when ever the nail gets to the wall,it will have hit nothing. But if you notice when it hits a monster, it just continues through to that self.remove. So we have to make it so the nail "sticks" in the body.

void() spike_touch =
{
local float rand;
        if (other == self.owner)
                return;

        if (other.solid == SOLID_TRIGGER)
                return; // trigger field, do nothing

        if (pointcontents(self.origin) == CONTENT_SKY)
        {
                remove(self);
                return;
        }
        
// hit something that bleeds
        if (other.takedamage)
        {
                spawn_touchblood (9);
                T_Damage (other, self, self.owner, 9);
                
                remove(self);   //add this so they don't float...
                return;         //add this to avoid errors
        }
        else
        {
                WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
                
                if (self.classname == "wizspike")
                        WriteByte (MSG_BROADCAST, TE_WIZSPIKE);
                else if (self.classname == "knightspike")
                        WriteByte (MSG_BROADCAST, TE_KNIGHTSPIKE);
                else
                        WriteByte (MSG_BROADCAST, TE_SPIKE);
                WriteCoord (MSG_BROADCAST, self.origin_x);
                WriteCoord (MSG_BROADCAST, self.origin_y);
                WriteCoord (MSG_BROADCAST, self.origin_z);
        }

        self.velocity = '0 0 0';        //add this, it makes the nail stop

        self.nextthink = time + 10;     //add this, to prevent packet overflows
        self.think = SUB_Remove;        //add this for same reason as above

};


Step 3
And that's it! Pretty easy, eh? Compile it, and load it up the usual way. The only problem is that when you shoot a door and open it, the nails still float. But it is kinda cool to then shut the door and listen to 'em bounce around inside :) This bug is fixable, but it's much more complicated than this alone, maybe a later lesson...






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.