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

[TF2 & L4D & L4D2] Actions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 02-15-2022 , 07:11   [TF2 & L4D & L4D2] Actions
Reply With Quote #1

ConVars
PHP Code:
// Logs every action transitions
// 1 - Enable debug, 0 - Disable debug
ext_actions_debug "0"

// Logs every action/behavior/component allocation or deallocation
// Used to track memory leaks
// 1 - Enable memory debug, 0 - Disable memory debug
ext_actions_debug_memory"0" 
Commands
PHP Code:
ext_actions_dump Dumps every nextbot actions to console
How to use
PHP Code:
forward void OnActionCreatedBehaviorAction actionint actor, const char[] name ); 
Usually every use case should start from forward above. This forward notifies whenever entity got a new action but without actual transition yet.
That means action is constructed by the corresponding constructor and still hasn't been updated or started yet.
At this point you just hook any event handler and change it code execution as you want.


Source code
Attached Files
File Type: zip actions.ext.zip (4.02 MB, 1605 views)
__________________
cry

Last edited by BHaType; 11-03-2023 at 16:01.
BHaType is offline
Send a message via AIM to BHaType
Gold Fish
Senior Member
Join Date: Mar 2020
Old 02-16-2022 , 08:45   Re: [L4D2] Actions
Reply With Quote #2

What are the "action" related to? Any actions of survivors and infected (players)?
__________________
-

PHP Code:
public OnClientConnect(int Client) {
    
KickClient(Client"sorry");

Gold Fish is offline
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 02-16-2022 , 20:05   Re: [L4D2] Actions
Reply With Quote #3

Quote:
Originally Posted by Gold Fish View Post
What are the "action" related to? Any actions of survivors and infected (players)?
"Actions" are only related to nextbots. I can't give you full list of game actions since there are to many of them

https://developer.valvesoftware.com/...tBot_Behaviors

Updated
PHP Code:
Fixed InitialContainedAction handler for custom actions 
__________________
cry

Last edited by BHaType; 02-16-2022 at 20:11.
BHaType is offline
Send a message via AIM to BHaType
Gold Fish
Senior Member
Join Date: Mar 2020
Old 02-17-2022 , 03:05   Re: [L4D2] Actions
Reply With Quote #4

Quote:
Originally Posted by BHaType View Post
"Actions" are only related to nextbots. I can't give you full list of game actions since there are to many of them

https://developer.valvesoftware.com/...tBot_Behaviors

Updated
PHP Code:
Fixed InitialContainedAction handler for custom actions 
I understand that with the help of your extension, can force a tank to attack a certain player or make him just stand still or run away from players or even make zombie friends for a survivors, I understand that the extension gives full control over the intelligence of entities that is embedded in the game engine?)
__________________
-

PHP Code:
public OnClientConnect(int Client) {
    
KickClient(Client"sorry");

Gold Fish is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 02-17-2022 , 04:01   Re: [L4D2] Actions
Reply With Quote #5

This is a blessing thanks for release
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 02-19-2022 , 16:00   Re: [L4D2] Actions
Reply With Quote #6

If I write
PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <actions> 
then compiler will show error
Code:
//// l4d2_bile_out_nav_negate_action.sp
// 
// D:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2 Dedicated Server\left4dead2\addons\sourcemod\scripting 1.10\include\actions.inc(37) : error 001: expected token: ";", but found "forward"
// D:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2 Dedicated Server\left4dead2\addons\sourcemod\scripting 1.10\include\actions.inc(39) : error 001: expected token: ";", but found "methodmap"
// D:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2 Dedicated Server\left4dead2\addons\sourcemod\scripting 1.10\include\actions.inc(89) : error 001: expected token: ";", but found "<newline>"
//
// 3 Errors.
sm 1.10
__________________
HarryPotter is offline
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 03-02-2022 , 04:18   Re: [L4D2] Actions
Reply With Quote #7

Updated
PHP Code:
Fixed compilation errors for sm 1.10
Allowed to return NULL for InitialContainedAction
Added msvc 
__________________
cry

Last edited by BHaType; 03-02-2022 at 04:18.
BHaType is offline
Send a message via AIM to BHaType
NightlyRaine
New Member
Join Date: Jan 2020
Location: Kansas USA
Old 03-23-2022 , 23:39   Re: [L4D2] Actions
Reply With Quote #8

Using nb_move_to_cursor and nb_move_to_position seems to crash when a bot is spawned in when using this amazing extension.

And I for the life of me can not figure out how to use or what this is even supposed to do, Am somewhat new to messing with plugins at times. Any help on what it is supposed to do and how to use would be amazing!

PHP Code:
/* Used to iterate through all entity actions */
public static native void Actionsint entityActionsIteratorCallback callback ); 
And GetName() doesn't seem to work when getting the name of a result action like
PHP Code:
"result.action.GetName()" 
NightlyRaine is offline
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 03-24-2022 , 03:09   Re: [L4D2] Actions
Reply With Quote #9

Quote:
Originally Posted by NightlyRaine View Post
Using nb_move_to_cursor and nb_move_to_position seems to crash when a bot is spawned in when using this amazing extension.
Thanks for report. Fixed

Quote:
Originally Posted by NightlyRaine View Post
And I for the life of me can not figure out how to use or what this is even supposed to do, Am somewhat new to messing with plugins at times. Any help on what it is supposed to do and how to use would be amazing!
It will give every action that passed entity contains. There is no way to legally create ArrayList via extension so that's the only way how can you pass multiple objects without creating your own handle type.
How to use

Quote:
Originally Posted by NightlyRaine View Post
And GetName() doesn't seem to work when getting the name of a result action like
Just tested and seems to be working fine. Make sure you are not trying to access null action or show code so i can replicate issue.
__________________
cry
BHaType is offline
Send a message via AIM to BHaType
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 03-24-2022 , 03:33   Re: [L4D2] Actions
Reply With Quote #10

Updated
PHP Code:
Fixed crash for nb_move_to_cursor and nb_move_to_position cmds (Thanks to NightlyRaine)
Added new example 
__________________
cry
BHaType is offline
Send a message via AIM to BHaType
Reply


Thread Tools
Display Modes

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:51.


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