What is this the h4x0r from vegas. Or another cs_siege. I'd APC suicide  myself 
to n0thing. I still goat more fury for zit pharms.

i miss talent. rip n0thing


Sent from my iPhone

On 2011-08-19, at 5:03 PM, hlcoders-requ...@list.valvesoftware.com wrote:

> Send hlcoders mailing list submissions to
>    hlcoders@list.valvesoftware.com
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>    http://list.valvesoftware.com/mailman/listinfo/hlcoders
> or, via email, send a message with subject or body 'help' to
>    hlcoders-requ...@list.valvesoftware.com
> 
> You can reach the person managing the list at
>    hlcoders-ow...@list.valvesoftware.com
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of hlcoders digest..."
> 
> 
> Today's Topics:
> 
>   1. Re: Getting an attachment position on client side view    model
>      (Michael Kramer)
>   2. Re: Getting an attachment position on client side view    model
>      (Asher Baker)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Fri, 19 Aug 2011 13:49:04 -0600
> From: Michael Kramer <gameexpertmas...@gmail.com>
> To: Discussion of Half-Life Programming
>    <hlcoders@list.valvesoftware.com>
> Subject: Re: [hlcoders] Getting an attachment position on client side
>    view    model
> Message-ID:
>    <calbphhgwnnsv+ppwmr4_ntm3jxxd5kzwmnsmdj35bfj0u3m...@mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> is pEntity of type CBaseViewModel?
> 
> if not, try casting pEntity to CBaseViewModel
> 
> On Fri, Aug 19, 2011 at 12:55 PM, Ryan Sheffer <darksk...@gmail.com> wrote:
> 
>> Thanks for the code, but unfortunately I need a way to get the attachment
>> without using the beams attachment point stuff.
>> 
>> 
>> On Thu, Aug 18, 2011 at 11:13 PM, Michael Kramer <
>> gameexpertmas...@gmail.com> wrote:
>> 
>>> When I drew a beam for one of my weapons I used the following:
>>> 
>>> pBeam->PointEntInit( endPos, this );
>>> pBeam->SetEndAttachment( 1 );
>>> pBeam->SetWidth( width / 4.0f );
>>> pBeam->SetEndWidth( width );
>>> 
>>> However this was serverside code, But I did then have it also spark on the
>>> muzzle, so I did:
>>> CBaseViewModel *pViewModel = pOwner->GetViewModel();
>>> pViewModel->GetAttachment(LookupAttachment("muzzle"),origin,angles);
>>> g_pEffects->Sparks(origin);
>>> 
>>> 
>>> Below is the entire drawBeam function I used:
>>> 
>>> CBasePlayer *pOwner = ToBasePlayer( GetOwner() );
>>> CBaseViewModel *pViewModel = pOwner->GetViewModel();
>>> 
>>> if ( pOwner == NULL )
>>> return;
>>> 
>>> //Check to store off our view model index
>>> if ( pViewModel == NULL )
>>> {
>>> CBaseViewModel *vm = pOwner->GetViewModel();
>>> if ( vm )
>>> {
>>> m_hViewModel.Set( vm );
>>> }
>>> }
>>> #ifndef CLIENT_DLL
>>> //Draw a tracer down the middle
>>> UTIL_Tracer( startPos, endPos, 0, TRACER_DONT_USE_ATTACHMENT, 6500,
>>> true, "GaussTracer" );
>>> 
>>> //Draw the main beam shaft
>>> CBeam *pBeam = CBeam::BeamCreate( GAUSS_BEAM_SPRITE, width );
>>> 
>>> if ( useMuzzle )
>>> {
>>> pBeam->PointEntInit( endPos, this );
>>> pBeam->SetEndAttachment( 1 );
>>> pBeam->SetWidth( width / 4.0f );
>>> pBeam->SetEndWidth( width );
>>> }
>>> 
>>> else
>>> {
>>> pBeam->SetStartPos( startPos );
>>> pBeam->SetEndPos( endPos );
>>> pBeam->SetWidth( width );
>>> pBeam->SetEndWidth( width / 4.0f );
>>> }
>>> 
>>> pBeam->SetBrightness( 255 );
>>> pBeam->SetColor( 255, 145+random->RandomInt( -16, 16 ), 0 );
>>> pBeam->RelinkBeam();
>>> pBeam->LiveForTime( 5.1f );
>>> 
>>> 
>>> On Thu, Aug 18, 2011 at 11:11 PM, Ryan Sheffer <darksk...@gmail.com>wrote:
>>> 
>>>> Hey coders!
>>>> 
>>>> I came across a nasty little issue and I thought maybe somebody has come
>>>> across this before.
>>>> I am trying to create a client side beam from the muzzle of the players
>>>> view model to where the bullet impacts, but I cannot get the attachment
>>>> position for the muzzle on the view model.
>>>> 
>>>> Here is the code I am using for getting the attachment:
>>>> 
>>>>    int    attachment = pEntity->LookupAttachment( "muzzle" );
>>>>    pEntity->GetAttachment( attachment, vecAttachment, angAttachment );
>>>> 
>>>> pEntity is the view model.
>>>> This is the same way I saw it done on the physcannons client side code.
>>>> The position it gets appears to be somewhere close to the origin of the
>>>> map but the coordinates are not exactly 0, 0, 0. One way to fix the 
>>>> position
>>>> is to give myself a weapon_physcannon and then when I switch back to my gun
>>>> the attachment position is where it should be, from the muzzle. I don't see
>>>> anything special in the weapon_physcannon's code so I am baffled.
>>>> 
>>>> Some things to note:
>>>> - This is a client side entity, client side code
>>>> - The attachment on the model looks fine in the model viewer
>>>> 
>>>> So any help would be wonderful, I am just digging away at the debugging
>>>> trying to find the issue but nothing sticks out, only the fact that having 
>>>> a
>>>> physcannon at the same time fixes the problem.
>>>> 
>>>> Here is the full code for the beam just in case:
>>>> 
>>>> void C_WeaponSonicRifle::CreateShotBeam(void)
>>>> {
>>>>    CBasePlayer *pOwner = ToBasePlayer( GetOwner() );
>>>> 
>>>>    if ( pOwner == NULL )
>>>>        return;
>>>> 
>>>>    BeamInfo_t beamInfo;
>>>>    C_BaseAnimating *pEntity = NULL;
>>>>    trace_t tr;
>>>> 
>>>>    Vector    vecAttachment, vecCrosshair, vecDir;
>>>>    QAngle    angAttachment;
>>>> 
>>>>    if ( IsCarriedByLocalPlayer() && !::input->CAM_IsThirdPerson() )
>>>>    {
>>>>        pEntity = pOwner->GetViewModel();
>>>>        vecDir = pOwner->GetAutoaimVector(AUTOAIM_5DEGREES);
>>>>    }
>>>>    else
>>>>    {
>>>>        pEntity = this;
>>>>        vecDir = pOwner->GetAutoaimVector(AUTOAIM_5DEGREES);
>>>>    }
>>>> 
>>>>    pEntity->PushAllowBoneAccess( true, true, "sonic rifle" );
>>>> 
>>>>    int    attachment = pEntity->LookupAttachment( "muzzle" );
>>>>    pEntity->GetAttachment( attachment, vecAttachment, angAttachment );
>>>> 
>>>>    pEntity->PopBoneAccess( "sonic rifle" );
>>>> 
>>>>    vecCrosshair = pOwner->Weapon_ShootPosition();
>>>>    UTIL_TraceLine(vecCrosshair, vecCrosshair + (vecDir *
>>>> MAX_TRACE_LENGTH), MASK_SONICBEAMS, pOwner, COLLISION_GROUP_NONE, &tr);
>>>> 
>>>>    beamInfo.m_pStartEnt = NULL;
>>>>    beamInfo.m_pEndEnt = NULL;
>>>> 
>>>>    //beamInfo.m_nType = TE_BEAMPOINTS;
>>>>    beamInfo.m_vecStart = tr.endpos;
>>>>    beamInfo.m_vecEnd = vecAttachment;
>>>> 
>>>>    beamInfo.m_nStartAttachment = NULL;
>>>>    beamInfo.m_nEndAttachment = NULL;
>>>> 
>>>>    beamInfo.m_pszModelName = "sprites/laserbeam.vmt";
>>>>    beamInfo.m_flHaloScale = 0.0f;
>>>>    beamInfo.m_flLife = 2.5f;
>>>> 
>>>>    beamInfo.m_flWidth = 3.0f;
>>>>    beamInfo.m_flEndWidth = 3.0f;
>>>> 
>>>>    beamInfo.m_flFadeLength = 0.0f;
>>>>    beamInfo.m_flAmplitude = 0;
>>>> 
>>>>    beamInfo.m_flBrightness = 255.0;
>>>> 
>>>>    beamInfo.m_flSpeed = 1.0f;
>>>>    beamInfo.m_nStartFrame = 0.0;
>>>>    beamInfo.m_flFrameRate = 30.0;
>>>> 
>>>>    beamInfo.m_flRed = 255;
>>>>    beamInfo.m_flGreen = 255;
>>>>    beamInfo.m_flBlue = 255;
>>>> 
>>>>    beamInfo.m_nSegments = 4;
>>>>    beamInfo.m_bRenderable = true;
>>>>    beamInfo.m_nFlags = (FBEAM_SHADEIN | FBEAM_SHADEOUT | FBEAM_FADEOUT);
>>>> 
>>>>    beams->CreateBeamPoints( beamInfo );
>>>> }
>>>> 
>>>> Thanks guys :)
>>>> 
>>>> --
>>>> ~Ryan ( skidz )
>>>> 
>>>> _______________________________________________
>>>> To unsubscribe, edit your list preferences, or view the list archives,
>>>> please visit:
>>>> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>>>> 
>>>> 
>>>> 
>>> 
>>> _______________________________________________
>>> To unsubscribe, edit your list preferences, or view the list archives,
>>> please visit:
>>> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>>> 
>>> 
>>> 
>> 
>> 
>> --
>> ~Ryan ( skidz )
>> 
>> _______________________________________________
>> To unsubscribe, edit your list preferences, or view the list archives,
>> please visit:
>> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>> 
>> 
>> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: 
> <http://list.valvesoftware.com/mailman/private/hlcoders/attachments/20110819/338bd670/attachment-0001.html>
> 
> ------------------------------
> 
> Message: 2
> Date: Fri, 19 Aug 2011 23:03:08 +0100
> From: Asher Baker <asher...@gmail.com>
> To: Discussion of Half-Life Programming
>    <hlcoders@list.valvesoftware.com>
> Subject: Re: [hlcoders] Getting an attachment position on client side
>    view    model
> Message-ID:
>    <ca+q08fefzekcxkzucnpcsizita0tt2cfnoo-cbpz5oocmvb...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Complete guess, but is it possible the position you are getting is
> relative to the entity origin instead of world? Would explain the
> small values.
> 
> On Fri, Aug 19, 2011 at 8:49 PM, Michael Kramer
> <gameexpertmas...@gmail.com> wrote:
>> is pEntity of type?CBaseViewModel?
>> if not, try casting pEntity to CBaseViewModel
>> 
>> On Fri, Aug 19, 2011 at 12:55 PM, Ryan Sheffer <darksk...@gmail.com> wrote:
>>> 
>>> Thanks for the code, but unfortunately I need a way to get the attachment
>>> without using the beams attachment point stuff.
>>> 
>>> On Thu, Aug 18, 2011 at 11:13 PM, Michael Kramer
>>> <gameexpertmas...@gmail.com> wrote:
>>>> 
>>>> When I drew a beam for one of my weapons I used the following:
>>>> pBeam->PointEntInit( endPos, this );
>>>> pBeam->SetEndAttachment( 1 );
>>>> pBeam->SetWidth( width / 4.0f );
>>>> pBeam->SetEndWidth( width );
>>>> However this was serverside code, But I did then have it also spark on
>>>> the muzzle, so I did:
>>>> CBaseViewModel *pViewModel = pOwner->GetViewModel();
>>>> pViewModel->GetAttachment(LookupAttachment("muzzle"),origin,angles);
>>>> g_pEffects->Sparks(origin);
>>>> 
>>>> Below is the entire drawBeam function I used:
>>>> CBasePlayer *pOwner = ToBasePlayer( GetOwner() );
>>>> CBaseViewModel *pViewModel = pOwner->GetViewModel();
>>>> if ( pOwner == NULL )
>>>> return;
>>>> //Check to store off our view model index
>>>> if ( pViewModel == NULL )
>>>> {
>>>> CBaseViewModel *vm = pOwner->GetViewModel();
>>>> if ( vm )
>>>> {
>>>> m_hViewModel.Set( vm );
>>>> }
>>>> }
>>>> #ifndef CLIENT_DLL
>>>> //Draw a tracer down the middle
>>>> UTIL_Tracer( startPos, endPos, 0, TRACER_DONT_USE_ATTACHMENT, 6500, true,
>>>> "GaussTracer" );
>>>> //Draw the main beam shaft
>>>> CBeam *pBeam = CBeam::BeamCreate( GAUSS_BEAM_SPRITE, width );
>>>> if ( useMuzzle )
>>>> {
>>>> pBeam->PointEntInit( endPos, this );
>>>> pBeam->SetEndAttachment( 1 );
>>>> pBeam->SetWidth( width / 4.0f );
>>>> pBeam->SetEndWidth( width );
>>>> }
>>>> else
>>>> {
>>>> pBeam->SetStartPos( startPos );
>>>> pBeam->SetEndPos( endPos );
>>>> pBeam->SetWidth( width );
>>>> pBeam->SetEndWidth( width / 4.0f );
>>>> }
>>>> pBeam->SetBrightness( 255 );
>>>> pBeam->SetColor( 255, 145+random->RandomInt( -16, 16 ), 0 );
>>>> pBeam->RelinkBeam();
>>>> pBeam->LiveForTime( 5.1f );
>>>> 
>>>> On Thu, Aug 18, 2011 at 11:11 PM, Ryan Sheffer <darksk...@gmail.com>
>>>> wrote:
>>>>> 
>>>>> Hey coders!
>>>>> 
>>>>> I came across a nasty little issue and I thought maybe somebody has come
>>>>> across this before.
>>>>> I am trying to create a client side beam from the muzzle of the players
>>>>> view model to where the bullet impacts, but I cannot get the attachment
>>>>> position for the muzzle on the view model.
>>>>> 
>>>>> Here is the code I am using for getting the attachment:
>>>>> 
>>>>> ??? int??? attachment = pEntity->LookupAttachment( "muzzle" );
>>>>> ??? pEntity->GetAttachment( attachment, vecAttachment, angAttachment );
>>>>> 
>>>>> pEntity is the view model.
>>>>> This is the same way I saw it done on the physcannons client side code.
>>>>> The position it gets appears to be somewhere close to the origin of the
>>>>> map but the coordinates are not exactly 0, 0, 0. One way to fix the 
>>>>> position
>>>>> is to give myself a weapon_physcannon and then when I switch back to my 
>>>>> gun
>>>>> the attachment position is where it should be, from the muzzle. I don't 
>>>>> see
>>>>> anything special in the weapon_physcannon's code so I am baffled.
>>>>> 
>>>>> Some things to note:
>>>>> - This is a client side entity, client side code
>>>>> - The attachment on the model looks fine in the model viewer
>>>>> 
>>>>> So any help would be wonderful, I am just digging away at the debugging
>>>>> trying to find the issue but nothing sticks out, only the fact that 
>>>>> having a
>>>>> physcannon at the same time fixes the problem.
>>>>> 
>>>>> Here is the full code for the beam just in case:
>>>>> 
>>>>> void C_WeaponSonicRifle::CreateShotBeam(void)
>>>>> {
>>>>> ??? CBasePlayer *pOwner = ToBasePlayer( GetOwner() );
>>>>> 
>>>>> ??? if ( pOwner == NULL )
>>>>> ??? ??? return;
>>>>> 
>>>>> ??? BeamInfo_t beamInfo;
>>>>> ??? C_BaseAnimating *pEntity = NULL;
>>>>> ??? trace_t tr;
>>>>> 
>>>>> ??? Vector??? vecAttachment, vecCrosshair, vecDir;
>>>>> ??? QAngle??? angAttachment;
>>>>> 
>>>>> ??? if ( IsCarriedByLocalPlayer() && !::input->CAM_IsThirdPerson() )
>>>>> ??? {
>>>>> ??? ??? pEntity = pOwner->GetViewModel();
>>>>> ??? ??? vecDir = pOwner->GetAutoaimVector(AUTOAIM_5DEGREES);
>>>>> ??? }
>>>>> ??? else
>>>>> ??? {
>>>>> ??? ??? pEntity = this;
>>>>> ??? ??? vecDir = pOwner->GetAutoaimVector(AUTOAIM_5DEGREES);
>>>>> ??? }
>>>>> 
>>>>> ??? pEntity->PushAllowBoneAccess( true, true, "sonic rifle" );
>>>>> 
>>>>> ??? int??? attachment = pEntity->LookupAttachment( "muzzle" );
>>>>> ??? pEntity->GetAttachment( attachment, vecAttachment, angAttachment );
>>>>> 
>>>>> ??? pEntity->PopBoneAccess( "sonic rifle" );
>>>>> 
>>>>> ??? vecCrosshair = pOwner->Weapon_ShootPosition();
>>>>> ??? UTIL_TraceLine(vecCrosshair, vecCrosshair + (vecDir *
>>>>> MAX_TRACE_LENGTH), MASK_SONICBEAMS, pOwner, COLLISION_GROUP_NONE, &tr);
>>>>> 
>>>>> ??? beamInfo.m_pStartEnt = NULL;
>>>>> ??? beamInfo.m_pEndEnt = NULL;
>>>>> 
>>>>> ??? //beamInfo.m_nType = TE_BEAMPOINTS;
>>>>> ??? beamInfo.m_vecStart = tr.endpos;
>>>>> ??? beamInfo.m_vecEnd = vecAttachment;
>>>>> 
>>>>> ??? beamInfo.m_nStartAttachment = NULL;
>>>>> ??? beamInfo.m_nEndAttachment = NULL;
>>>>> 
>>>>> ??? beamInfo.m_pszModelName = "sprites/laserbeam.vmt";
>>>>> ??? beamInfo.m_flHaloScale = 0.0f;
>>>>> ??? beamInfo.m_flLife = 2.5f;
>>>>> 
>>>>> ??? beamInfo.m_flWidth = 3.0f;
>>>>> ??? beamInfo.m_flEndWidth = 3.0f;
>>>>> 
>>>>> ??? beamInfo.m_flFadeLength = 0.0f;
>>>>> ??? beamInfo.m_flAmplitude = 0;
>>>>> 
>>>>> ??? beamInfo.m_flBrightness = 255.0;
>>>>> 
>>>>> ??? beamInfo.m_flSpeed = 1.0f;
>>>>> ??? beamInfo.m_nStartFrame = 0.0;
>>>>> ??? beamInfo.m_flFrameRate = 30.0;
>>>>> 
>>>>> ??? beamInfo.m_flRed = 255;
>>>>> ??? beamInfo.m_flGreen = 255;
>>>>> ??? beamInfo.m_flBlue = 255;
>>>>> 
>>>>> ??? beamInfo.m_nSegments = 4;
>>>>> ??? beamInfo.m_bRenderable = true;
>>>>> ??? beamInfo.m_nFlags = (FBEAM_SHADEIN | FBEAM_SHADEOUT |
>>>>> FBEAM_FADEOUT);
>>>>> 
>>>>> ??? beams->CreateBeamPoints( beamInfo );
>>>>> }
>>>>> 
>>>>> Thanks guys :)
>>>>> 
>>>>> --
>>>>> ~Ryan ( skidz )
>>>>> 
>>>>> _______________________________________________
>>>>> To unsubscribe, edit your list preferences, or view the list archives,
>>>>> please visit:
>>>>> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>>>>> 
>>>>> 
>>>> 
>>>> 
>>>> _______________________________________________
>>>> To unsubscribe, edit your list preferences, or view the list archives,
>>>> please visit:
>>>> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>>>> 
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> ~Ryan ( skidz )
>>> 
>>> _______________________________________________
>>> To unsubscribe, edit your list preferences, or view the list archives,
>>> please visit:
>>> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>>> 
>>> 
>> 
>> 
>> _______________________________________________
>> To unsubscribe, edit your list preferences, or view the list archives,
>> please visit:
>> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>> 
>> 
>> 
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives, please 
> visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
> 
> 
> 
> End of hlcoders Digest, Vol 5, Issue 27
> ***************************************

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

Reply via email to