Raised This Month: $342 Target: $400
 85%   Almost there!

Some pev_body information


Post New Thread Reply   
 
Thread Tools Display Modes
Gabe Iggy
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.
__________________
Gabe Iggy is offline
.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
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 22:06.


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