You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently there is no method to hook game event's gamePuppet::OnDamageReceived, gamePuppet::OnHit, etc..
Describe the solution you'd like
The best solution would be to reverse and hook into events natively, without additional dependencies, allowing modders to hook these function from C++.
Describe alternatives you've considered
An alternative to this would be to do like yamashi did it for Cyber Engine Tweaks, but that would require to have additional libraries added as dependencies for the SDK which I would not like to. If there is no other solution than this, a plugin API can be added so that the main loader can take care of hooking.
The text was updated successfully, but these errors were encountered:
Based on method name
To catch the event you just have to define function with the right signature and name. It's called by name just like any other function. For example, OnInitialize() in widgets controllers. Since it's literally just the function with the right name, there can't be more than one listener function.
Based on event classes inherited from redEvent
To catch such event you have to define function that takes exactly one argument of the type of the event class and has isEvent flag. It's auto wired during initialization. For example, OnHit(evt : handle:gameeventsHitEvent). It can be triggered using method target.QueueEvent(evt).
Callback managers
Different types have their own functions to register and unregister listeners. The signature of the listener is always fixed and different for different events. You just have to know it from examples. So to catch the event you have to define a listener function and later call some Register() function on callback manager giving it the name of your callback function and the target object to call that function on.
For example, a method to register listener for blackboard RegisterListenerBool(id : gamebbScriptID_Bool, object : handle:IScriptable, func : CName, fireIfValueExist : Bool).
I think this is the type based on native callbacks, they store Callback<T> instances (wrapping target object with the method named) and then invoke them.
Is your feature request related to a problem? Please describe.
Currently there is no method to hook game event's
gamePuppet::OnDamageReceived
,gamePuppet::OnHit
, etc..Describe the solution you'd like
The best solution would be to reverse and hook into events natively, without additional dependencies, allowing modders to hook these function from C++.
Describe alternatives you've considered
An alternative to this would be to do like yamashi did it for Cyber Engine Tweaks, but that would require to have additional libraries added as dependencies for the SDK which I would not like to. If there is no other solution than this, a plugin API can be added so that the main loader can take care of hooking.
The text was updated successfully, but these errors were encountered: