[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - Bullets and muzzleflash question

Bullets and muzzleflash question

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Bullets and muzzleflash question

Postby Freemanoid » Tue Jan 26, 2010 8:57 am

Hello everybody. I am trying to make realistic bullet firing and muzzleflash for it. But I have 2 problems :
1) Bullets fly very slowly. (I am modifying launch_spike function)
Here it is, check where I can be wrong :
void(vector org, vector dir) launch_spike =
{
newmis = spawn ();
newmis.owner = self;
newmis.movetype = MOVETYPE_FLYMISSILE;
newmis.solid = SOLID_BBOX;

newmis.angles = vectoangles(dir);

newmis.touch = spike_touch;
newmis.classname = "spike";
newmis.think = SUB_Remove;
newmis.nextthink = time + 6;
setmodel (newmis, "progs/bullet.mdl");
setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);
setorigin (newmis, org);

newmis.velocity = dir * 1000000;
};
Here I just tried to set up more speed, and then :
void(float ox) W_FireSpikes =
{
local vector dir;
local entity old;
local float spreadx, spready, bulletspd;
spreadx = 0.04;
spready = 0.04;

makevectors (self.v_angle);

if (self.ammo_nails >= 2 && self.weapon == IT_SUPER_NAILGUN)
{
W_FireSuperSpikes ();
return;
}

if (self.ammo_nails < 1)
{
self.weapon = W_BestWeapon ();
W_SetCurrentAmmo ();
return;
}

sound (self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM);
self.attack_finished = time + 0.2;
self.currentammo = self.ammo_nails = self.ammo_nails - 1;
//dir = aim (self, 1000); //OLD dir
bulletspd = 700000;
dir = (v_forward + crandom()*spreadx*v_right + crandom()*spready*v_up) * 1000000000000000000000;
launch_spike (self.origin + '0 0 17' + v_right*7 + v_forward * 20, dir*bulletspd);
launch_muzzle (self.origin + '0 0 17' + v_right*7 + v_forward * 40, dir*0);

self.punchangle_x = -2;
};
Here I tried to set up more speed too. But (for bullets) it moving very slowly.

Image

2) I have muzzleflash, And there is some problems with it.
When I starting to shoot, my muzzleflash become very big. (Sprite is about 24x24 pixels)
And if I set up "Full lighting" in darkplaces, its not always appear.
For example, if I shoot 10 times, I see muzzleflash only 2-3.
Here is my qc of it :
void(vector org, vector dir) launch_muzzle =
{
newmis = spawn ();
newmis.owner = self;
newmis.movetype = MOVETYPE_NONE;
newmis.solid = SOLID_BBOX;

newmis.angles = vectoangles(dir);

newmis.classname = "muzzle";
newmis.think = SUB_Remove;
newmis.nextthink = time + 0.01;
setmodel (newmis, "progs/muzzle.spr");
setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);
setorigin (newmis, org);
newmis.velocity = dir * 0;
};

Image
(On image I just paste muzzle sprite in picture, because in-game I cannot catch it)

(Sorry for my english)
^O,..,o^
Freemanoid
 
Posts: 52
Joined: Mon Jun 16, 2008 11:25 am
Location: BELARUS

Postby c0burn » Tue Jan 26, 2010 9:15 am

You'll need to modify one of the cvars for maximum speed allowed for entities. I think it's sv_maxvelocity or something similar. Regarding your muzzleflash, I have some code at home that I will put up here later that should do the job.
c0burn
 
Posts: 208
Joined: Fri Nov 05, 2004 12:48 pm
Location: Liverpool, England

Postby r00k » Tue Jan 26, 2010 11:02 am

r00k
 
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Postby MauveBib » Tue Jan 26, 2010 9:31 pm

Apathy Now!
User avatar
MauveBib
 
Posts: 634
Joined: Thu Nov 04, 2004 1:22 am

Postby r00k » Wed Jan 27, 2010 5:16 am

r00k
 
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Postby Freemanoid » Wed Jan 27, 2010 9:39 am

Thanks! Sv_maxvelocity really makes different speed! Now it works! what about muzzleflash? Any ideas?
^O,..,o^
Freemanoid
 
Posts: 52
Joined: Mon Jun 16, 2008 11:25 am
Location: BELARUS

Postby c0burn » Wed Jan 27, 2010 8:46 pm

c0burn
 
Posts: 208
Joined: Fri Nov 05, 2004 12:48 pm
Location: Liverpool, England

Postby Chip » Wed Jan 27, 2010 9:28 pm





Fear not the dark, but what the dark hides.
User avatar
Chip
 
Posts: 575
Joined: Wed Jan 21, 2009 9:12 am
Location: Dublin, Ireland

Postby Sajt » Wed Jan 27, 2010 10:19 pm

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 Freemanoid » Wed Jan 27, 2010 11:33 pm

^O,..,o^
Freemanoid
 
Posts: 52
Joined: Mon Jun 16, 2008 11:25 am
Location: BELARUS


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest