Jump to content

What code calls for smokeTrail?


Go to solution Solved by Asgarath83,

Recommended Posts

Posted

This smoke:

 

CDlfqD9.jpg

 

It appears only after the alt fire has been made. I was wondering about this, as there are two guns that use this effect after their alt fires, the concussion rifle and the disruptor.

 

Now there is a shader for it in gfx2.shader, seen as so:

gfx/effects/smokeTrail
{
cull twosided
    {
        map gfx/effects/smoketrail
        blendFunc GL_ONE GL_ONE
        rgbGen vertex
        tcMod scale 1 0.7
        tcMod scroll 0 -0.2
    }
    {
        map gfx/effects/smoketrail
        blendFunc GL_ONE GL_ONE
        rgbGen vertex
        tcMod scale 1 0.3
        tcMod scroll 0 -0.3
    }
}

However, I cannot find the .efx file that calls for this (if there is even a .efx file that calls this).

 

So is it hardcoded in JKA? Or did I just miss the file that calls for this effect?

  • 3 weeks later...
  • Solution
Posted

This smoke:

 

CDlfqD9.jpg

 

It appears only after the alt fire has been made. I was wondering about this, as there are two guns that use this effect after their alt fires, the concussion rifle and the disruptor.

 

Now there is a shader for it in gfx2.shader, seen as so:

gfx/effects/smokeTrail
{
cull twosided
    {
        map gfx/effects/smoketrail
        blendFunc GL_ONE GL_ONE
        rgbGen vertex
        tcMod scale 1 0.7
        tcMod scroll 0 -0.2
    }
    {
        map gfx/effects/smoketrail
        blendFunc GL_ONE GL_ONE
        rgbGen vertex
        tcMod scale 1 0.3
        tcMod scroll 0 -0.3
    }
}

However, I cannot find the .efx file that calls for this (if there is even a .efx file that calls this).

 

So is it hardcoded in JKA? Or did I just miss the file that calls for this effect?

is hardcoded.

basically for the effect opf weapons into JKA code, they are scattered into differente functions.

hitwall,bouncewalleffect and hitperson effect are into cg_missilehitwall cg_missilebounce(or sometjhing like that) and cg_missilehitplayer . bounce is for EFX of flechette and bowcasters bouncing shoots.

For the FX of shoots of the weapons: check the FX files of weapons.

For the muzzle \ altmuzzle efx of the weapons: check the wp_ file of the weapons.

but they are damned hardcoded for be called to the silly weapons.dat. i am working to a RPG code rewrite that add a ton of easy modding feature on JKA, and also a space fighter cobmat as rogue squadron 3d \ x wing alliance on Single Player. 

i hope when i end to share this code with all. 

tmy project also related to allow a full customization of weapons models and effects .  and a beter customization of force power effects too with WPN files as JKG mod or the NPC files itself.

 is silly that this stuff is hardcoded. not leady any way for the imagination of modders.

 

 

however the smoke trail i think is called into wp_disruptor.cpp and wp_concussion.cpp that deal the function sof the weapons logic. check the alt fire shoot functions. there is something about Q3_INFINITE this is the functions called for a shoot of infinite velocity and istalty damage like the beams ray of these weapons.

the smoke trail is rendered when you shoot with the altfire beams of these weapons.

 

 

 
 
void FX_ConcAltMiss( vec3_t origin, vec3_t normal )
{
    //gentity_t self;
    
    vec3_t pos, c1, c2;

    VectorMA( origin, 4.0f, normal, c1 );
    VectorCopy( c1, c2 );
    c1[2] += 4;
    c2[2] += 12;
    
    VectorAdd( origin, normal, pos );
    pos[2] += 28;

    FX_AddBezier( origin, pos, c1, vec3_origin, c2, vec3_origin, 6.0f, 6.0f, 0.0f, 0.0f, 0.2f, 0.5f, WHITE, WHITE, 0.0f, 4000, cgi_R_RegisterShader( "gfx/effects/smokeTrail" ), FX_ALPHA_WAVE );

    theFxScheduler.PlayEffect( "concussion/alt_miss", origin, normal );
}
 

is FX_AddBezier ;)

 

i never edited it. is on FXutil.cpp

 

 
//-------------------------
//  FX_AddBezier
//-------------------------
CBezier *FX_AddBezier( const vec3_t start, const vec3_t end,
                        const vec3_t control1, const vec3_t control1Vel,
                        const vec3_t control2, const vec3_t control2Vel,
                        float size1, float size2, float sizeParm,
                        float alpha1, float alpha2, float alphaParm,
                        const vec3_t sRGB, const vec3_t eRGB, const float rgbParm,
                        int killTime, qhandle_t shader, int flags )
{
    if ( theFxHelper.mFrameTime < 1 )
    { // disallow adding new effects when the system is paused
        return 0;
    }

    CBezier *fx = new CBezier;

    if ( fx )
    {
        fx->SetOrigin1( start );
        fx->SetOrigin2( end );

        fx->SetControlPoints( control1, control2 );
        fx->SetControlVel( control1Vel, control2Vel );

        // RGB----------------
        fx->SetRGBStart( sRGB );
        fx->SetRGBEnd( eRGB );

        if (( flags & FX_RGB_PARM_MASK ) == FX_RGB_WAVE )
        {
            fx->SetRGBParm( rgbParm * PI * 0.001f );
        }
        else if ( flags & FX_RGB_PARM_MASK )
        {
            // rgbParm should be a value from 0-100..
            fx->SetRGBParm( rgbParm * 0.01f * killTime + theFxHelper.mTime );
        }

        // Alpha----------------
        fx->SetAlphaStart( alpha1 );
        fx->SetAlphaEnd( alpha2 );

        if (( flags & FX_ALPHA_PARM_MASK ) == FX_ALPHA_WAVE )
        {
            fx->SetAlphaParm( alphaParm * PI * 0.001f );
        }
        else if ( flags & FX_ALPHA_PARM_MASK )
        {
            fx->SetAlphaParm( alphaParm * 0.01f * killTime + theFxHelper.mTime );
        }

        // Size----------------
        fx->SetSizeStart( size1 );
        fx->SetSizeEnd( size2 );

        if (( flags & FX_SIZE_PARM_MASK ) == FX_SIZE_WAVE )
        {
            fx->SetSizeParm( sizeParm * PI * 0.001f );
        }
        else if ( flags & FX_SIZE_PARM_MASK )
        {
            fx->SetSizeParm( sizeParm * 0.01f * killTime + theFxHelper.mTime );
        }

        fx->SetShader( shader );
        fx->SetFlags( flags );

        fx->SetSTScale( 1.0f, 1.0f );

        FX_AddPrimitive( (CEffect**)&fx, killTime );
    }

    return fx;
}
 
          
Daedra likes this

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...