Raised This Month: $12 Target: $400
 3% 

Some pev_body information


Post New Thread Reply   
 
Thread Tools Display Modes
gabuch2
AlliedModders Donor
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 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
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
Junior 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 (Very lazy, tbh)
Avatar source: https://bit.ly/3BAk19g
Discord: kww#9951

Last edited by kww; 09-14-2022 at 00:11. Reason: Restore to previous version.
kww is offline
okbede_123
Member
Join Date: May 2019
Old 05-11-2023 , 23:49   Re: Some pev_body information
Reply With Quote #37

Quote:
Originally Posted by kww View Post
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
Hello. I have a question. If i have more if groupbody like hat_id, example backpack_id. So if i want a model player have hat id and backpack id so what is recipe it is?
okbede_123 is offline
SVC
Junior Member
Join Date: Mar 2021
Old 05-18-2023 , 01:48   Re: Some pev_body information
Reply With Quote #38

Quote:
Originally Posted by okbede_123 View Post
Hello. I have a question. If i have more if groupbody like hat_id, example backpack_id. So if i want a model player have hat id and backpack id so what is recipe it is?
Each bodygroup have a base param that tell the engine from where it starts (to use for the "pev->body" var).

So, let's say you have a model with 3 bodygroups, like:
Spoiler


So, let's do it we manually to see:
Spoiler


On the other hand, I've make this stock to do the job more easily (port of SetBodyGroup from HLSDK):
Spoiler


Finally, i've upload a modified version of the model used on this thread, so you can check for yourself
Attached Files
File Type: zip svc.zip (2.13 MB, 68 views)

Last edited by SVC; 05-18-2023 at 11:40.
SVC 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 10:46.


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