Forum

Bullehole tutorial????

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Bullehole tutorial????

Postby Stealth Kill » Sun May 27, 2007 9:03 am

There are lots of tutorials but i can´t find a Bullehole tutorial.

Where can i find one?
Stealth Kill
 
Posts: 83
Joined: Fri Dec 29, 2006 12:34 pm

Postby FrikaC » Sun May 27, 2007 6:05 pm

Hrm. No one has ever written one apparently (I looked over on both MDQNet and QCX's tutorial lists, didn't check AI Cafe, but that's not exactly Coffee's main forte, so I doubt he'd have one).
FrikaC
Site Admin
 
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Postby leileilol » Sun May 27, 2007 7:10 pm

TomazMod had bulletholes. Hipnotic had bulletholes too, but they sucked.

XWAR also had bullet holes, but its decal system qc looks like decompiled code (hrm)
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby Sajt » Sun May 27, 2007 9:01 pm

Hehe... xwar.

Didn't finalquake-real have bulletholes, at least on the railgun? They were a little crappy though...

edit: Durr.. speaking of fqreal, Cheapy can you hit me up with that too? I love you.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby leileilol » Sun May 27, 2007 10:01 pm

http://mancubus.net/~cheapy/lostmods/2000/fqreal.zip

They did have QC code available but i lost it :/
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby Boss429 » Mon May 28, 2007 6:41 am

DarkPlaces has bullet holes. Does anybody know how to change the texture of them though?
Boss429
 
Posts: 39
Joined: Sun Dec 03, 2006 7:29 pm

Postby leileilol » Mon May 28, 2007 8:46 am

particlefont.tga
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby Stealth Kill » Mon May 28, 2007 11:25 am

Hmmmm I´m trying to modifie the bloodsplat on wall tut.
Stealth Kill
 
Posts: 83
Joined: Fri Dec 29, 2006 12:34 pm

Postby Dr. Shadowborg » Mon May 28, 2007 5:23 pm

The main things to keep in mind:

1. Keep track of how many you actually have. This way, you can remove the oldest ones and not get packet overflows / edict death.

2. Use traceline's trace_plane_normal to properly align your bullethole sprite's angles along the wall. This is actually quite easy if you're using just hitscan weapons, somewhat less easy (but still easy) when using projectiles.

I might put up my finalized rebovec function later if you really, really need it. (It's configured so that you can get a decent ricochet angle or just the trace_plane_normal)
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1110
Joined: Sat Oct 16, 2004 3:34 pm

Postby redrum » Tue Nov 13, 2007 4:55 am

Stealth, did u ever get the bulletholes to work?
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
User avatar
redrum
 
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Postby Nash » Tue Nov 13, 2007 1:01 pm

It's a pity that it's not possible to do true clipped decals like in Half-Life for example.

All of the "decal" QC mods I've seen so far look cheap (cheaplol) because they don't wrap around the world's surface.
User avatar
Nash
 
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia

Postby leileilol » Tue Nov 13, 2007 1:14 pm

do you have any idea how hard that is
i should not be here
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby Spike » Tue Nov 13, 2007 4:38 pm

leileilol wrote:do you have any idea how hard that is

Yeah, what you do, is you take a copy of the world. And you get 6 planes forming a bounding box. Gradually, you clip away every single surface in the entire world from this bounding box. Then, for each point in the resulting clipped triangle mesh, you assign an alpha value based on its distance from the original surface place, and you assign texture coords based on its relative distance along/up the original plane. You then have a clipped away triangle mesh which looks pretty. Obviously the front and back places of your bounding box are copies of the original surface place, just moved a bit further forwards/back. The side/up planes are also fun to calculate, so you generally need a rotation around the original plane too. Of course, this is an expensive operation, so you really do need to cache the results.

Oh wait... You wanted it in QC.

That's a whole 'nother story then!
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Stealth Kill » Tue Dec 18, 2007 9:46 pm

I have decompiled the fqreal progs.dat and here is my tutorial vor bullet holes.



Download this bullet.qc
http://www.file-upload.net/download-563 ... et.qc.html


And this for the bullet hole sprites
http://mancubus.net/~cheapy/lostmods/2000/fqreal.zip


Add this to defs.qc

Code: Select all
entity nullentity;  // system
entity bulletholes;  // system
entity lastbullet;  // system
float numbulletholes;  // system
entity rocketmarks;  // system
entity lastmark;  // system
float numrocketmarks;  // system
.entity lastvictim;



And in Weapons.qc replace your firebullets function with this one


Code: Select all
================
FireBullets

Used by shotgun, super shotgun, and enemy soldier firing
Go to the trouble of combining multiple pellets into a single damage call.
================
*/
void(float shotcount, vector dir, vector spread) FireBullets =
{
   local float r;
   local vector direction;
   local vector src;
   local float bullet;
   bullet = 0;
   makevectors(self.v_angle);
   src = self.origin + v_forward * MOVETYPE_BOUNCE;
   src_z = self.absmin_z + self.size_z * 0.7;
   ClearMultiDamage();
   while (shotcount > 0)
   {
      direction = dir + crandom() * spread_x * v_right + crandom() * spread_y * v_up;
      traceline(src, src + direction * FL_WATERJUMP, 0, self);
      if (trace_fraction != 1)
      {
         TraceAttack(MOVETYPE_STEP, direction);
      }
      if (!bullet && trace_ent == world)
      {
         r = random();
         if (r < 0.33)
         {
            sound(trace_ent, CHAN_AUTO, "weapons/ric2.wav", 1, ATTN_NORM);
         }
         else
         {
            if (r < 0.66)
            {
               sound(trace_ent, CHAN_AUTO, "weapons/ric1.wav", 1, ATTN_NORM);
            }
            else
            {
               sound(trace_ent, CHAN_AUTO, "weapons/ric3.wav", 1, ATTN_NORM);
            }
         }
         placebullethole(trace_endpos);
         bullet = 1;
      }
      shotcount = shotcount - 1;
   }
   ApplyMultiDamage();


/*
        bprint (trace_ent.classname);
        bprint (".state = ");
        bprint (ftos (trace_ent.state));
        bprint ("\n");
*/
};

/*



my firebullets function is only for shotgun bulletholes you can make it yourself for rocktmarks.

here is the full decompiled weapons.qc from Final Quake Real



http://www.file-upload.net/download-563 ... ns.qc.html
Stealth Kill
 
Posts: 83
Joined: Fri Dec 29, 2006 12:34 pm

Postby redrum » Wed Dec 19, 2007 3:45 am

Need the PlaceBullethole(); function.
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
User avatar
redrum
 
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Next

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest