Questions and troubles about quake 3 source

Locked
3xistence
Posts: 90
Joined: Sun May 13, 2012 3:02 pm

Questions and troubles about quake 3 source

Post by 3xistence »

Hi all, again.
Today i tried to make some order in my mods, but i get a silly respond from my build.

here are some questions:
1. There's a max length limit (in number of words) for my cg_ex_newstatusbar for example) shaders?

catch here where i did wrong because
the compiled one seems don't recognize the shader and don't apply alpha:

on cg_draw

Code: Select all

/*
================
CG_DrawTeamBackground

================
*/
void CG_DrawTeamBackground( int x, int y, int w, int h, float alpha, int team )
{
	vec4_t		hcolor;

	hcolor[3] = alpha;
	
	if (cg_modernHUD.integer <= 0) {
		if ( team == TEAM_RED ) {
			hcolor[0] = 1; 
			hcolor[1] = 0;
			hcolor[2] = 0;
		
			trap_R_SetColor( hcolor );
			CG_DrawPic( x, y, w, h, cgs.media.teamStatusBar );
			trap_R_SetColor( NULL );
			} 
		else if ( team == TEAM_BLUE ) {
			hcolor[0] = 0;
			hcolor[1] = 0;
			hcolor[2] = 1;
		
			trap_R_SetColor( hcolor );
			CG_DrawPic( x, y, w, h, cgs.media.teamStatusBar );
			trap_R_SetColor( NULL );
			} 
		else if ( team == TEAM_FREE ) {
			hcolor[0] = 1;
			hcolor[1] = 1;
			hcolor[2] = 1;
			hcolor[3] = 0.1;
		
			trap_R_SetColor( hcolor );
			CG_DrawPic( x, y, w, h, cgs.media.OldStatusBar );
			trap_R_SetColor( NULL );
			}
	if (cg_modernHUD.integer >= 1) {
		if ( team == TEAM_RED ) {
			hcolor[0] = 0.9; 
			hcolor[1] = 0.8;
			hcolor[2] = 0.8;
		
			trap_R_SetColor( hcolor );
			CG_DrawPic( x, y, w, h, cgs.media.NewStatusBar );
			trap_R_SetColor( NULL );
			} 
		else if ( team == TEAM_BLUE ) {
			hcolor[0] = 0.8;
			hcolor[1] = 0.8;
			hcolor[2] = 0.9;
		
			trap_R_SetColor( hcolor );
			CG_DrawPic( x, y, w, h, cgs.media.NewStatusBar );
			trap_R_SetColor( NULL );
			} 
		else if ( team == TEAM_FREE ) {
			hcolor[0] = 1;
			hcolor[1] = 1;
			hcolor[2] = 1;
		
			trap_R_SetColor( hcolor );
			CG_DrawPic( x, y, w, h, cgs.media.NewStatusBar );
			trap_R_SetColor( NULL );
			}

		}
	}
}
on cg_local i add

Code: Select all

	qhandle_t	NewStatusBar;
	qhandle_t	OldStatusBar;
on cg_main

Code: Select all

	cgs.media.NewStatusBar = trap_R_RegisterShaderNoMip( "Ex/NewStatusBar.tga" );
	cgs.media.OldStatusBar = trap_R_RegisterShaderNoMip( "Ex/OldStatusBar.tga" );
on scripts i make a Ex.shader

Code: Select all

Ex/Ex_OldStatusBar
{
	nopicmip
	{
		map Ex/OldStatusBar.tga
		blendfunc blend
	}
}

Ex/Ex_NewStatusBar
{
	nopicmip
	{
		map Ex/NewStatusBar.tga
		blendfunc blend
	}
}
is the code in cg_draw incorrect?

PURPOSE:
i added a shader for FFA modality in standard quake 3: client will see an little -alpha black bar when they play ffa or other gametypes withouts team
WHAT I SEE:
total black bar

PURPOSE:
when cg_modernHUD equals to 1 or more i will see a different shader for my statusbar, different positions etc...
WHAT I SEE:
nothing...like if the team variable is empty and the game doesn't draw anything...
can see all but my statusbar shader doesn't happear
3xistence
Posts: 90
Joined: Sun May 13, 2012 3:02 pm

Re: Questions and troubles about quake 3 source

Post by 3xistence »

fixed creating a new cg_drawteambackground2
(also because original cg_drawteambackground is used also for scoreboard background)

but still can't fix the alpha channel and set the transparency

using the same scheme
void CG_DrawTeamBackground2( int x, int y, int w, int h, float alpha, int team )
the call istruction's:

Code: Select all

CG_DrawTeamBackground2( 0, 420, 640, 60, 0.10f, cg.snap->ps.persistant[PERS_TEAM] );
0.10f 's the float variable about alpha but nothing happends: i can set also to 1 or every kind of number but i still get no trasparency at all.
what i did wrong?

the shader's "oldstatusbar" have only nopicmip and blendfunc blend.
maybe the game doesn't recognize it like a shader and draw just a picture?

cgs.media.OldStatusBar = trap_R_RegisterShaderNoMip( "Ex/OldStatusBar.tga" );
3xistence
Posts: 90
Joined: Sun May 13, 2012 3:02 pm

Re: Questions and troubles about quake 3 source

Post by 3xistence »

oh my gosh....if i erase the shader file it works in proper way.
Locked