Jump to content

Home

Weapon Ammo


alexx860

Recommended Posts

OK, the weap no longer take ammo when firing, but how much ammo must I set ?

	client->ps.stats[sTAT_WEAPONS] |= (1 << WP_BOWCASTER); 
client->ps.stats[sTAT_WEAPONS] |= (1 << WP_DISRUPTOR);
client->ps.weapon = WP_BOWCASTER;
client->ps.ammo[AMMO_POWERCELL] = -1;

 

with -1, there is no ammo counter at all, but I can't select weapon (because there are out of ammo, for the game)

so where can I change when a weapon is "out of ammo", and disable it for my two weaps

 

thx in advance

alexx

Link to comment
Share on other sites

I was able to obtain this by the change I mentioned in bg_weapons, but I also have a client compile. Try compiling client.

 

Yeah, that sucks if you're trying to go serverside only mod, I know. But, it works.

 

Just to test it, I removed my mods cgame, and the weapons sure enough are back to 999, and not -- in the ammo counter.

Link to comment
Share on other sites

razorace told me to break the code when the bug occurs, and it stop here :

float powf ( float x, int y )
{
float r = x;
for ( y--; y>0; y-- )
	[b]r = r * r;[/b] 
return r;
}

(in game/q_math.c)

 

The only place where i've find 'powf' are in cg_view.c

	else if (cg_thirdPersonTargetDamp.value>=0.0)
{	
	// Calculate the difference from the current position to the new one.
	VectorSubtract(cameraIdealTarget, cameraCurTarget, targetdiff);

	// Now we calculate how much of the difference we cover in the time allotted.
	// The equation is (Damp)^(time)
	dampfactor = 1.0-cg_thirdPersonTargetDamp.value;	// We must exponent the amount LEFT rather than the amount bled off
	dtime = (float)(cg.time-cameraLastFrame) * (1.0/(float)CAMERA_DAMP_INTERVAL);	// Our dampfactor is geared towards a time interval equal to "1".

	// Note that since there are a finite number of "practical" delta millisecond values possible, 
	// the ratio should be initialized into a chart ultimately.
	ratio = [b]powf(dampfactor, dtime);[/b] 

	// This value is how much distance is "left" from the ideal.
	VectorMA(cameraIdealTarget, -ratio, targetdiff, cameraCurTarget);
	/////////////////////////////////////////////////////////////////////////////////////////////////////////
}

 

and

 

	else if (dampfactor>=0.0)
{	
	// Calculate the difference from the current position to the new one.
	VectorSubtract(cameraIdealLoc, cameraCurLoc, locdiff);

	// Now we calculate how much of the difference we cover in the time allotted.
	// The equation is (Damp)^(time)
	dampfactor = 1.0-dampfactor;	// We must exponent the amount LEFT rather than the amount bled off
	dtime = (float)(cg.time-cameraLastFrame) * (1.0/(float)CAMERA_DAMP_INTERVAL);	// Our dampfactor is geared towards a time interval equal to "1".

	// Note that since there are a finite number of "practical" delta millisecond values possible, 
	// the ratio should be initialized into a chart ultimately.
	ratio = [b]powf(dampfactor, dtime);[/b]

	// This value is how much distance is "left" from the ideal.
	VectorMA(cameraIdealLoc, -ratio, locdiff, cameraCurLoc);
	/////////////////////////////////////////////////////////////////////////////////////////////////////////
}

 

I tried to replace those two files by the originals one of the SDK, nothing

 

thx in advance

alexx

Link to comment
Share on other sites

um if u got the weapons too use infinite ammo, all that needs fixing is the hud stuff in cg_draw or even the actual hud menu file.

 

Originally posted by alexx860

err i think there is a problem.. I've tried to compile WITHOUT any change AT ALL at the code.. (i use the universal jka sdk) and it's always laggy. It's just when i join players, but when i'm spectator, there is no problems

 

thx

 

alexx

 

umm this happens when u play base also not much u can do. same when u die sometimes and when someone joins/connects. although if your cgame is being weird i dunno, may i also suggest not messing with q_* files that can be dangerous :) only thing i can think of about ur prob is that u added something u maybe weren't supposed too and causes too much lag when sending maybe ?

Link to comment
Share on other sites

I know damp, cameradamp, etc are for the ThirdPerson view, so i tested to enter the game in first person view, and, it's not laggy, it's normal, but when I toggle in third person view, it's laggy again

(by laggy I mean I cant move, because the image uptdate every ~30sec, like that..)

 

Thx in advance, I'll search too

alexx

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...