Hello,

I have this code for my new blood particle effect. 

This is located in the fx_blood.cpp


ParticleForBlood_t    bloodCallbacks[] =
{
    { BLOOD_COLOR_RED,        "blood_impact_red_01" },
    { BLOOD_COLOR_GREEN,    "blood_impact_green_01" },
    { BLOOD_COLOR_YELLOW,    "blood_impact_yellow_01" },
#if defined( HL2_EPISODIC )
    { BLOOD_COLOR_COMBINE,            "blood_impact_combine_01" },
    { BLOOD_COLOR_ANTLION,            "blood_impact_antlion_01" },        // 
FIXME: Move to Base HL2
    { BLOOD_COLOR_ZOMBIE,            "blood_impact_zombie_01" },            // 
FIXME: Move to Base HL2
    { BLOOD_COLOR_ANTLION_WORKER,    "blood_impact_antlion_worker_01" },
#endif // HL2_EPISODIC
};

The bold is my added line.

In sharedefs.h i have

// All NPCs need this data
enum
{
    DONT_BLEED = -1,

    BLOOD_COLOR_RED = 0,
    BLOOD_COLOR_YELLOW,
    BLOOD_COLOR_GREEN,
    BLOOD_COLOR_MECH,

#if defined( HL2_EPISODIC )
    BLOOD_COLOR_COMBINE,
    BLOOD_COLOR_ANTLION,        // FIXME: Move to Base HL2
    BLOOD_COLOR_ZOMBIE,            // FIXME: Move to Base HL2
    BLOOD_COLOR_ANTLION_WORKER,
#endif // HL2_EPISODIC
};

Once again what's bolded.

And finally in the npc_Combine.cpp

SetBloodColor( BLOOD_COLOR_COMBINE );

It works perfectly. No flaws except for the decal. when i shoot they splatter a 
yellow alien decal. How do i make it in the human group, but have its own blood 
effect to where it emits the red blood decals?

And finally.

Here is impact code. I got all impacts to work, the particles spawn, it looks 
wonderful. Its just they always spawn Up as in the particle editor.

If i shoot a wall, i want the particles to come out from the side. Is that 
something i set in the editor or do i make a change to this  vector code. If so 
what is the code i should put because know nothing about vector coding.

This is taken from fx_impact.cpp

void PerformCustomEffects( const Vector &vecOrigin, trace_t &tr, const Vector 
&shotDir, int iMaterial, int iScale, int nFlags )
{
    // Throw out the effect if any of these are true
    if ( tr.surface.flags & (SURF_SKY|SURF_NODRAW|SURF_HINT|SURF_SKIP) )
        return;

    if ( cl_new_impact_effects.GetInt() )
    {
        PerformNewCustomEffects( vecOrigin, tr, shotDir, iMaterial, iScale, 
nFlags );
        return;
    }

    bool bNoFlecks = !r_drawflecks.GetBool();
    if ( !bNoFlecks )
    {
        bNoFlecks = ( ( nFlags & FLAGS_CUSTIOM_EFFECTS_NOFLECKS ) != 0  );
    }

    // Cement and wood have dust and flecks
    if ( ( iMaterial == CHAR_TEX_CONCRETE ) || ( iMaterial == CHAR_TEX_TILE ) )
    {
        //FX_DebrisFlecks( vecOrigin, &tr, iMaterial, iScale, bNoFlecks );
        QAngle vecAngles;
        VectorAngles( -shotDir, vecAngles );
        Vector    offset = vecOrigin + ( tr.plane.normal * 1.0f );
        DispatchParticleEffect( "fx_concrete", vecOrigin, vecAngles );
    }
    else if ( iMaterial == CHAR_TEX_WOOD )
    {
        //FX_DebrisFlecks( vecOrigin, &tr, iMaterial, iScale, bNoFlecks );
        QAngle vecAngles;
        VectorAngles( -shotDir, vecAngles );
        Vector    offset = vecOrigin + ( tr.plane.normal * 1.0f );
        DispatchParticleEffect( "fx_wood", vecOrigin, vecAngles );
    }
    else if ( ( iMaterial == CHAR_TEX_DIRT ) || ( iMaterial == CHAR_TEX_SAND ) )
    {
        //FX_DustImpact( vecOrigin, &tr, iScale );
        QAngle vecAngles;
        VectorAngles( -shotDir, vecAngles );
        Vector    offset = vecOrigin + ( tr.plane.normal * 1.0f );
        DispatchParticleEffect( "fx_Dirt_Sand", vecOrigin, vecAngles );
    }
    else if ( iMaterial == CHAR_TEX_ANTLION )
    {
        FX_AntlionImpact( vecOrigin, &tr );
    }
    else if ( ( iMaterial == CHAR_TEX_METAL ) || ( iMaterial == CHAR_TEX_VENT ) 
)
    {
        Vector    reflect;
        float    dot = shotDir.Dot( tr.plane.normal );
        reflect = shotDir + ( tr.plane.normal * ( dot*-2.0f ) );

        reflect[0] += random->RandomFloat( -0.2f, 0.2f );
        reflect[1] += random->RandomFloat( -0.2f, 0.2f );
        reflect[2] += random->RandomFloat( -0.2f, 0.2f );

        //FX_MetalSpark( vecOrigin, reflect, tr.plane.normal, iScale );
        QAngle vecAngles;
        VectorAngles( -shotDir, vecAngles );
        Vector    offset = vecOrigin + ( tr.plane.normal * 1.0f );
        DispatchParticleEffect( "fx_metal", vecOrigin, vecAngles );

    }
    else if ( iMaterial == CHAR_TEX_COMPUTER )
    {
        Vector    offset = vecOrigin + ( tr.plane.normal * 1.0f );

        g_pEffects->Sparks( offset );
    }
    else if ( iMaterial == CHAR_TEX_WARPSHIELD )
    {
        QAngle vecAngles;
        VectorAngles( -shotDir, vecAngles );
        DispatchParticleEffect( "warp_shield_impact", vecOrigin, vecAngles );
    }
}

Any one know why my particles won't normalize and spawn out of the wall, 
instead of still going in an upward direction on slants and walls?

Thanks,
Nick





      
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to