unknowncheats uc-forum.com ucdownloads ucdownloads.com

Go Back   UC-Tutorials - Multiplayer Game Hacking and Cheat Tutorials > First-Person Shooters > Other FPS Games > Return to Castle Wolfenstein

- Sponsored Advertisement -
http://www.myfpscheats.com/


Reply
 
Thread Tools Display Modes
  #1  
Old 04-15-2010, 04:21 AM
disco disco is offline
Administrator
 
Join Date: Feb 2010
Posts: 271
Default Engine Chams

Posted by learn_more.




hooking this game shouldnt be a problem

call InitStuff preferrably at CG_R_LOADWORLDMAP
get trap_syscall pointer from dllEntry or pattern or whatever

other stuff should be straight-forward

end result should look like the attachment

Code:
int (__cdecl *trap_syscall)( int command, ... );

int _RegisterShader( char * name )
{
    return trap_syscall( CG_R_REGISTERSHADER, name );
}

void _LoadDynamicShader( const char *shadername, const char *shadertext )
{
    trap_syscall( CG_R_LOADDYNAMICSHADER, shadername, shadertext );
}



void InitStuff()
{
    _LoadDynamicShader( "lm_wall", "\
lm_wall\n\
{\n\
    nomipmaps\n\
    nofog\n\
    nopicmip\n\
    {\n\
        map *white\n\
        rgbGen entity\n\
        alphagen entity\n\
        blendFunc gl_src_alpha gl_one\n\
    }\n\
}\n" );

    _LoadDynamicShader( "lm_nowall", "\
lm_nowall\n\
{\n\
    nomipmaps\n\
    nofog\n\
    nopicmip\n\
    {\n\
        map *white\n\
        rgbGen const ( 0 0 0 )\n\
        blendFunc gl_dst_color gl_zero\n\
    }\n\
    {\n\
        map *white\n\
        rgbGen entity\n\
        depthWrite\n\
    }\n\
}\n" );

    _LoadDynamicShader( "lm_sfx", "\
lm_sfx\n\
{\n\
    nomipmaps\n\
    nofog\n\
    nopicmip\n\
    {\n\
        map $whiteimage\n\
        rgbGen const ( 1.0 1.0 1.0 )\n\
        alphaGen const 0.03\n\
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA\n\
    }\n\
}\n" );

    lm_first = _RegisterShader( "lm_wall" );
    lm_second = _RegisterShader( "lm_nowall" );
    sfxshader = _RegisterShader( "lm_sfx" );
}


int OnAddRefEntity( refEntity_t *re )
{
    if( body_recognition + setting_bEnemy )
    {
        refEntity_t cham;
        cham = *re;
        cham.renderfx = RF_DEPTHHACK|RF_NOSHADOW|RF_HILIGHT|RF_FORCENOLOD;
        re->renderfx = RF_HILIGHT|RF_NOSHADOW|RF_FORCENOLOD;
        cham.shaderRGBA[3] = 255;

        if( bEnemy )
        {
            cham.shaderRGBA[0] = 255;
            cham.shaderRGBA[1] = 0;
            cham.shaderRGBA[2] = 255;

            re->shaderRGBA[0] = 255;
            re->shaderRGBA[1] = 0;
            re->shaderRGBA[2] = 0;
        } else {
            cham.shaderRGBA[0] = 0;
            cham.shaderRGBA[1] = 0;
            cham.shaderRGBA[2] = 255;

            re->shaderRGBA[0] = 0;
            re->shaderRGBA[1] = 255;
            re->shaderRGBA[2] = 0;
        }
        
        cham.customShader = lm_first;
        re->customShader = lm_second;
        
        trap_syscall( CG_R_ADDREFENTITYTOSCENE, &cham );
    } else if( head_detection + setting_bEnemy )
    {
        //no truwalls for head, only bright colored :)
        re->renderfx = RF_HILIGHT|RF_NOSHADOW|RF_FORCENOLOD;

        if( bEnemy )
        {
            re->shaderRGBA[0] = 255;
            re->shaderRGBA[1] = 255;
            re->shaderRGBA[2] = 0;
        } else {
            re->shaderRGBA[0] = 0;
            re->shaderRGBA[1] = 255;
            re->shaderRGBA[2] = 255;
        }
        re->customShader = lm_second;
    } else if( weap_detected || pickup_detected )
    {
        if( !(re->renderfx & RF_DEPTHHACK) )        //dont want own weap white colored :)
        {
            refEntity_t cham;
            re->shaderRGBA[0] = 255;
            re->shaderRGBA[1] = 255;
            re->shaderRGBA[2] = 255;

            cham = *re;
            cham.renderfx |= RF_DEPTHHACK|RF_NOSHADOW|RF_HILIGHT|RF_FORCENOLOD;

            re->customShader = lm_second;
            cham.customShader = lm_first;
            cham.shaderRGBA[3] = 50;

            trap_syscall( CG_R_ADDREFENTITYTOSCENE, &cham );
        }
    }
    return trap_syscall( CG_R_ADDREFENTITYTOSCENE, re );
}

//  smoke and other crap like bullet impact removal (replaced with transparant white shader, so you can see what other players dont expect you to see)
int OnAddPolyToScene( qhandle_t hShader , int numVerts, const polyVert_t *verts )
{
    return trap_syscall( CG_R_ADDPOLYTOSCENE, sfxshader, numVerts, verts );
}
Reply With Quote
Reply

  • Submit Thread to Digg
  • Submit Thread to del.icio.us
  • Submit Thread to StumbleUpon
  • Submit Thread to Google
  • Submit Thread to Facebook
  • Submit Thread to My Yahoo!
  • Submit Thread to MySpace
  • Submit Thread to Twitter
  • Submit Thread to Reddit

Tags
chams, engine

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 10:20 AM.