you'll never be able to hit the weapon itself, or be able to make the p_ model able to take damage or be checked against.
the way it attaches to the model (look at StudioModelRenderer.cpp in the client) is by reading a value on the player, saying WHAT model to use for a p_ model, and then it loads the model in the studio code, and meshes it right onto the player. thats why the player models have the animations per weapon. the ONLY thing you can do, is define a hitbox on the player, for say, the hand, and then reference the *PLAYER* directly, and check that hitbox numebr, which you would define when you compile the model. but theres no way to actually test the weapon directly. same thing works for the view model, its not referenced by the weapon on the server AT ALL. the value is set on the player itself, and the model is drawn. the only way to access the view models entity is on the client with the cdll command GetViewModel. -omega Blackened Interactive http://www.nofadz.com/blackened ----- Original Message ----- From: "Georges Giroux" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, November 21, 2001 1: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 > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Reedbeta > Sent: Tuesday, November 20, 2001 12:07 AM > To: [EMAIL PROTECTED] > Subject: RE: [hlcoders] Hitting a weapon p model > > > I'd advise you to start looking at the Deploy functions of weapons. These > are > the only places where their p-models are referenced in the weapon code > (except > for precaching), so if you trace the execution path through them, they might > lead you someplace where you can make the changes you want. > > --- Georges Giroux <[EMAIL PROTECTED]> wrote: > > Do you have a hint where I could start to look for this code to modify the > > weapon system? > > Or basically would I have to transform weapons in CBaseMonsters > > instead? The only other option I have is to integrate these things > > directly into the player models, but that would leave little room > > to do things like weapon switching. > > > > Georges > > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED]]On Behalf Of Reedbeta > > Sent: Monday, November 19, 2001 7:06 PM > > To: [EMAIL PROTECTED] > > Subject: Re: [hlcoders] Hitting a weapon p model > > > > > > No...as David just explained, it's because the p-model isn't represented > by > > an > > entity (like v-model and w-model are), it's just tacked onto the player > > model > > during the render process. So you really can't hit it without making some > > major changes to the weapon system. But those changes are quite possible > > given > > the code that is exposed in SDK 2.1 and 2.2. > > > > --- Gareth Llewellyn <[EMAIL PROTECTED]> wrote: > > > Urm, I may be wrong, but does the problem lie with the hitboxes on the P > > > weapon? > > > > > > Gareth Llewellyn > > > InNeedOfTherepy > > > -Project Leader > > > -Lead Coder > > > -Lead Mapper > > > Half-Life The Beginning > > > www.HLTB.co.uk > > > > > > _______________________________________________ > > > To unsubscribe, edit your list preferences, or view the list archives, > > please > > > visit: > > > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > > > > > > > > __________________________________________________ > > Do You Yahoo!? > > Find the one for you at Yahoo! Personals > > http://personals.yahoo.com > > _______________________________________________ > > 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 > > > > > __________________________________________________ > Do You Yahoo!? > Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. > http://geocities.yahoo.com/ps/info1 > _______________________________________________ > 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

