Call AddLayeredSequence

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

Call AddLayeredSequence

Postby rovizon » Thu May 11, 2023 8:14 am

Hello! I am trying to blend animations on prop_dynamic_override entity. Trying to call CBaseAnimatingOverlay::AddLayeredSequence:

Syntax: Select all

import memory
from memory import Convention, DataType

server = memory.find_binary('server')

add_layered_sequence = server[b'\x55\x8B\xEC\x51\x53\xFF\x75\x0C'].make_function(
Convention.THISCALL,
[DataType.INT, DataType.INT, DataType.INT],
DataType.INT
)

add_layered_sequence(entity.index, 0, 0)


https://github.com/ValveSoftware/source ... y.cpp#L639

And got an error:

Code: Select all

RuntimeError: Access violation while reading address '112022711'.

Game CS Source
Please tell me what am i doing wrong?
User avatar
Ayuto
Project Leader
Posts: 2195
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Call AddLayeredSequence

Postby Ayuto » Thu May 11, 2023 3:45 pm

Syntax: Select all

import memory
from memory import Convention, DataType

server = memory.find_binary('server')

add_layered_sequence = server[b'\x55\x8B\xEC\x51\x53\xFF\x75\x0C'].make_function(
Convention.THISCALL,
[DataType.POINTER, DataType.INT, DataType.INT],
DataType.INT
)

add_layered_sequence(entity.pointer, 0, 0)
The first argument has to be a pointer (probably the entity?).
rovizon
Junior Member
Posts: 22
Joined: Mon May 31, 2021 3:01 pm
Location: Donbass

Re: Call AddLayeredSequence

Postby rovizon » Thu May 11, 2023 6:05 pm

The same error:

Code: Select all

RuntimeError: Access violation while writing address '1775008724'.
User avatar
Articha
Member
Posts: 32
Joined: Tue Sep 21, 2021 12:13 pm
Location: Russia

Re: Call AddLayeredSequence

Postby Articha » Fri May 12, 2023 8:30 am

I sometimes don't understand hooking C++ functions, but in source there's 2 int arguments, while you waiting 3. Why?
rovizon
Junior Member
Posts: 22
Joined: Mon May 31, 2021 3:01 pm
Location: Donbass

Re: Call AddLayeredSequence

Postby rovizon » Fri May 12, 2023 9:08 am

Because I need to add a layer for some specific entity. Therefore, I pass the desired entity as the first argument (the this-pointer). Maybe I'm wrong and you need to do it somehow differently.
User avatar
L'In20Cible
Project Leader
Posts: 1534
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: Call AddLayeredSequence

Postby L'In20Cible » Fri May 12, 2023 4:25 pm

rovizon wrote:prop_dynamic_override

This entity does not inherit from CBaseAnimatingOverlay.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 21 guests