Raised This Month: $344 Target: $400
 86%   Almost there!

Some pev_body information


Post New Thread Reply   
 
Thread Tools Display Modes
gabuch2
Veteran Member
Join Date: Mar 2011
Location: Chile
Old 05-29-2020 , 18:59   Re: Some pev_body information
Reply With Quote #31

Quote:
Originally Posted by .DeeD. View Post
It's there a way to add models split into parts as a submodel? Merging them into one smd doesn't work because of the amount of vertices error.
Yes, just add multiple .smd files as different body groups.

That's how many high-polygon models do it to get around the vertex limit.
__________________
gabuch2 is online now
.DeeD.
New Member
Join Date: May 2020
Old 05-29-2020 , 23:58   Re: Some pev_body information
Reply With Quote #32

Quote:
Originally Posted by Gabe Iggy View Post
Yes, just add multiple .smd files as different body groups.
Thanks for the answer. I manage to do it the way you said plus adding "blank" as the first submodel to see the different models correctly by changing the parts. The problem is that I don't know how to set them since it has more than one body group. I think it's not the same as in the case of the models that have only one SMD = one body group.
.DeeD. is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-15-2020 , 11:50   Re: Some pev_body information
Reply With Quote #33

Quote:
Originally Posted by .DeeD. View Post
Thanks for the answer. I manage to do it the way you said plus adding "blank" as the first submodel to see the different models correctly by changing the parts. The problem is that I don't know how to set them since it has more than one body group. I think it's not the same as in the case of the models that have only one SMD = one body group.
Try this:
PHP Code:
/**
 * Calculates model body index from given parameters.
 * 
 * @param parts  Model part indexes from each group
 * @param sizes  Each group's sizes
 * @param count  Total amount of groups
 * @return       Body index
 */
stock CalculateModelBody(const parts[], const sizes[], count)
{
    new 
body;

    while (
count--)
    {
        if (
sizes[count] == 1)
            continue;
        
        new 
temp parts[count];

        for (new 
0counti++)
            
temp *= sizes[i];

        
body += temp;
    }

    return 
body;

Example usage:
PHP Code:
// Let's use HL soldier model hgrunt.mdl
entity_set_model(entity"models/player/hgrunt.mdl");

// hgrunt.mdl has 3 model part groups:
new groupCount 3;

// By inspecting hgrunt.mdl via HLMV we can see it has these model groups and parts:
// body    (1 part)
// heads   (4 parts)
// weapons (3 parts)
new groupSizes[] =
{
    
1// Size of 1st model part group (body)
    
4// Size of 2nd model part group (heads)
    
3  // Size of 3rd model part group (weapons)
};

// Now define which parts we want to use (counting starts from zero)
new modelParts[] =
{
    
0// 1st (and only) part in body group
    
2// 3rd part in heads group (balaclava)
    
1// 2nd part in weapons group (shotgun)
};

// Let's calculate body and set it for entity
new body CalculateModelBody(modelPartsgroupSizesgroupCount);
entity_set_int(entityEV_INT_bodybody); 
__________________
hleV is offline
AdrenalinesWrath
Junior Member
Join Date: Aug 2017
Old 03-01-2022 , 18:44   Re: Some pev_body information
Reply With Quote #34

add another information about pev_body,
is that there is a textures count limitation! 100 textures to be exact.
__________________
"True Strength's keeping everything together, while everyone expects you to fall apart."
AdrenalinesWrath is offline
MrArni
New Member
Join Date: Mar 2019
Old 09-12-2022 , 12:05   Re: Some pev_body information
Reply With Quote #35

Абсолютно не верное решение автора для получения индекса выбранных суб моделей. Ищи решение по-новой, оно куда проще и понятней...

Screenshot

Last edited by MrArni; 09-12-2022 at 12:07.
MrArni is offline
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 09-13-2022 , 23:56   Re: Some pev_body information
Reply With Quote #36

Imagine, you have 3 groups, so:
needed body from group 1 + needed body from group 2 + needed body from group 3 = needed bodygroup to use
also, max bodygroup you can use is 255
__________________
Now working on: Side Weapons
Avatar source: https://bit.ly/3BAk19g

Last edited by kww; 09-14-2022 at 00:11. Reason: Restore to previous version.
kww is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:39.


Powered by vBulletin®
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Theme made by Freecode