AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Extensions (https://forums.alliedmods.net/forumdisplay.php?f=134)
-   -   [TF2 & L4D & L4D2] Actions (https://forums.alliedmods.net/showthread.php?t=336374)

BHaType 02-15-2022 07:11

[TF2 & L4D & L4D2] Actions
 
1 Attachment(s)
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

Gold Fish 02-16-2022 08:45

Re: [L4D2] Actions
 
What are the "action" related to? Any actions of survivors and infected (players)?

BHaType 02-16-2022 20:05

Re: [L4D2] Actions
 
Quote:

Originally Posted by Gold Fish (Post 2771621)
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 


Gold Fish 02-17-2022 03:05

Re: [L4D2] Actions
 
Quote:

Originally Posted by BHaType (Post 2771662)
"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?)

Lux 02-17-2022 04:01

Re: [L4D2] Actions
 
This is a blessing thanks for release

HarryPotter 02-19-2022 16:00

Re: [L4D2] Actions
 
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

BHaType 03-02-2022 04:18

Re: [L4D2] Actions
 
Updated
PHP Code:

Fixed compilation errors for sm 1.10
Allowed to return NULL for InitialContainedAction
Added msvc 


NightlyRaine 03-23-2022 23:39

Re: [L4D2] Actions
 
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()" 


BHaType 03-24-2022 03:09

Re: [L4D2] Actions
 
Quote:

Originally Posted by NightlyRaine (Post 2775035)
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 (Post 2775035)
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 (Post 2775035)
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.

BHaType 03-24-2022 03:33

Re: [L4D2] Actions
 
Updated
PHP Code:

Fixed crash for nb_move_to_cursor and nb_move_to_position cmds (Thanks to NightlyRaine)
Added new example 



All times are GMT -4. The time now is 02:12.

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