Pose parameter

Please post any questions about developing your plugin here. Please use the search function before posting!
rovizon
Junior Member
Posts: 22
Joined: Mon May 31, 2021 3:01 pm
Location: Donbass

Pose parameter

Postby rovizon » Sun May 14, 2023 1:28 pm

Hello!

I have created a prop_dynamic_override entity and want to change its pose.
Because I didn't see any changes with this code in CSS (it do change only once after spawning and when i collapse and expand the game, why?) (in CS GO it works good):

Syntax: Select all

entity.set_property_float('m_flPoseParameter.000', 0.85)


I decided to try change pose with a function call CBaseAnimating::SetPoseParameter.
This function takes as the first argument CStudioHdr *pStudioHdr. How to find this argument of my entity?

https://github.com/ValveSoftware/source ... 2-L1213C12
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: Pose parameter

Postby L'In20Cible » Sun May 14, 2023 4:09 pm

Technically, you could get it by reading CBaseAnimating::m_pStudioHdr:

Syntax: Select all

entity.get_pointer(
entity.datamap.find('OnIgnite').offset
+ get_size(BaseEntityOutput)
+ 4
)
However, it needs to be locked by CBaseAnimating::LockStudioHdr first for it to be defined. Therefore, your best bet is probably to call CBaseAnimating::GetModelPtr directly and let it handle the locking for you. Here's the (untested) signature:

Code: Select all

 A1 ? ? ? ? 56 8B 30 8B 01 FF 50 18 8B 0D ? ? ? ? 50 FF 56 04 5E C3
rovizon
Junior Member
Posts: 22
Joined: Mon May 31, 2021 3:01 pm
Location: Donbass

Re: Pose parameter

Postby rovizon » Sun May 14, 2023 5:40 pm

Thank you for help!

Now call function is working but there are no changes on the model as well as with the code from the first post. Perhaps something is wrong with the model? Going to find out.

Syntax: Select all

import memory
from memory import Convention, DataType

server = memory.find_binary('server')

get_model_ptr = server['_ZN14CBaseAnimating11GetModelPtrEv'].make_function(
Convention.THISCALL,
[DataType.POINTER],
DataType.POINTER
)

set_pose_param = server['_ZN14CBaseAnimating16SetPoseParameterEP10CStudioHdrif'].make_function(
Convention.THISCALL,
[DataType.POINTER, DataType.POINTER, DataType.INT, DataType.FLOAT],
DataType.FLOAT
)

model_ptr = get_model_ptr(entity.pointer)

""" Return right values so everything is working properly? """
print(set_pose_param(entity.pointer, model_ptr, 0, 0.15))
print(set_pose_param(entity.pointer, model_ptr, 1, 0.15))
rovizon
Junior Member
Posts: 22
Joined: Mon May 31, 2021 3:01 pm
Location: Donbass

Re: Pose parameter

Postby rovizon » Sun May 14, 2023 6:48 pm

Just discovered that in CSS changing m_flPoseParameter work if disabled client side animation. In CSGO it worked without this.

Syntax: Select all

entity.set_property_bool('m_bClientSideAnimation', False)
entity.set_property_float('m_flPoseParameter.000', 0.85)

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 21 guests