FileFront Forums

FileFront Forums (http://forums.filefront.com/)
-   SW:JK3 Modding, Mapping and Editing (http://forums.filefront.com/sw-jk3-modding-mapping-editing-528/)
-   -   [Alpha Mod] Gunslinger's Academy (http://forums.filefront.com/sw-jk3-modding-mapping-editing/413004-gunslingers-academy.html)

Raz0r December 5th, 2009 07:30 AM

Re: Gunslinger's Academy
 
This is funny..

Code:

//Some helpful macros for doing funky HUD stuff.
#define        MAKERGB( v, r, g, b ) v[0]=r;v[1]=g;v[2]=b
#define        MAKERGBA( v, r, g, b, a ) v[0]=r;v[1]=g;v[2]=b;v[3]=a
#define _RGB( v, r, g, b ) { v[0]=r;v[1]=g;v[2]=b; }
#define _RGBA( v, r, g, b, a ) { v[0]=r; v[1]=g; v[2]=b; v[3]=a; }
#define RED                0
#define GREEN        1
#define BLUE        2
#define ALPHA        3
#define CLAMP_CHAN( vec, chan, min, max )        if ( vec[chan] < min )        vec[chan] = min;\
                                                                                        if ( vec[chan] > max )        vec[chan] = max;
#define DRAW_MASK(x) {CG_DrawPic( 0.0f, 0.0f, 640.0f, 480.0f, x );}

        if ( cg.snap->ps.stats[STAT_HEALTH] < (cg.snap->ps.stats[STAT_CLASS_MAXHEALTH] * 0.75f) && !cg.intermissionStarted )
        {//We have < 75% health
static        vec4_t        color                =        { 1.0, 0.0f, 0.0f, 1.0f };

                //Now, some funky math to pulse it
                color[3]        =        ( (cg.snap->ps.stats[STAT_CLASS_MAXHEALTH]*0.75f) - (cg.snap->ps.stats[STAT_HEALTH]-(cg.snap->ps.stats[STAT_HEALTH]*.75f)) ) * 0.015f;
                color[3]        *=        Q_fabs( sinf(cg.time/350.0f) * .75f );
        //        color[3]        *=        cg.am_HUDOpacity * .75;

                if (color[ALPHA] >= 0.5f)        color[ALPHA] = 0.5f;

                trap_R_SetColor( color );
                        DRAW_MASK( cgs.media.am_lowHealth );
                trap_R_SetColor( NULL );
        }

I've got a few fancy macros and variables etc, but that should help you a bit.

self->client->ps.clientNum should suffice for their client num..and ent-g_entities
Like so: trap_SendServerCommand( ent-g_entities, va("print \"%s\n\"", G_GetStringEdString("MP_SVGAME", "NOCHEATS")));

Now, using 'cp' aka centerprint, you can only show one at a time..so you might want to rig up a custom system to display text in a notification (The latest source of OJP/JKE has a thing called AddText which is a fine example of it)

I also planned on implementing different crosshairs for different weapons :p...It seems we're doing much of the same stuff. =]

eezstreet December 5th, 2009 08:22 AM

Re: Gunslinger's Academy
 
Now if only my shaders weren't screwed up...
Here's a little something-something for Authuran...


This is what is bothering me:
Spoiler:

Code:

DRAW_MASK( cgs.media.am_lowHealth );


Any new shader I make, or even if I use a new shader, will be messed up (either it won't show or it won't allow for transparency, even if I DIRECTLY COPY an old shader and give it a new name)

Also, could it be possible to maybe rig up a graphic that shows up instead of the CP text? It's worth a shot.

Raz0r December 5th, 2009 08:49 AM

Re: Gunslinger's Academy
 
cgs.media.am_lowHealth..
In cgame -> cg_local.h -> cgMedia_t..
Code:

        qhandle_t        am_lowHealth;
In cgame -> cg_main.c -> CG_Init()..
Code:

        cgs.media.am_lowHealth = trap_R_RegisterShaderNoMip("gfx/am/lowhealth");
gfx/am/lowhealth is a regular transparent .PNG, with no shader applied to it.

Never mind the incomplete HUD..

eezstreet December 5th, 2009 08:52 AM

Re: Gunslinger's Academy
 
Quote:

Originally Posted by -Raz0r- (Post 5159021)
cgs.media.am_lowHealth..
In cgame -> cg_local.h -> cgMedia_t..
Code:

    qhandle_t    am_lowHealth;
In cgame -> cg_main.c -> CG_Init()..
Code:

    cgs.media.am_lowHealth = trap_R_RegisterShaderNoMip("gfx/am/lowhealth");
gfx/am/lowhealth is a regular transparent .PNG, with no shader applied to it.

Ar, I did both of those.
What about the bespin_platform bug?

eezstreet December 5th, 2009 01:05 PM

Re: Gunslinger's Academy
 
Knock yourselves out. This includes the source for it as well.

http://www.filefront.com/15066339/baseGA.zip

Distortedcoder December 5th, 2009 01:09 PM

Re: Gunslinger's Academy
 
Taking a look now :)

Distortedcoder December 5th, 2009 01:14 PM

Re: Gunslinger's Academy
 
Um... How is this installed? no readme yet...

eezstreet December 5th, 2009 01:19 PM

Re: Gunslinger's Academy
 
You put baseGA in your Gamedata and then run the .bat

Pwned! December 5th, 2009 01:28 PM

Re: Gunslinger's Academy
 
Wut duz it do right now?

Raz0r December 5th, 2009 01:36 PM

Re: Gunslinger's Academy
 
I'll get around to this next week (Going on holiday in a few hours)
Maybe I could set up an SVN repository and continue development?
I'd like to restructure some of the code to make it easier to use.


All times are GMT -7.

Powered by vBulletin®
Copyright ©2000 - 2016, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.