Jump to content

Extra BBox NPC Setting


Tempust85

Recommended Posts

I know OpenJK isn't about adding new features, but I feel this would be welcomed feature. Currently, the "width" setting for NPC controls both X & Y of the bounding box. What I propose is, removing the control of both X & Y from "width" and adding new stat "widthY" setting for Y. So in the end, "width" will control X & "widthY" will control Y. Here's the code that I've tinkered with:

NPC_stats.cpp

	//===MOVEMENT STATS============================================================

			if ( !Q_stricmp( token, "width" ) )
			{
				if ( COM_ParseInt( &p, &n ) )
				{
					continue;
				}

				NPC->mins[0] = -n;
				NPC->maxs[0] = n;
				continue;
			}

			if (!Q_stricmp(token, "widthY"))
			{
				if (COM_ParseInt(&p, &n))
				{
					continue;
				}

				NPC->mins[1] = -n;
				NPC->maxs[1] = n;
				continue;
			}

Tested ingame and it works great. This would be very useful when adding odd-shaped NPCs ie the Kryat Dragon. Ideally, using a collision model would be better but this is an alternative solution. :)

 

Archangel35757 likes this
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...