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

Set Model Pose(aim_yaw | aim_pitch)


Post New Thread Reply   
 
Thread Tools Display Modes
Blowst
Senior Member
Join Date: Feb 2011
Location: Korea, Republic of
Old 11-15-2015 , 20:14   Re: Set Model Pose(aim_yaw | aim_pitch)
Reply With Quote #11

PopulatePoseParameter() is a virtual function that we can use without getting signature of itself.
(See https://wiki.alliedmods.net/Virtual_..._(Source_Mods)
https://en.m.wikipedia.org/wiki/Virtual_table
for more information)
And the number 217(21 is the virtual function offset.
(See https://www.sourcemodplugins.org/vtableoffsets/csgo for full vtable list.)
__________________
Sorry about my poor English


Last edited by Blowst; 11-15-2015 at 20:15.
Blowst is offline
Blowst
Senior Member
Join Date: Feb 2011
Location: Korea, Republic of
Old 11-16-2015 , 01:38   Re: Set Model Pose(aim_yaw | aim_pitch)
Reply With Quote #12

what game is you are trying to apply it on?

I tested it(modifying m_flPoseParameter) on my csgo server, and it works like a charm




here's my code for it.

PHP Code:
#include <sourcemod>
#include <sdktools>

public void OnPluginStart()
{
    
RegConsoleCmd("sm_ptest"SpawnHostage);
}

public 
Action SpawnHostage(int clientint args)
{
    
float vOrigin[3], vAngle[3];
    
GetClientAbsOrigin(clientvOrigin);
    
GetClientAbsAngles(clientvAngle);
    
    
int ent CreateEntityByName("prop_dynamic_override");
    
    if(!
IsValidEntity(ent))
        return;
    
    if(!
IsModelPrecached("models/hostage/hostage.mdl"))
        
PrecacheModel("models/hostage/hostage.mdl");
    
    
SetEntityModel(ent"models/hostage/hostage.mdl");
    
DispatchKeyValue(ent"StartDisabled""false");
    
DispatchSpawn(ent);
    
AcceptEntityInput(ent"TurnOn"entent0);
    
AcceptEntityInput(ent"EnableCollision");
    
SetEntityMoveType(entMOVETYPE_NOCLIP);
    
DispatchKeyValue(ent"spawnflags""8");
    
    
SetVariantString("Run"); // idle
    
AcceptEntityInput(ent"SetAnimation", -1, -10);
    
    
SetEntPropFloat(entProp_Send"m_flPoseParameter"1.03);
    
SetEntPropFloat(entProp_Send"m_flPoseParameter", -1.04);
    
    
TeleportEntity(entvOriginvAngleNULL_VECTOR);

p.s. A warning's printed when u put a negative value in an element of m_flPoseParameter.
Code:
DataTable warning: (class prop_dynamic): Out-of-range value (<NEGATIVE VALUE HERE>) in SendPropFloat '<ELEMENT INDEX HERE>', clamping.
u might have to use this.
__________________
Sorry about my poor English


Last edited by Blowst; 11-16-2015 at 01:49. Reason: gram
Blowst is offline
thecount
Veteran Member
Join Date: Jul 2013
Old 11-16-2015 , 16:51   Re: Set Model Pose(aim_yaw | aim_pitch)
Reply With Quote #13

Quote:
Originally Posted by Blowst View Post
what game is you are trying to apply it on? I tested it(modifying m_flPoseParameter) on my csgo server, and it works like a charm
Honestly, I don't know why it doesn't work. Here is a video and below are my commands.

Spoiler
thecount is offline
Blowst
Senior Member
Join Date: Feb 2011
Location: Korea, Republic of
Old 11-18-2015 , 20:34   Re: Set Model Pose(aim_yaw | aim_pitch)
Reply With Quote #14

can i get the model files?
__________________
Sorry about my poor English

Blowst is offline
thecount
Veteran Member
Join Date: Jul 2013
Old 11-18-2015 , 21:07   Re: Set Model Pose(aim_yaw | aim_pitch)
Reply With Quote #15

Quote:
Originally Posted by Blowst View Post
can i get the model files?
Do you have the first Portal? I'm using the turret from there.
Download Here

Last edited by thecount; 11-18-2015 at 21:12.
thecount is offline
Blowst
Senior Member
Join Date: Feb 2011
Location: Korea, Republic of
Old 11-18-2015 , 21:10   Re: Set Model Pose(aim_yaw | aim_pitch)
Reply With Quote #16

Quote:
Originally Posted by thecount View Post
Do you have the first Portal? I'm using the turret from there.
ok, i'll try it later.

btw, y model from Portal 1? not Portal 2.

for compatibility or something?
__________________
Sorry about my poor English

Blowst is offline
thecount
Veteran Member
Join Date: Jul 2013
Old 11-18-2015 , 22:42   Re: Set Model Pose(aim_yaw | aim_pitch)
Reply With Quote #17

Quote:
Originally Posted by Blowst View Post
ok, i'll try it later. btw, y model from Portal 1? not Portal 2. for compatibility or something?
About 30 minutes ago I tried swapping it with the Portal 2 model and it has some weird lighting effects, but made no difference with performance.

Last edited by thecount; 11-18-2015 at 22:42.
thecount is offline
Blowst
Senior Member
Join Date: Feb 2011
Location: Korea, Republic of
Old 11-19-2015 , 01:18   Re: Set Model Pose(aim_yaw | aim_pitch)
Reply With Quote #18

I tried it. and it works at first, but only once per an entity.

tried after the first set(flPoseParameter), and it didnt work.

i'm now trying to get signature of it.
but it seems kinda hard for me to get one for windows OS.

CBaseAnimating::SetPoseParameter(CStudioHdr *, char const*, float)

Linux: @_ZN14CBaseAnimating16SetPoseParameterEP10CSt udioHdrPKcf

EDIT:

Ooops, nvm.

i forgot dat u need TF2 version of the func signature.
__________________
Sorry about my poor English


Last edited by Blowst; 11-19-2015 at 05:07.
Blowst is offline
Reply



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 17:56.


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