Jump to content

Change misc NS turret Blaster Shoot Fx


Go to solution Solved by Asgarath83,

Recommended Posts

Posted

Hello. I need a little help. i am diving by days on SP code.

For fix a little crash issue i need to change the FX of blaster projetctile of NS turret, (the turrets that shoots by ceiling... an example of these are on T3_byss map and on Vjun3. ) they use as default the blaster rifle EFX. i see if i change FX_blaster.CPP effects it change also the turret efx. but it's not what i want.

i desire that the ns_turret make his custom shooting effect, like the floor turrets.

i need to find where is the part of SP code when NS turret get his muzzle flast, shoot efx and impact efx. D: there is some place of code when is setted that NS_TURRET use the blaster rifle FX. i wanna to change this part.

Someone know where is coded that?

 

never mind. find it on g_turret.cpp.

 

 

{
    vec3_t        org, ang;
    gentity_t    *bolt;

    if ( (gi.pointcontents( start, ent->s.number )&MASK_SHOT) )
    {
        return;
    }

    VectorMA( start, -START_DIS, dir, org ); // dumb....

    if ( ent->random )
    {
        vectoangles( dir, ang );
        ang[PITCH] += Q_flrand( -ent->random, ent->random );
        ang[YAW] += Q_flrand( -ent->random, ent->random );
        AngleVectors( ang, dir, NULL, NULL );
    }

    vectoangles(dir, ang);

    if ( (ent->spawnflags&SPF_TURRETG2_TURBO) )
    {
        //muzzle flash
        G_PlayEffect( G_EffectIndex( "turret/turb_muzzle_flash" ), org, ang );
        G_SoundOnEnt( ent, CHAN_LESS_ATTEN, "sound/vehicles/weapons/turbolaser/fire1" );

        WP_FireTurboLaserMissile( ent, start, dir );
        if ( ent->alt_fire )
        {
            TurboLaser_SetBoneAnim( ent, 2, 3 );
        }
        else
        {
            TurboLaser_SetBoneAnim( ent, 0, 1 );
        }
    }
    else
    {
        G_PlayEffect( "blaster/muzzle_flash", org, dir );

        bolt = G_Spawn();
        
        bolt->classname = "turret_proj";
        bolt->nextthink = level.time + 10000;
        bolt->e_ThinkFunc = thinkF_G_FreeEntity;
        bolt->s.eType = ET_MISSILE;
        bolt->s.weapon = WP_BLASTER;
        bolt->owner = ent;
        bolt->damage = ent->damage;
        bolt->dflags = DAMAGE_NO_KNOCKBACK | DAMAGE_HEAVY_WEAP_CLASS;        // Don't push them around, or else we are constantly re-aiming
        bolt->splashDamage = 0;
        bolt->splashRadius = 0;
        bolt->methodOfDeath = MOD_ENERGY;
        bolt->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER;
        bolt->trigger_formation = qfalse;        // don't draw tail on first frame    

        VectorSet( bolt->maxs, 1.5, 1.5, 1.5 );
        VectorScale( bolt->maxs, -1, bolt->mins );
        bolt->s.pos.trType = TR_LINEAR;
        bolt->s.pos.trTime = level.time;
        VectorCopy( start, bolt->s.pos.trBase );
        VectorScale( dir, 1100, bolt->s.pos.trDelta );
        SnapVector( bolt->s.pos.trDelta );        // save net bandwidth
        VectorCopy( start, bolt->currentOrigin);
    }
}

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