Detour AcceptInput
Hello!
I tried to detour CBaseEntity::AcceptInput(char const*,CBaseEntity*,CBaseEntity*,variant_t,in t) reusing @Silvers Input Hooks code and got these: Code:
L 02/12/2024 - 19:26:09: [SM] Exception reported: Invalid Handle 245 (error 7) Code:
"Games" PHP Code:
Background: i used HookEntitySingleOutput in one of the plugins, but up to 50 frames can pass between Output and Input, and I had to track the state of several entities for those 50-100 frames. Using a detour for AcceptInput, it would be possible to reduce the complexity/code length by half. |
Re: Detour AcceptInput
I would suggest you do this via vscript for a much easier access. Not sure what your goal is, but hooking an input/output is much easier.
|
Re: Detour AcceptInput
2 Attachment(s)
Quote:
In short, I added additional cars/boxes of the class prop_physics through stripper for charger-fun. But on c5m5_bridge (see screenshot), at the very beginning, one of them just disappeared after pressing the radio. It turned out that func_elevator in void CFuncElevator::MoveTo(float destinationZ) simply deletes all prop_physics entities inside func_elev to prevent players from falling down. This was complicated by the fact that a charger could push the car at the moment of pressing the button, and it just disappeared in the process. And the place and moment are interesting/funny, you can knock a car onto someone’s head, or after lowering the bridge, immediately push it into all the survivors. The option with patching CFuncElevator::MoveTo is difficult, beyond my capabilities. I made a DHookEntity on AcceptInput - but by that moment the car had already been deleted, and it was impossible to restore it. I had to hook trigger_finale, and from that moment track its parameters, in case it was pushed and it’s already flying, i.e., upon deletion, create it in the same frame, and restore the same angular and regular velocity. It turned out to be cumbersome, but works as needed. And with a detour, you can remove half of the code, and simply at the moment of AcceptInput triggering, capture the parameters and restore them in the same frame. As for vscript, I'll read about it, I haven’t used them before. https://developer.valvesoftware.com/...unctions#Hooks looks like its what i need |
Re: Detour AcceptInput
You can try changing stuff by using Stripper as well since is map specific.
|
Re: Detour AcceptInput
I think the detour setup is wrong. Try changing the type of "variant_t" to "object".
It seems like you're recreating them after delection, how about creating static models and replacing with physics later when elevator movement finishes? |
Re: Detour AcceptInput
Quote:
Quote:
|
Re: Detour AcceptInput
You're mixing declaration of "Functions" in the gamedata and manually setting up hooks in sourcepawn code. To use the function definition in your gamedata, use "DHookCreateFromConf" instead of "DHookCreateDetour" and "DHookSetFromConf". Or add appropriate "DHookAddParam" calls to your plugin, but it seems like you want to use the gamedata file to define the hook setup.
The error is triggered because you're trying to access parameters but never told dhooks that there were any in your code, since you didn't use the definition from your gamedata file. |
Re: Detour AcceptInput
Quote:
|
All times are GMT -4. The time now is 05:33. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.