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

[TF2 & L4D & L4D2] Actions


Post New Thread Reply   
 
Thread Tools Display Modes
Kanashimi
Junior Member
Join Date: Jan 2023
Old 06-19-2023 , 00:42   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #81

Quote:
Originally Posted by BHaType View Post
Extension provides a natives to hook action event handlers and create custom actions

Notes
  • If two different plugins will try to return different action for same eventhandler last will be chosen.
  • Extension doesn't support late load so after reload you must recreate nextbots
  • All actions are cached by their parent action event handlers

Commands & ConVars
PHP Code:
/* Commands */
ext_actions_dump dumps entities actions
ext_actions_offsets 
prints every hooked function offset
ext_actions_listeners 
dumps actions listeners
ext_actions_list 
dumps every action that manager currently holds

/* ConVars */
ext_actions_debug debugs action propagation (Enable debugDisable debug)
ext_actions_debug_processors Logs processors (-Disabled, -Debug all- function vtable index to debug
Examples


Source code
I am having a issue with this. Actions completely chokes my server, making the server unplayable. I'm using Linux for my server, and it doesn't handle well.
Kanashimi is offline
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 06-19-2023 , 02:21   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #82

Quote:
Originally Posted by Kanashimi View Post
I am having a issue with this. Actions completely chokes my server, making the server unplayable. I'm using Linux for my server, and it doesn't handle well.
This extension doesn't do anything heavy-weighted on it's own. It's either plugin or something.
__________________
cry
BHaType is offline
Send a message via AIM to BHaType
Mystik Spiral
Senior Member
Join Date: Oct 2020
Location: Orlando, FL
Old 07-03-2023 , 18:50   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #83

Hi BHaType!

When a behavioral action is created, is it possible to change it to a different behavioral action? In one of your examples, you have this example where I took just an excerpt:

Code:
public void OnActionCreated( BehaviorAction action, int actor, const char[] name )
{
    /* Hooking self healing action (when bot wants to heal self) */
    if (  strcmp(name, "SurvivorHealSelf") == 0 )    
        action.OnStart = OnSelfAction;
    
    /* Hooking take pills action (when bot wants to take pills) */
    if ( strcmp(name, "SurvivorTakePills") == 0 )    
        action.OnStart = OnSelfAction;
}

public Action OnSelfAction( BehaviorAction action, int actor, BehaviorAction priorAction, ActionResult result )
{
    /* When bot will be about to start healing/taking pills we chech if he's black & white */
    /* if he is then we allow to heal otherwise no */
    result.type = GetEntData(action.Actor, m_bIsOnThirdStrike, 1) ? CONTINUE : DONE;
    return Plugin_Handled;
}
When the action is "SurvivorHealSelf" is it possible to change it to "SurvivorTakePills" instead, so if allowed and returned with Plugin_Changed the bot would take pills instead of healing with a first_aid_kit (assuming the bot has pain_pills of course)? I suspect the answer is No, but on the off chance the answer is Yes, please provide some information about how to configure this. Thank you!

Last edited by Mystik Spiral; 07-04-2023 at 05:50.
Mystik Spiral is offline
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 07-05-2023 , 00:01   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #84

Quote:
Originally Posted by Mystik Spiral View Post
Hi BHaType!

When a behavioral action is created, is it possible to change it to a different behavioral action?

When the action is "SurvivorHealSelf" is it possible to change it to "SurvivorTakePills" instead, so if allowed and returned with Plugin_Changed the bot would take pills instead of healing with a first_aid_kit (assuming the bot has pain_pills of course)? I suspect the answer is No, but on the off chance the answer is Yes, please provide some information about how to configure this. Thank you!
Yeah you can create your own action with custom logic or use game action and change to it.
I created a simple example with some explanation.
https://pastebin.com/NCE0491B

You can control action transition by using natives and control original code execution by return value.

Plugin_Handled - Blocks original function and uses your result
Plugin_Changed - Calls original function and uses your result
Plugin_Continue - Doesn't do anything
__________________
cry
BHaType is offline
Send a message via AIM to BHaType
Mystik Spiral
Senior Member
Join Date: Oct 2020
Location: Orlando, FL
Old 07-05-2023 , 08:54   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #85

Quote:
Originally Posted by BHaType View Post
Yeah you can create your own action with custom logic or use game action and change to it.
I created a simple example with some explanation.
https://pastebin.com/NCE0491B

You can control action transition by using natives and control original code execution by return value.

Plugin_Handled - Blocks original function and uses your result
Plugin_Changed - Calls original function and uses your result
Plugin_Continue - Doesn't do anything
This was super helpful @BHaType, thank you very much!

"Actions" are all new to me so it may take a while to digest, but I believe this will let me finish what I was working on. Thank you again for such a detailed and helpful reply!
Mystik Spiral is offline
KoMiKoZa
Senior Member
Join Date: Dec 2017
Location: Thy old times.
Old 07-19-2023 , 17:09   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #86

Installed the freshest version and got this in the logs:
Quote:
L 07/19/2023 - 22:01:24: [SM] Unable to load extension "actions.ext": /lib/i386-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/gpx/users/komikozovich/178.63.13.143-27370/222860/left4dead2/addons/sourcemod/extensions/actions.ext.2.l4d2.so)
L 07/19/2023 - 22:01:24: [SM] Unable to load plugin "l4d2_shove_fix.smx": Required extension "Actions" file("actions.ext") not running
UPD: Ok, I see a similar post back there, could you please post a l4d2 version of that?

Last edited by KoMiKoZa; 07-19-2023 at 17:22. Reason: UPD
KoMiKoZa is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 07-19-2023 , 17:21   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #87

@KoMiKoZa, need to re-compile on Debian 9, or update server OS.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
KoMiKoZa
Senior Member
Join Date: Dec 2017
Location: Thy old times.
Old 07-23-2023 , 19:40   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #88

Quote:
Originally Posted by Dragokas View Post
@KoMiKoZa, need to re-compile on Debian 9, or update server OS.
I see, thanks. Well, I'd be glad if anyone could post the compiled version here.

Renting a server, don't think the support is going to bother with that, but might be worth a try asking. Myself, I am clueless as to how anything beyond Windows OS works, so...

Put back the backups of shove_fix.lmx and actions.l4d2.ext, works fine. Will do until then.
KoMiKoZa is offline
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 07-23-2023 , 22:04   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #89

Quote:
Originally Posted by KoMiKoZa View Post
Installed the freshest version and got this in the logs:

UPD: Ok, I see a similar post back there, could you please post a l4d2 version of that?
I'll update topic later with Left 4 Dead 1 update to 3.0 version.

Quote:
Originally Posted by KoMiKoZa View Post
I see, thanks. Well, I'd be glad if anyone could post the compiled version here.
As Dragokas said, it has to be compiled against older ubuntu like this one which should resolve your issue.
__________________
cry

Last edited by BHaType; 07-26-2023 at 03:25.
BHaType is offline
Send a message via AIM to BHaType
KoMiKoZa
Senior Member
Join Date: Dec 2017
Location: Thy old times.
Old 07-24-2023 , 18:20   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #90

Quote:
Originally Posted by BHaType View Post
like this one which should resolve your issue.
Oof. I thought this was for L4D1 because of its name, hence why I asked for the L4D2 version. Yeah, that works alright, thanks!
KoMiKoZa is offline
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 08:10.


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