Some pev_body information
1 Attachment(s)
pev_body
is a value that tells the game which sub-model should be visible. This can be extremely powerful with more player models, except nobody seems to have used this feature to its potential yet. As of now and as far as I know, CS only uses this to display bomb on the player. What can be done with this value? For example, you can put all of the custom models and hats on your server into a single model. This has a lot of pros over the cons (below). How do you change the combinations? Let's say you have two groups of sub-models like me - models and hats. THIS IS NOT HOW IT WORKS: Model1 - ID: 0 Model2 - ID: 1 Model3 - ID: 2 Hat1 - ID: 3 Hat2 - ID: 4 Hat3 - ID: 5 THIS IS HOW IT WORKS: Model1 - ID: 0 Model2 - ID: 1 Model3 - ID: 2 Hat1 - ID: 0 Hat2 - ID: 1 Hat3 - ID: 2 For only two groups, you want to use this to get the pev_body number you need: Code:
So let's say you want to give the player Model 2 with Hat 3. pev_body = 2 * 3 + 1 = 7 I haven't tried working with more groups yet, I'll report back once I do. What can be done with this? You can for example make a plugin for full character customization. Create a model with body parts such as face, hair, chest size, etc. and allow the player to choose what suits him. Pros: - All models are in one larger file, which gives a better "feeling" when downloading - A great way to reduce the amount of precached files on your server - The file size is a lot smaller than all the models one by one together, because the duplicates (model information, animations etc) are removed - For hats and such, you don't need a 3rd party plugin to handle it (creating a new entity, setting it's origin, etc) - The model + hat is still one single entity - A lot of new possibilities Cons: - Adding more models will require a new download of the complete file - Not too easy to work with - Compiler is a bitch - The final model requires all the already existing Counter-Strike models, if you want to make hats available for standard models as well - Players won't be able to see their custom models Current problems: - Need to figure out how to add models split into parts as a submodel. Currently, it adds each part as a submodel (see the model example: group 'modely', submodels 5 and 6 - Edit: Compiler crashing when the file size is above 4 megabytes. Trying to find a way around this (splitting models) If you know how to solve any of the problems above, please let me know. Use this small plugin with the included model to see what is this feature capable of Code:
Table of values: Code:
MODEL NAME HAT PEV_BODY UPDATE Thanks for reading. HUGE UPDATE Okay, this is getting even better than I thought it would be. Animations Each model has around 120 sequences. What's funny about this is an average model has 2.3MB filesize - 2 megabytes of that are the animations. Which means if you're going to combine 5 models of size 2.3MB each, your final size will be 2MB for the animations + 5 * 300kB = 3.5MB total. Bomb and defusal kit I've implemented those in my new model. The function to get the pev_body ID is as follows: Code:
New model The new model is in attachments. There are 17 models and 39 hats - total size: 11.15MB. I removed the shield animations, because they're useless for me. Two models are duplicate (my bad), because I forgot to rename the textures of these, so they just replaced the other textures. Limits The limits for combined models are: - Max 16MB filesize - Texture names sometimes need to be changed or they will be overwritten by other models - Maximum 40 sub-models per group (39 hats, because the first one is empty) Note the first HatID is no longer 0 (ID 0 is "nothing", we're setting HatID 0 for people without any hat) |
Re: Some pev_body information
Oh man.. this is cool, thanks for the tutor, i like it.
**Edited** Quote:
|
Re: Some pev_body information
That compiler looks pretty cool. Thanks for the link, I was nearly hopeless.
|
Re: Some pev_body information
Nice tutorial, thanks for making it. :D
|
Re: Some pev_body information
Post updated.
|
Re: Some pev_body information
the client dont support more than 255 bodies or combinations
|
Re: Some pev_body information
As far as I know pev_body can be integer for players and byte only for entities, or is that DoD only?
|
Re: Some pev_body information
frk_14 is right, the pev_body value is limited on CS servers.
It's probably silly of me to ask this, but is it possible to change the type to long (short would certainly suffice though) from byte using a module or directly editing a library? DoD already does this, I'm not sure whether the pev_body works only server-side or client-side as well. Sorry if it sounds stupid, I have no experience with how it works on client and server side. |
Re: Some pev_body information
You can't because it will work only on server side (you can't change clients code).
|
Re: Some pev_body information
Oh, that's a shame. I knew it's impossible to change client side without touching their game, but I had some hope that pev_body is only a server side material.
Geez. 255 combinations is still a lot, though. Enough to fit all the models from a shitty zombie plague server to one larger file. |
All times are GMT -4. The time now is 04:23. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.