View Single Post
SeriousSam
Senior Member
Join Date: Aug 2009
Location: Bulgaria
Old 04-25-2011 , 20:45   Re: How to change Sub-Model on player model?
Reply With Quote #34

Sorry for bumping so soon, but I kind of found out what was bugging me. Arkshine, I think that you might have a mistake here:

Quote:
Originally Posted by Arkshine View Post
Yes.

It doesn't matter how many bodygroup you have, it's linear.

Group1

0 - submodel 1
1 - submodel 2

Group2

2 - submodel 3
3 - submodel 4

etc..

To get the second submodel of the group2, just use pev_body with 3 as value.
I made a model for testing purposes with 2 bodigroups. First bodygroup - 2 submodels. Second bodygroup - 4 submodels. This results in 8 possible combinations of all submodels.

Then I tried cycling between the submodels with pev_body. Following what you said, pev_body 0 and 1 should give the 2 submodels from the first group, and pev_body 2 to 5 should give the 4 submodels from the second group. But it doesn't work this way. In fact, from 2 to 5 gives combinations from both bodygroups, but not all possible combinations. Then I realized - pev_body is not the number of one submodel, but the number of combination from all possible combinations with each submodels in all groups. In other words, 2 submodels in 1st group x 4 submodels in 2nd group = 8 combinations. Then I tried cycling pev_body from 0 to 7, and this gave me all possible combinations from both groups.

Now I only need to find out how to calculate what number to give to pev_body to get the combination that I want. Seems like SetBodygroup and GetBodygroup in HLSDK in animation.cpp do just that, but they are too hard for me to understand, can you please translate them into pawn code for me?
__________________

Last edited by SeriousSam; 04-25-2011 at 21:24.
SeriousSam is offline
Send a message via Skype™ to SeriousSam