Ok, for those who dont know the classes work like this, the class to the left is a subclass of the one to the right :
CBasePlayerWeapon -> CBasePlayerItem -> CBaseAnimating -> CBaseDelay -> CBaseEntity CBaseMonster -> CBaseToggle -> CBaseAnimating -> CBaseDelay -> CBaseEntity Now, having looked at these classes I can see the following : CBasePlayerWeapon when it has a TraceAttack(..) called on it drops back to the CBaseEntity version of the function, and if pev->takedamage == false just returns. Also, no where in that list of functions are the functions TakeDamage(...) and TakeHealth(..) defined. CBaseMonster on the other hand has an overridden function for TraceAttack(...) and also is the first class to define a TakeDamage and a TakeHealth(..) set of functions. Those 2 Take* functions are where all the damage taking / dealing with happens, so when you have a CBasePlayerWeapon class it probably has it's pev->takedamage either set to 0 or when the pev is setup it's just set to zero by default, and CBasePlayerWeapon is also short the two handing function for damage. So, in theory, if you set pev->takedamage to DAMAGE_YES (or DAMAGE_AIM depending if you want auto aim to pick it up or not) and defined your own Take*(...) functions the weapons should start taking damage... If they dont you'll have to look at the other differences after the two classes split away from CBaseAnimating and see what else you can spot (I'm too tired atm to look for myself as I'm about to wander to bed) Hope that helps, and good luck with it :) ----- Original Message ----- From: "Georges Giroux" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, November 21, 2001 6:12 AM Subject: RE: [hlcoders] Hitting a weapon p model > Hello, > > I've checked things out a bit more, and I still cannot make > a CBasePlayerItem get hit by bullets...it's as if it doesn't register > as an entity that can get hit. Basically, I've modified > temporarily the GiveNamedItem function in CPlayer so that > the item has a solid bounding box and a model. I've also > cleared out the player->pev->weaponmodel to zero so that no pmodels > are rendered on the player, and the CBasePlayerWeapon calls > SET_MODEL with a p_model (so that all the hitboxes are present > with the bones). No matter what I do, it will not register > any hits. > > I've also tried this: basically, instead of an item, I spawn > a CBaseMonster derived class and assign it to the player > with movetype == FOLLOW and pev->aiment and pev->owner set to the player. > The monster uses the same pmodel as the weapon. This works perfectly, > all hits actually get registered on the "monster" weapon. The thing > I've been tearing my eyes out to figure out is why the CBaseMonster > class registers hits and CBasePlayerWeapon doesn't...I mean, in both > cases I assign pev->solid to a bbox, I do a SetOrigin, a SetSize... > but the CBasePlayerWeapon never registers any hits! Those two classes > cannot be that different, since they both derive from CBaseAnimating. > Does anyone have any clue about this behavior? Will I basically have > to recode my weapons to be CBaseMonsters instead? > > Georges > _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders

