Question regarding custom HUDs

4 replies [Last post]
Whatscheiser
Offline
Joined: May 2022
Posts:
US United States

Hello, I'm new to these forums. Hopefully, I'm putting this topic in the right place.
I'm attempting to modify a HUD to fit my own needs. It's based on the excessive+ (Q3Plus) mod. My issue is I'm trying to keep the 3D head model that VQ3 uses as the health icon. However, placing it with the same size and position of the VQ3 HUD causes issues when the player takes damage.
The 3D modeled head reacts when the player takes damage and becomes larger. In VQ3 this jump in size is up toward the center of the screen. In my custom HUD the jump in size is directed downward to the bottom of the screen and as a result, can clip about a 3rd of the face off camera until it returns to normal size.
I can't find a lot of documentation regarding how to control a 3D object on screen within the HUD like this. Similarly I've got the 3D armor model loaded as the armor icon and... it spins in the wrong direction. Which doesn't really bother me, but I am slightly annoyed I can't figure out how to spin it the other way around Tongue

I can post code/screenshots later today if anyone thinks they may be able to lend a hand.
Thanks.

superbad!
Divx's picture
Offline
Joined: Aug 2008
Posts:
BE Belgium
Re: Question regarding custom HUDs

are the anchors set correctly?

Deathadder | Goliathus Speed | Filco Majestouch | i7 3770 | 16GB | GTX 1080 | Xonar Essence ST | Sennheiser HD598

Whatscheiser
Offline
Joined: May 2022
Posts:
US United States
Re: Question regarding custom HUDs

Well... honestly I'm not sure. I have played with the anchor values quite a bit here and all I really achieve is moving the head model around the screen. The behavior during a damage hit doesn't seem to change at all.

StatusBar_HealthIcon
{
rect 285 420 60 60
draw3d
anchors 4
}
^ this is what I am working with.I've changed the value of "4" to practically every number under 100 out of frustration and it just doesn't affect it. I'm sure there must be something I'm missing or not understanding.

JIVA
Jiva's picture
Offline
Joined: Jun 2006
Posts:
CZ Czech Republic
Re: Question regarding custom HUDs

try my autoexec.cfg and config.cfg for compare yours , watch commands set by me , i have config from years 1999 era times when power of computer was lower than quake requirements , here www.tigerhareram.cz/quake3.html can be found quake 3 non-steam used on my bengal tigers servers , in baseq3 is autoexec.cfg , search here http://www.joz3d.net/html/q3console.html

Whatscheiser
Offline
Joined: May 2022
Posts:
US United States
Re: Question regarding custom HUDs

Hi thanks for pointing me at those files but I'm not sure changing settings within those files can help with the issue I am having.
I did finally get the idea to look at the HUD was setup in Quake 3's open-sourced files and inside cgame in cg_draw.c is the following...

================CG_DrawHeadUsed for both the status bar and the scoreboard================
void CG_DrawHead( float x, float y, float w, float h, int clientNum, vec3_t headAngles ) {
clipHandle_t cm;
clientInfo_t *ci;
float len;
vec3_t origin;
vec3_t mins, maxs;

ci = &cgs.clientinfo[ clientNum ];

if ( cg_draw3dIcons.integer ) {
cm = ci->headModel;
if ( !cm ) {
return;
}

// offset the origin y and z to center the head
trap_R_ModelBounds( cm, mins, maxs );

origin[2] = -0.5 * ( mins[2] + maxs[2] );
origin[1] = 0.5 * ( mins[1] + maxs[1] );

// calculate distance so the head nearly fills the box
// assume heads are taller than wide
len = 0.7 * ( maxs[2] - mins[2] );
origin[0] = len / 0.268; // len / tan( fov/2 )

// allow per-model tweaking
VectorAdd( origin, ci->headOffset, origin );

CG_Draw3DModel( x, y, w, h, ci->headModel, ci->headSkin, origin, headAngles );
} else if ( cg_drawIcons.integer ) {
CG_DrawPic( x, y, w, h, ci->modelIcon );
}

// if they are deferred, draw a cross out
if ( ci->deferred ) {
CG_DrawPic( x, y, w, h, cgs.media.deferShader );
}
}

I'm assuming that trap_R_ModelBounds is probably what I am missing an equivalent command for. What I gather is I'd need some way to invoke that and define its boundaries to resolve the problem.
I'm using terms like "gather" and "assume" because I'm really not certain of this, but by looks of this, I think it makes sense.