Inside3D!
     

MUzzleflash

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
Stealth Kill



Joined: 29 Dec 2006
Posts: 83

PostPosted: Thu Nov 22, 2007 8:28 pm    Post subject: MUzzleflash Reply with quote

Are there any Muzzleflash codes?
I had one for 3rd person view (chasecam) from the darplaces mod but i lost it Sad

i need one for fps view to.




Add this to weapons.qc
Code:

void() MuzzleFlash =
{
   local vector vec;
   local vector org;
   vec = normalize(vec);
   makevectors(self.angles);
   org = self.angles;
   muzzle = spawn();
   muzzle.movetype = MOVETYPE_NONE;
   setmodel(muzzle, "progs/s_muzzle.spr");
   makevectors(self.v_angle);
   muzzle.solid = SOLID_NOT;
   muzzle.effects = EF_MUZZLEFLASH;
   setsize(muzzle, VEC_ORIGIN, VEC_ORIGIN);
   if (self.weapon == IT_SUPER_SHOTGUN)
   {
      setorigin(muzzle, self.origin + v_forward * 20 + '0 0 20' + v_right);
   }
   else
   {
      if (self.weapon == IT_SUPER_NAILGUN)
      {
         setorigin(muzzle, self.origin + v_forward * 20 + '0 0 20' + v_right * CONTENT_WATER);
      }
      else
      {
         setorigin(muzzle, self.origin + v_forward * 20 + '0 0 20' + v_right);
      }
   }
   muzzle.nextthink = time + 0.04;
   muzzle.think = SUB_Remove;
};

[/code]
Back to top
View user's profile Send private message
Chip



Joined: 21 Jan 2009
Posts: 314
Location: Romania

PostPosted: Wed Sep 09, 2009 2:23 pm    Post subject: Muzzleflash? Reply with quote

I did not want to start a new thread if this one existed already.

I'm try to activate the muzzleflash for weapons, and I dug deep into the DP code, but to no avail. I cannot make the muzzleflash to work. Where could I find a tutorial about creating some muzzleflash effects, or how should I go about implementing it in DP?

I would appreciate any answer.

LE: By muzzleflash I mean a powerful flash of light in front of the weapon. I am clarifying this as I found some references to lighting the area when shooting. I would like a graphical sprite or whatever (I guess I can replace a .spr file with a transparent .png.
_________________
My Projects: Quake 1 Mods | OpenQuartz 2 | ChipQuake
Back to top
View user's profile Send private message Visit poster's website
ceriux



Joined: 06 Sep 2008
Posts: 969
Location: Florida, USA

PostPosted: Wed Sep 09, 2009 2:38 pm    Post subject: Reply with quote

maybe look at the shell ejection code? it spawns something like a model (which should also be able to spawn sprites) then it falls or flys away or what ever. maybe alter that code to just project the sprite file then disappear.
_________________
QuakeDB - Quake ModDB Group
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group