This is certainly a way to do it. However I think you'll find that drawing that many TE boxes will overflow the client. One good way is to only draw them on a single client, and only draw every second one. That gives you a good general shape of the player and an indication if your server hitboxes actually are where you think they are.
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dominik Tugend Sent: Friday, March 12, 2004 12:58 AM To: [EMAIL PROTECTED] Subject: [hlcoders] ServerSide HitBox Drawing (won't work the way it should) Hello! (At first sry 4 my bad English) I am trying to code a serverside Metamod fun plugin, it has already many standard stuff (can manipulate entities at runtime, show info about what you are aiming at (iHitGroup and so on), makeing players glow, spawn and prechache entities at runtime (a little bit buggy), list entities, ...). At the time I am trying to code a function to makes clients display specific hitboxes that are aligned to the player model. I hoped to get access to them like sub entities, so that I only would have to change some rendering properties. That should have looked like the client one engine_studio_api_s::StudioDrawHulls( ); (used when typing r_drawentities 3 in console, see "StudioModelRenderer.cpp"). But I guess this function alters the way things are drawn on the client and does not set entvars, doesn't it? If there is a way to draw the boxes like the one i searched above, please let me know. This plugin is made for working with the Counter-Strike mod. What the function does now is basically this: 1. It retrives the model pointer: studiohdr_t *pstudiohdr; pstudiohdr = (studiohdr_t*)GET_MODEL_PTR( ENT(pPlayer->pev) ); 2. Accesses HitBox and Bone data mstudiobbox_t *hitbox = (mstudiobbox_t *)((byte *)pstudiohdr + pstudiohdr->hitboxindex + (iBoxIndex * sizeof(mstudiobbox_t) )); int iBone = hitbox->bone; mstudiobone_t *bone = (mstudiobone_t *)((byte *)pstudiohdr + pstudiohdr->boneindex + (iBone * sizeof(mstudiobone_t) )); // just 4 displaying bone name 3. Gets Bone Position by using an engine function: GET_BONE_POSITION( ENT(pPlayer->pev), iBone, origin, angles ); The problem here is that the angles that are returned are completly crap. Also getting angles through BoneControllers won't work, cause the bones seem to have none set (?). 4. It transforms the angles and calulates the 8 points of the hitbox I don't know why but the boxes have to be rotated by 90 degrees here and also I can only correct the headbox according to viewangles, cause I don't get any other angles :( (also I draw the height of the origin either to low or to high (~ half of the box's height)) 5. It draws them using TE_LINE messages (by drawing a box with lines, TE_BOX can't be rotaed :( Also this makes the lines rest on their last position of course :( I'll try a summary of my questions: (If there is a answer for 1. you can forget about 2,3 and 4 please :) 1. Is there a better way to make the client draw specific hitboxes of the players (I tried to find one that worked but had no success :( (I don't mean this sv_cheats 1 r_drawentities 3 crap, I mean for example accessing the boxes like edict_t or entvars_s :) 2. How can I retrieve the correct angles (I know these must be near to the original values that are returned by GET_BONE_POSITION but I don't know how to get a pointer to the model transform data). 3. Is there a better way to draw the boxes? (Especially can they be moved realtive to the player without having to send messages all the time) 4. Should I give up? I hope this text is not too long, but I didn't find answers that could help me any further in the old hitbox posts and also google/thewavelength.net didn't help much :( I would be very thankfull if anyone out there could help me please and I also hope that I have posted to the right mailing list. Dominik _______________________________________________ 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