Hi,
I currently have a problem on my local (sv_lan 1) server ONLY with the
muzzleflash and tracers. For whatever reason, when i switch to
thirdperson and shoot, my muzzle flash gets displayed at 3 different
position, the right position (my gun's world model "muzzle"
attachement), forward from the gun about 50 units, and at my feet. On
top of that, the tracers start from the second position (50 forward from
my gun's "muzzle" attachement).

I am at a loss to explain this, it is ONLY happening in third person,
the muzzleflash works fine when seen on other models in multiplayer
games as you can see in the video we put together for our mod at
www.calibermod.com . Yet, in third person, it's not working right. I've
ran through debug before and put a breakpoint in my dll where the actual
muzzle gets created, and it only gets called once per frame... What is
the mystery code producing the 2 additional muzzles and why are my
tracers and the right muzzle flash not being attached correctly in third
person on my own model?

This is the code I use in void C_BaseAnimating::ProcessMuzzleFlashEvent():
if ( m_Attachments.Count() > 0 )
       {
           Vector attachOrigin;
           QAngle attachAngles;
           GetAttachment( LookupAttachment("muzzle"), attachOrigin,
attachAngles );

           Vector forward, right, up;

           AngleVectors( attachAngles, &forward, &right, &up );

           attachOrigin += ( (5.0 * forward) );  // make it be a little
bit ahead of the actual attachement.

           g_pEffects->MuzzleFlash( attachOrigin, attachAngles, 0.5,
MUZZLEFLASH_TYPE_DEFAULT );

           dlight_t *el = effects->CL_AllocDlight(
LIGHT_INDEX_MUZZLEFLASH + index );
           el->origin = attachOrigin;
           el->radius = random->RandomInt( 32, 64 );
           el->decay = el->radius / 0.05f;
           el->die = gpGlobals->curtime + 0.05f;
           el->color.r = 255;
           el->color.g = 192;
           el->color.b = 64;
           el->color.exponent = 5;

       }

Also, another question while we're at it, I have a networked entity
derived from CBaseAnimating wich i attach to my player and use
FollowEntity to get it to stay with him (a personal round shield.) The
shield itself is a model and gets rendered fine and so on, but it won't
animate. The model has a "idle" animation, wich i am trying to get to
loop/play without much success with the following code:
ResetSequence(LookupSequence("idle"));
SetCycle( 0 );
In the function that creates my entity after it has been attached, the
animation is supposed to make it rotate but my model never rotates :/ I
just checked and the animation is set to loop itself, i should note that
it doesnt work wether or not i call "SetCycle( 0 );".

Thanks in advance
Imperio59


-- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.6.2 - Release Date: 04/03/2005



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



Reply via email to