Jump to content

Home

Q3 Engine Game Bugs / JA bugs


ensiform

Recommended Posts

  • Replies 229
  • Created
  • Last Reply

Why in heck are the item bounding boxes different when dropped from normal?

 

FinishSpawningItem:

 

VectorSet (ent->r.mins, -8, -8, -0);
VectorSet (ent->r.maxs, 8, 8, 16);

 

LaunchItem:

 

VectorSet (dropped->r.mins, -ITEM_RADIUS, -ITEM_RADIUS, -ITEM_RADIUS);
VectorSet (dropped->r.maxs, ITEM_RADIUS, ITEM_RADIUS, ITEM_RADIUS);

 

bg_public.h:

 

#define	ITEM_RADIUS			15		// item sizes are needed for client side pickup detection

 

:smash:

 

Not really sure which way people wanna have it.

Link to comment
Share on other sites

Yes, mine does. Some mods actually create a new launched entity which is really bad, and just hide the original.

 

I just let them move it around but store the normal position to return to.

 

Hell, even JA+ puts the stupid hologram on (weapons and powerups) because slider doesn't know how to properly do it, really annoying too cuz you cannot then pick up dropped weapons if you already have it if it was pushed/pulled, which doesn't make any sense at all. Funny may it be, but what if i want to pull ammo from a guy i just killed towards me?

Link to comment
Share on other sites

What do you do? Have a timer on it that makes it return to a position after it hasn't been affected a while? I tried making items a physics object but for some reason they still don't move around, I tried even editing the force_throw code to allow items to be allowed to move around but no luck.

Link to comment
Share on other sites

			} else if ( em_itemPush.integer && CheckPu****em( push_list[x] ) ) {	//rolling and stationary thermal detonators are dealt with below
			if ( push_list[x]->item->giType == IT_TEAM ) {
				push_list[x]->nextthink = level.time + CTF_FLAG_RETURN_TIME;
				push_list[x]->think = ResetItem; // return to original spot after CTF_FLAG_RETURN_TIME ms
			} else {
				push_list[x]->nextthink = level.time + 30000;
				push_list[x]->think = ResetItem; // return to original spot after 30 seconds
			}

			if ( pull ) {
				//pull the item

				push_list[x]->s.pos.trType = TR_GRAVITY;
				push_list[x]->s.apos.trType = TR_GRAVITY;
				VectorScale( forward, -650.0f, push_list[x]->s.pos.trDelta );
				VectorScale( forward, -650.0f, push_list[x]->s.apos.trDelta );
				push_list[x]->s.pos.trTime = level.time;		// move a bit on the very first frame
				push_list[x]->s.apos.trTime = level.time;		// move a bit on the very first frame
				VectorCopy( push_list[x]->r.currentOrigin, push_list[x]->s.pos.trBase );
				VectorCopy( push_list[x]->r.currentOrigin, push_list[x]->s.apos.trBase );
				push_list[x]->physicsObject = qtrue;
				push_list[x]->flags |= FL_BOUNCE_HALF;
			} else {
				push_list[x]->s.pos.trType = TR_GRAVITY;
				push_list[x]->s.apos.trType = TR_GRAVITY;
				VectorScale( forward, 650.0f, push_list[x]->s.pos.trDelta );
				VectorScale( forward, 650.0f, push_list[x]->s.apos.trDelta );
				push_list[x]->s.pos.trTime = level.time;		// move a bit on the very first frame
				push_list[x]->s.apos.trTime = level.time;		// move a bit on the very first frame
				VectorCopy( push_list[x]->r.currentOrigin, push_list[x]->s.pos.trBase );
				VectorCopy( push_list[x]->r.currentOrigin, push_list[x]->s.apos.trBase );
				push_list[x]->physicsObject = qtrue;
				push_list[x]->flags |= FL_BOUNCE_HALF;
			}
		}

 

I store the original position and such and whether it has spawned originally.

CheckPu****em checks to see if the item is suspended, has a hologram below it, or is flag and check against cvar being 2 to allow dropped flags to move.

Link to comment
Share on other sites

  • 2 weeks later...

Fixed Bug where maps that have pits but do not have "nodrop" surface down in the pit thus flags that fall/tossed/pushed/pulled down will sit there until they expire.

 

Above G_RunItem:

 

// double size of items
static vec3_t itemMins2 = {-16, -16, 0};
static vec3_t itemMaxs2 = {16, 16, 32};

 

This is what I did in G_RunItem:

 

Note, the code includes my method of item push/pull checking, and is not necessary for basejka.

 

Below the following statement:

 

	if ( tr.fraction == 1 ) {
	return;
}

 

I added:

 

	if(ent->item && ((ent->flags & FL_DROPPED_ITEM) || (em_itemPush.integer && ent->think == ResetItem)))
{
	int			entityList[MAX_GENTITIES];
	int			i, cnt;
	gentity_t	*other;
	gentity_t	*t;
	vec3_t		mins, maxs;

	VectorAdd(ent->r.currentOrigin, itemMins2, mins);
	VectorAdd(ent->r.currentOrigin, itemMaxs2, maxs);

	cnt = trap_EntitiesInBox(mins, maxs, entityList, MAX_GENTITIES);

	for( i = 0; i < cnt; i++)
	{
		other = &g_entities[entityList[i]];

		if(other == ent)
		{
			continue;
		}

		if(other && other->inuse && !Q_stricmp(other->classname, "trigger_hurt"))
		{
			if(ent->item->giType == IT_TEAM)
			{
				Team_FreeEntity(ent);
			}
			else
			{
				if(ent->think == ResetItem)
				{
					ResetItem(ent);
				}
				else
				{
					G_FreeEntity(ent);
				}
			}
			return;
		}

		if(other && other->inuse && (!Q_stricmp(other->classname, "trigger_multiple") || !Q_stricmp(other->classname, "trigger_always") || !Q_stricmp(other->classname, "trigger_once")) && other->target && other->target[0])
		{
			int hash = BG_StringHashValue(other->target);
			t = NULL;
			while ((t = G_FindByTargetnameFast(t, other->target, hash)) != NULL)
			{
				if(t && t->inuse && !Q_stricmp(t->classname, "target_kill"))
				{
					if(ent->item->giType == IT_TEAM)
					{
						Team_FreeEntity(ent);
					}
					else
					{
						if(ent->think == ResetItem)
						{
							ResetItem(ent);
						}
						else
						{
							G_FreeEntity(ent);
						}
					}
					return;
				}
				else
				{
					continue;
				}
			}
		}
	}
}

Link to comment
Share on other sites

The infamous obtained wrong item bug is caused by an issue with the engine because events use eventParm stuff which is sent over the network in 8 bits (0-255 range) where entity numbers can be 0-1024 range (10 bits). This cannot be fixed without modifying the engine sadly.

 

EV_ITEM_PICKUP sends the item that you picked up's entity number and can without a doubt be higher than 255. So, meh :<

 

Edit: It may actually be doable without the engine (since this may not be the real problem as previously thought/said).

 

I'm currently testing it with a modified version of the event with a temp entity instead. This would not work well with server-side only mods of course. I also recommend turning off cg_predictItems with this method, as server is always right.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

CG_PointContents should use projected origin and angles in-case water is a moving entity such as draining water from an area.

 

contents |= trap_CM_TransformedPointContents( point, cmodel, ent->origin, ent->angles );

 

should be:

 

contents |= trap_CM_TransformedPointContents( point, cmodel, cent->lerpOrigin, cent->lerpAngles );

Link to comment
Share on other sites

Hey ensiform, could you point me where's the code related to vehicles? I'm gonna have to take a look in order to make my dragon flyable. If you don't know where's it don't worry, its just that I've downloaded recently the SDK and I haven't looked at it yet, I've started programing in c++ in university and now I can understand things on this thread...:)

 

btw good job.

Link to comment
Share on other sites

CalcEntitySpot has a bug when SPOT_WEAPON is the spot being used...

 

	case SPOT_WEAPON:
	//NOTE: automatically takes leaning into account!
	if( ent->NPC && !VectorCompare( ent->NPC->shootAngles, vec3_origin ) && !VectorCompare( ent->NPC->shootAngles, ent->client->ps.viewangles ))
	{
		AngleVectors( ent->NPC->shootAngles, forward, right, up );
	}
	else
	{
		AngleVectors( ent->client->ps.viewangles, forward, right, up );
	}
	CalcMuzzlePoint( (gentity_t*)ent, forward, right, up, point );
	break;

 

But what happens when Ent is neither a player nor an NPC?

 

Answer: AngleVectors is inputted with an invalid first param and thus causes crashing.

 

Fix:

 

	case SPOT_WEAPON:
	if( ent->client )
	{
		//NOTE: automatically takes leaning into account!
		if( ent->NPC && !VectorCompare( ent->NPC->shootAngles, vec3_origin ) && !VectorCompare( ent->NPC->shootAngles, ent->client->ps.viewangles ))
		{
			AngleVectors( ent->NPC->shootAngles, forward, right, up );
		}
		else
		{
			AngleVectors( ent->client->ps.viewangles, forward, right, up );
		}
		CalcMuzzlePoint( (gentity_t*)ent, forward, right, up, point );
	} else
		return;
	break;

 

I put the client check there because, NPC's also have a client pointer. And its not like other things are supposed to be using SPOT_WEAPON anyway... But technically you could do else if client do the ps.viewangles and else do ent->r.currentAngles.

Link to comment
Share on other sites

2 hand lightning effect origin should probably be in middle, not coming from left hand only...

 

cg_players.c CG_Player:

 

The following gets changed:

 

		//trap_G2API_GetBoltMatrix(cent->ghoul2, 0, ci->bolt_lhand, &boltMatrix, tAng, cent->lerpOrigin, cg.time, cgs.gameModels, cent->modelScale);
	if (!gotLHandMatrix)
	{
		trap_G2API_GetBoltMatrix(cent->ghoul2, 0, ci->bolt_lhand, &lHandMatrix, cent->turAngles, cent->lerpOrigin, cg.time, cgs.gameModels, cent->modelScale);
		gotLHandMatrix = qtrue;
	}

	efOrg[0] = lHandMatrix.matrix[0][3];
	efOrg[1] = lHandMatrix.matrix[1][3];
	efOrg[2] = lHandMatrix.matrix[2][3];

 

to:

 

		if ( cent->currentState.torsoAnim == BOTH_FORCE_2HANDEDLIGHTNING_HOLD )
	{//find mid point between two bolts
		mdxaBone_t 	rHandMatrix;
		trap_G2API_GetBoltMatrix(cent->ghoul2, 0, ci->bolt_rhand, &rHandMatrix, cent->turAngles, cent->lerpOrigin, cg.time, cgs.gameModels, cent->modelScale);
		if (!gotLHandMatrix)
		{
			trap_G2API_GetBoltMatrix(cent->ghoul2, 0, ci->bolt_lhand, &lHandMatrix, cent->turAngles, cent->lerpOrigin, cg.time, cgs.gameModels, cent->modelScale);
			gotLHandMatrix = qtrue;
		}
		efOrg[0] = ((lHandMatrix.matrix[0][3] + rHandMatrix.matrix[0][3]) * 0.5f);
		efOrg[1] = ((lHandMatrix.matrix[1][3] + rHandMatrix.matrix[1][3]) * 0.5f);
		efOrg[2] = ((lHandMatrix.matrix[2][3] + rHandMatrix.matrix[2][3]) * 0.5f);
	}
	else
	{
		if (!gotLHandMatrix)
		{
			trap_G2API_GetBoltMatrix(cent->ghoul2, 0, ci->bolt_lhand, &lHandMatrix, cent->turAngles, cent->lerpOrigin, cg.time, cgs.gameModels, cent->modelScale);
			gotLHandMatrix = qtrue;
		}
		efOrg[0] = lHandMatrix.matrix[0][3];
		efOrg[1] = lHandMatrix.matrix[1][3];
		efOrg[2] = lHandMatrix.matrix[2][3];
	}

 

Alternatively, you could do it like Single Player and play the effect from both hands. (Though is extra things being drawn). So I compensated for this because, it looked as though and the code said that it was only coming from left, and being in center looks a little bit better.

Link to comment
Share on other sites

  • 1 month later...

Force Dodge shouldn't work while holding a rocket lock.

 

Jedi_DodgeEvasion:

 

	if ( self->client->ps.weaponTime > 0 || self->client->ps.forceHandExtend != HANDEXTEND_NONE )
{//in some effect that stops me from moving on my own
	return qfalse;
}

 

=>

 

	if ( self->client->ps.weaponTime > 0 || self->client->ps.forceHandExtend != HANDEXTEND_NONE || self->client->ps.rocketLockTime > 0 )
{//in some effect that stops me from moving on my own
	return qfalse;
}

Link to comment
Share on other sites

  • 1 month later...

Archived

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


×
×
  • Create New...