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

[TF2 & L4D & L4D2] Actions


Post New Thread Reply   
 
Thread Tools Display Modes
foxhound27
AlliedModders Donor
Join Date: Sep 2019
Location: Argentina
Old 10-03-2023 , 22:53   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #101

Hello bro, thank you for this great work, but it's not working for me

Error:

[21] Actions (3.6.2): Nextbot action tree manager
[22] <FAILED> file "actions.ext.2.l4d2.so": Failed to create handle type (error: 10)

Using:
Game: L4D2
OS: Linux
SourceMod Version: 1.11.0.6840
Metamod:Source version 1.11.0-dev+1145
foxhound27 is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 10-04-2023 , 02:12   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #102

Quote:
Originally Posted by foxhound27 View Post

Error:

[21] Actions (3.6.2): Nextbot action tree manager
[22] <FAILED> file "actions.ext.2.l4d2.so": Failed to create handle type (error: 10)

why there are two actions?
__________________
HarryPotter is offline
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 10-04-2023 , 07:36   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #103

Quote:
Originally Posted by foxhound27 View Post
Hello bro, thank you for this great work, but it's not working for me
[21] Actions (3.6.2): Nextbot action tree manager
[22] <FAILED> file "actions.ext.2.l4d2.so": Failed to create handle type (error: 10)
You are trying to load 2 'actions' extensions. That's illegal.
__________________
cry
BHaType is offline
Send a message via AIM to BHaType
foxhound27
AlliedModders Donor
Join Date: Sep 2019
Location: Argentina
Old 10-04-2023 , 14:02   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #104

i had only these 2 files actions autoload and actions.ext.2.l4d2.so, it seems my server was crazy and needed a restart, thank you! now all is fine

Last edited by foxhound27; 10-04-2023 at 14:02.
foxhound27 is offline
awesome144
Senior Member
Join Date: Jul 2014
Location: In lala land
Old 10-31-2023 , 06:48   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #105

So I'm a little perplexed on how the InitialContainedAction callback works. Changing the third parameter with a different return allows a different action to be the child action, but I don't really know what the purpose of the first parameter is for. Also I'm wondering is it possible to get the action it should return (assuming the action it hooked uses InitialContainedAction), if that has to be done using the post hook.
__________________
⎛⎝Officer Spy⎠⎞


awesome144 is offline
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 11-02-2023 , 21:41   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #106

Quote:
Originally Posted by awesome144 View Post
So I'm a little perplexed on how the InitialContainedAction callback works.
Action calls InitialContainedAction to create optional child action and invoked before OnStart of calle action also child action always gets updates first.

Quote:
Originally Posted by awesome144 View Post
Changing the third parameter with a different return allows a different action to be the child action, but I don't really know what the purpose of the first parameter is for.
That's was include issue, I just pushed update to remove this confusion (InitialContainedAction).
First two params are basicly same for all non contextual handlers. The 3rd one represents return value of InitialContainedAction handler.

Quote:
Originally Posted by awesome144 View Post
Also I'm wondering is it possible to get the action it should return (assuming the action it hooked uses InitialContainedAction), if that has to be done using the post hook.
Yep, simply hook InitialContainedActionPost and then child param will be actual return value of original IntialContainedAction.
__________________
cry
BHaType is offline
Send a message via AIM to BHaType
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 11-02-2023 , 21:44   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #107

Updated
PHP Code:
Renamed 3rd param of InitialContainedAction to more appropriate name 
Simplified InitialContainedAction child param routine (before you had to wait 1 frame to use it
__________________
cry

Last edited by BHaType; 11-02-2023 at 21:45.
BHaType is offline
Send a message via AIM to BHaType
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 11-03-2023 , 16:02   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #108

Updated
PHP Code:
Fixed crash caused by prior update 
__________________
cry
BHaType is offline
Send a message via AIM to BHaType
Mystik Spiral
Senior Member
Join Date: Oct 2020
Location: Orlando, FL
Old 01-16-2024 , 18:58   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #109

Hi BHaType!

In this post, you provided this example. On line 42 of that example is this text:

PrepSDKCall_SetVirtual(284); // 285 linux

Does this mean I need to change 284 to 285 if my code is running on Linux instead of Windows?

I realize that is an index (vtblidx), but I am not sure what it is an index to. There are still many things for me to learn about SourceMod so I apologize if my question seems "basic".

If that is what I need to do, since my plugin also uses Left4DHooksDirect, I thought I would try to use GetOSType to set the value appropriately.
__________________
Mystik Spiral is online now
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 01-18-2024 , 15:21   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #110

Quote:
Originally Posted by Mystik Spiral View Post
Does this mean I need to change 284 to 285 if my code is running on Linux instead of Windows?
Yes, if you don't change it then plugin will call wrong function which most likely cause a crash.

Quote:
Originally Posted by Mystik Spiral View Post
I realize that is an index (vtblidx), but I am not sure what it is an index to. There are still many things for me to learn about SourceMod so I apologize if my question seems "basic".
There is a special keyword in C++ to store function in an array with other functions with same keyword.
If you need to call specific function from that array then you need to know index of the function you want to call.
You can decompile appropriate binary and calculate index by yourself or use VTable Dumper by asherkin.

In your case 284 is an index of "Weapon_Switch" from "CTerrorPlayer" array.
Those indexes are different between Windows and Linux because afaik this is compiler specific stuff.

This is extremely simplified explanation.

Quote:
Originally Posted by Mystik Spiral View Post
If that is what I need to do, since my plugin also uses Left4DHooksDirect, I thought I would try to use GetOSType to set the value appropriately.
There is nothing wrong with GetOSType but actually it's a bad practice.
Anything platform/game specific or ambiguous data is always better to cover up into gamedata if possible.
__________________
cry

Last edited by BHaType; 01-18-2024 at 17:27.
BHaType is offline
Send a message via AIM to BHaType
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 14:50.


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