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

[INC] StudioHdr - Entity Model Information


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LuqS
AlliedModders Donor
Join Date: Jun 2019
Location: Israel
Old 08-10-2021 , 16:38   [INC] StudioHdr - Entity Model Information
Reply With Quote #1

StudioHdr - Entity Model Information

Description:
StudioHdr is a SourcePawn library (.inc) that lets developers get information about entity models.


Credits:
Феникс#1337 (Phoenix): For the base code:
Spoiler

KoNLiG: For letting me scream at him while the code didn't work and crashed the server.


List of features:
Quote:
StudioHdr methodmap

Bones
• `GetBone()` - Get a specific bone object by index.
• `FindBone()` - Find bone index by name.
• Get model 'NumBones'.

Hitbox Sets
• `GetHitboxSet()` - Get a specific hitbox set object by index.
• Get model 'NumHitboxSets'.

Skin Families
• Get model 'SkinFamiliesCount'.
Spoiler


Body Parts
• `GetBodyPart()` - Get a specific body part object by index.
• `FindBodyPart()` - Find body part index by name.
• Get model 'NumBodyParts'.
Spoiler


Attachments
• `GetAttachment()` - Get a specific attachment object by index.
• `FindAttachment()` - Find an attachment index by name.
• Get model 'AttachmentCount'.
Spoiler


Pose Parameters
• `GetPoseParameter()` - Get a specific pose parameter object by index.
• `FindPoseParameter()` - Find a pose parameter index by name.
• Get model 'NumPoseParameters'.
Spoiler



Bone methodmap
• `GetName()` - Get the name of the body part.
• `GetPos()` - Get the position of the bone (relative to model).

Hitbox methodmap
• `bone` - The related bone of the specific hitbox.
• `group` - The intersection group of the specific hitbox.
bounding box, or the ends of the capsule if flCapsuleRadius > 0
• `bbmin`
• `bbmax`
• `GetAngOffsetOrientation()` - Gets the angle offset orientation.
• `flCapsuleRadius` - The radius of the capsule (if not a capsule = 0.0)

HitboxSet methodmap
• `GetHitbox()` - Get a specific hitbox object by index.
• `NumHitboxs` - Number of hitboxes in the hitbox set.

BodyPart methodmap
• `GetName()` - Get the name of the body part.
• `base` - The base value of the body part.
• `nummodels` - Number of sub-models.
Spoiler


Attachment methodmap
• `GetName()` - Get the name of the attachment.

Pose Parameter methodmap
• `GetName()` - Get the name of the pose parameter.
• `start` - The minimum value of the pose parameter.
• `end` - The maximum value of the pose parameter.
Note:
This include was tested only in CS:GO (Linux).
This should work in any source engine based game (i am pretty sure).
If you want to support other games (and you can test), please write here below or add me on Discord!


Links:

GitHub Repository
__________________
You like my work? You want to support?
Consider Donating!

Need signatures / offsets for CS:GO?
Contact me:

Last edited by LuqS; 08-17-2021 at 17:01. Reason: New version update
LuqS is offline
LuqS
AlliedModders Donor
Join Date: Jun 2019
Location: Israel
Old 08-10-2021 , 16:39   Re: [INC] StudioHdr - Entity Model Information
Reply With Quote #2

Some code examples:

PHP Code:
bool SetBodyGroup(int entityint partint value)
{
    
// Get the current entity body.
    
int body GetEntProp(entityProp_Send"m_nBody");
    
    
// Get the StudioHDR
    
StudioHdr studiohdr GetEntityStudioHdr(entity);
    
    
// Get the new body value
    
if (!studiohdr.CalculateNewBodyGroup(bodypartvalue))
    {
        return 
false;
    }
    
    
// Set the new body value
    
SetEntProp(entityProp_Send"m_nBody"body);
    
    return 
true;
}

int GetEntitySkinCount(int entity)
{
    return 
GetEntityStudioHdr(entity).SkinFamiliesCount;
}

bool GetEntityPoseParameterBounds(int entityint pose_parameter_indexfloat bounds[2])
{
    
// Get the StudioHDR
    
StudioHdr studiohdr GetEntityStudioHdr(entity);
    
    
// Get entity pose parameter.
    
PoseParameter pose_parameter studiohdr.GetPoseParameter(pose_parameter_index);
    
    if (
pose_parameter == NULL_POSE_PARAMETER)
    {
        return 
false;
    }
    
    
bounds[0] = pose_parameter.start;
    
bounds[1] = pose_parameter.end;
    
    return 
true;
}

bool GetEntityAttachmentName(int entityint attachment_indexchar[] nameint name_length)
{
    
// Get the StudioHDR
    
StudioHdr studiohdr GetEntityStudioHdr(entity);
    
    
// Get attachment
    
Attachment attachment studiohdr.GetAttachment(attachment_index);
    
    
// if the `.GetName` function executed successfully.
    
return attachment.GetName(namename_length);
}

void ResetPoseParameters(int entity)
{
    
// Get the StudioHDR
    
StudioHdr studiohdr GetEntityStudioHdr(entity);
    
    
// Buffers
    
char name[64];
    
PoseParameter pose_parameter;
    
    for (
int current_posemax_pose studio_hdr.NumPoseParameterscurrent_pose max_posecurrent_pose++)
    {
        
// Get pose parameter by 
        
pose_parameter studio_hdr.GetPoseParameter(current_pose);
        
        
// Set pose parameter to the start value.
        
SetEntPropFloat(entityProp_Data"m_flPoseParameter"pose_parameter.startcurrent_pose);
    }
}

PoseParameter GetPoseParameterByName(int entity, const char[] pose_parameter_name)
{
    
// Get the StudioHDR
    
StudioHdr studiohdr GetEntityStudioHdr(entity);
    
    
// Find it by the name.
    
int index studio_hdr.FindPoseParameter(pose_parameter_name);
    if (
index == -1)
    {
        return 
NULL_POSE_PARAMETER;
    }
    
    return 
studio_hdr.GetPoseParameter(index);

__________________
You like my work? You want to support?
Consider Donating!

Need signatures / offsets for CS:GO?
Contact me:

Last edited by LuqS; 08-21-2021 at 06:06. Reason: 21/08/2021 Incompatible API change.
LuqS is offline
Benito
Member
Join Date: Jul 2018
Location: Belgique - Belgium
Old 08-10-2021 , 17:00   Re: [INC] StudioHdr - Entity Model Information
Reply With Quote #3

That's saves my life haha, nice release
__________________
Benito is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 08-10-2021 , 18:41   Re: [INC] StudioHdr - Entity Model Information
Reply With Quote #4

This looks cool. Nice one, LuqS!
__________________
Psyk0tik is offline
LuqS
AlliedModders Donor
Join Date: Jun 2019
Location: Israel
Old 08-11-2021 , 03:21   Re: [INC] StudioHdr - Entity Model Information
Reply With Quote #5

Quote:
Originally Posted by Benito View Post
That's saves my life haha, nice release
Quote:
Originally Posted by Psyk0tik View Post
This looks cool. Nice one, LuqS!
Thanks!
__________________
You like my work? You want to support?
Consider Donating!

Need signatures / offsets for CS:GO?
Contact me:
LuqS is offline
LuqS
AlliedModders Donor
Join Date: Jun 2019
Location: Israel
Old 08-16-2021 , 07:38   Re: [INC] StudioHdr - Entity Model Information
Reply With Quote #6


Coming soon
VIDEO

__________________
You like my work? You want to support?
Consider Donating!

Need signatures / offsets for CS:GO?
Contact me:
LuqS is offline
LuqS
AlliedModders Donor
Join Date: Jun 2019
Location: Israel
Old 08-17-2021 , 17:07   Re: [INC] StudioHdr - Entity Model Information
Reply With Quote #7

18/8/2021 Update:

Quote:
StudioHdr methodmap
Bones
• `GetBone()` - Get a specific bone object by index.
• `FindBone()` - Find bone index by name.
• Get model 'NumBones'.

Hitbox Sets
• `GetHitboxSet()` - Get a specific hitbox set object by index.
• Get model 'NumHitboxSets'.

Bone methodmap
• `GetName()` - Get the name of the body part.
• `GetPos()` - Get the position of the bone (relative to model).

HitboxSet methodmap
• `GetHitbox()` - Get a specific hitbox object by index.
• `NumHitboxs` - Number of hitboxes in the hitbox set.

Hitbox methodmap
• `bone` - The related bone of the specific hitbox.
• `group` - The intersection group of the specific hitbox.
bounding box, or the ends of the capsule if flCapsuleRadius > 0
• `bbmin`
• `bbmax`
• `GetAngOffsetOrientation()` - Gets the angle offset orientation.
• `flCapsuleRadius` - The radius of the capsule (if not a capsule = 0.0)
__________________
You like my work? You want to support?
Consider Donating!

Need signatures / offsets for CS:GO?
Contact me:
LuqS is offline
Benito
Member
Join Date: Jul 2018
Location: Belgique - Belgium
Old 08-18-2021 , 12:38   Re: [INC] StudioHdr - Entity Model Information
Reply With Quote #8

Quote:
Originally Posted by LuqS View Post
18/8/2021 Update:
Nice one, good job !
__________________
Benito is offline
LuqS
AlliedModders Donor
Join Date: Jun 2019
Location: Israel
Old 08-20-2021 , 06:14   Re: [INC] StudioHdr - Entity Model Information
Reply With Quote #9


Coming soon

__________________
You like my work? You want to support?
Consider Donating!

Need signatures / offsets for CS:GO?
Contact me:
LuqS is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 08-20-2021 , 10:08   Re: [INC] StudioHdr - Entity Model Information
Reply With Quote #10

wow, that is really great!
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas 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 04:40.


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