Jump to content

Home

*sigh* error :(


Coasterdude

Recommended Posts

Posted

Hmm.. I did some changes and I don't get that error anymore.

Anyway I'm trying to make blaster spread different for movement with this....

Under

static void WP_FireBlaster( gentity_t *ent, qboolean altFire )

in g_weapon.c

 

	if ( altFire )
{
if ( (ent->client->pers.cmd.forwardmove > 0) 
	|| (ent->client->pers.cmd.forwardmove < 0) 
	|| (ent->client->pers.cmd.rightmove < 0) 
	|| (ent->client->pers.cmd.rightmove > 0) )
	{
		angs[PITCH] += crandom() * (wmw_BlasterSpread.integer * 2.0);
		angs[YAW] += crandom() * (wmw_BlasterSpread.integer * 2.0);
	}
else if ( ent->client->pers.cmd.upmove == 0 )
	{
		angs[PITCH] += crandom() * (wmw_BlasterSpread.integer * 4.0);
		angs[YAW] += crandom() * (wmw_BlasterSpread.integer * 4.0);
	}
else
	{
		angs[PITCH] += crandom() * (wmw_BlasterSpread.integer * 1.0);
		angs[YAW] += crandom() * (wmw_BlasterSpread.integer * 1.0);
	}
}

 

also I changed BLASTER_SPREAD to define this

#define BLASTER_SPREAD   wmw_BlasterSpread.integer

wmw_BlasterSpread.integer is 1.6

 

Ingame I do see changes in the spread, but It's not what I wanted. Standing still has alot of spread. crouching gives good accuracy, more accurate than normal spread (1.6). Running has more accurate spread than just standing still lol. So I did something wrong, but I'm not sure what I did wrong.

Posted

1. pers.cmd is just the commanded movement direction for the player, not their actual movement.

2. "else if ( ent->client->pers.cmd.upmove == 0 )" will apply if you're not trying to move in any direction other than up/down. This is why you're having crap accuracy when standing still. This should be else if ( ent->client->pers.cmd.upmove > 0 )

 

IE,

if ( ent->client->pers.cmd.upmove > 0 )
{//jumping is the worse, it should go first so it will override normal movement.
}
else if ( (ent->client->pers.cmd.forwardmove > 0) 
	|| (ent->client->pers.cmd.forwardmove < 0) 
	|| (ent->client->pers.cmd.rightmove < 0) 
	|| (ent->client->pers.cmd.rightmove > 0) )
{//for normal movement
}
else if ( ent->client->pers.cmd.upmove < 0 )
{//crouching
}
else
{//standing, not moving.
}

Posted

Ahhh.. Thanks. Oh and I'm using the OJP Basic Source Code. and I didn't edit power duel in anyway. When I was playing power duel, I was the single duelist, and I was playing against 2 bots who were on the paired duelists, the second paired duelist always got booted by server command overflow when a new round started.

Posted

hmmm, interesting. That's probably due to a infinite team switching loop or something. If you got the qconsole.log of it happening, go ahead and post a bug ticket for it on the OJP bug tracker.

Posted
  Coasterdude said:
Hmm.. I did some changes and I don't get that error anymore.

Anyway I'm trying to make blaster spread different for movement with this....

Under

static void WP_FireBlaster( gentity_t *ent, qboolean altFire )

in g_weapon.c

 

	if ( altFire )
{
if ( (ent->client->pers.cmd.forwardmove > 0) 
	|| (ent->client->pers.cmd.forwardmove < 0) 
	|| (ent->client->pers.cmd.rightmove < 0) 
	|| (ent->client->pers.cmd.rightmove > 0) )
	{
		angs[PITCH] += crandom() * (wmw_BlasterSpread.integer * 2.0);
		angs[YAW] += crandom() * (wmw_BlasterSpread.integer * 2.0);
	}
else if ( ent->client->pers.cmd.upmove == 0 )
	{
		angs[PITCH] += crandom() * (wmw_BlasterSpread.integer * 4.0);
		angs[YAW] += crandom() * (wmw_BlasterSpread.integer * 4.0);
	}
else
	{
		angs[PITCH] += crandom() * (wmw_BlasterSpread.integer * 1.0);
		angs[YAW] += crandom() * (wmw_BlasterSpread.integer * 1.0);
	}
}

 

also I changed BLASTER_SPREAD to define this

#define BLASTER_SPREAD   wmw_BlasterSpread.integer

wmw_BlasterSpread.integer is 1.6

 

Ingame I do see changes in the spread, but It's not what I wanted. Standing still has alot of spread. crouching gives good accuracy, more accurate than normal spread (1.6). Running has more accurate spread than just standing still lol. So I did something wrong, but I'm not sure what I did wrong.

 

well for one that will actually only be 1 due to floor round conversion that is automatically used when you try to do an float when its actually an int. you are going to want cvar.value instead.

Archived

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

×
×
  • Create New...