GravGun transparency mod

MoD

Newbie
Joined
May 16, 2003
Messages
202
Reaction score
0
Inspiration

being a newbie coder as I am, it took me a lot of trial and error, and eventually hellcat_ from #hl2coding figured it out for me, still was a fun project...

Code:
//-----------------------------------------------------------------------------
// Purpose: 
// Input  : *pObject - 
//-----------------------------------------------------------------------------
bool CWeaponPhysCannon::AttachObject( CBaseEntity *pObject, const Vector &vPosition )
{
...
...
...
// make it 50% transparent - MoD
		pObject->m_nRenderMode = kRenderTransColor;
		pObject->SetRenderColor( 255, 255, 255, 128 );
		pObject->m_nRenderFX = kRenderFxNone; ;
	return true;
}

Code:
void CWeaponPhysCannon::DetachObject( bool playSound, bool wasLaunched )
{
...
...
...
// MoD - make it visible again
		pObject->m_nRenderMode = kRenderNormal;
		pObject->SetRenderColor( 255, 255, 255, 255 );
		pObject->m_nRenderFX = kRenderFxNone; ;
}
 

Attachments

  • d1_town_010003.jpg
    d1_town_010003.jpg
    37.4 KB · Views: 320
  • d1_town_010004.jpg
    d1_town_010004.jpg
    37.9 KB · Views: 328
Just to let you know, you have to many semi-colons in your code :)

Interesting idea though :D
 
that is actually really awsome, I always was irritated by those damn large objects and not being able to see.... I need to learn C++ :(
oldfaq
 
Are you sure you want to set the renderfx?

Extra semi-colons are not dangerous, at least in this case.
 
Back
Top