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

[TF2 & L4D & L4D2] Actions


Post New Thread Reply   
 
Thread Tools Display Modes
NightlyRaine
New Member
Join Date: Jan 2020
Location: Kansas USA
Old 03-24-2022 , 17:49   Re: [L4D2] Actions
Reply With Quote #11

This is how I was trying to use GetName(), if I change result.action.GetName(name, sizeof name); to action.GetName(name, sizeof name); it works, but I can't get the result name.

PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>

#include <actions>

public void OnActionCreatedBehaviorAction actionint actor, const char[] name )
{
    if ( 
strcmp(name"SurvivorLegsStayClose") == )
    {
        
action.OnUpdatePost SurvivorLegsStayClose_OnUpdatePost;
    }


/* ----------------------------------------------------------------------------------------------------*/
/* SurvivorLegsStayClose */
/* ----------------------------------------------------------------------------------------------------*/
public Action SurvivorLegsStayClose_OnUpdatePostBehaviorAction actionfloat intervalActionResult result )
{    
    if ( 
result.IsRequestingChange() )
    {
        if ( 
result.action != INVALID_ACTION )
        {
            
char name[ACTION_NAME_LENGTH];
            
result.action.GetName(namesizeof name);
            
PrintToServer"%s"name );
        }
    }

    return 
Plugin_Continue;

In game Console
PHP Code:

L 03
/24/2022 16:36:31: [SMException reportedInvalid action passed (66C1B5F0)
L 03/24/2022 16:36:31: [SMBlamingGetNameExample.smx
L 03
/24/2022 16:36:31: [SMCall stack trace:
L 03/24/2022 16:36:31: [SM]   [0BehaviorAction.GetName
L 03
/24/2022 16:36:31: [SM]   [1Line 27F:\SteamLibrary\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\GetNameExample.sp::SurvivorLegsStayClose_OnUpdatePost
133.27
Rochelle:: SurvivorLegsStayClose caused SurvivorLegsStayClose to SUSPEND_FOR SurvivorLegsRegroup  (I'm too far away from the closest human survivor)
133.27: Rochelle::  SUSPENDING SurvivorLegsStayClose
133.27: Rochelle::  SUSPENDING SurvivorLegsMoveOn
133.27: Rochelle::  STARTING SurvivorLegsRegroup
SurvivorLegsRegroup<<SurvivorLegsStayClose( SurvivorLegsMoveOn ) 

And side question, would it be possible to change actions to other existing exactions?
Like when SurvivorLegsMoveOn Suspends_For SurvivorLegsBattleStations, would it be possible to get it to suspend for L4D1SurvivorLegsBattlesStations? Or SurvivorLegsWait? Asking so I know what all is possible.
NightlyRaine is offline
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 03-26-2022 , 01:21   Re: [L4D2] Actions
Reply With Quote #12

Quote:
Originally Posted by NightlyRaine View Post
I can't get the result name.
Thanks for report. Fixed.

Quote:
Originally Posted by NightlyRaine View Post
And side question, would it be possible to change actions to other existing exactions?
Like when SurvivorLegsMoveOn Suspends_For SurvivorLegsBattleStations, would it be possible to get it to suspend for L4D1SurvivorLegsBattlesStations? Or SurvivorLegsWait? Asking so I know what all is possible.
Yep, but you need to create SDKCall for SurvivorLegsBattleStations constructor

Spoiler
__________________
cry
BHaType is offline
Send a message via AIM to BHaType
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 03-26-2022 , 01:23   Re: [L4D2] Actions
Reply With Quote #13

Updated
PHP Code:
Added IsSuspended native
Added IsStarted native
Fixed "Invalid action" error for runtime actions (Thanks to NightlyRaine
__________________
cry
BHaType is offline
Send a message via AIM to BHaType
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 03-27-2022 , 23:28   Re: [L4D2] Actions
Reply With Quote #14

Just a cool note, if someone wants debug to see some action stuff, you can use "nb_debug BEHAVIOR" in console (in a listen server) to watch.
__________________

Last edited by Marttt; 03-27-2022 at 23:29.
Marttt is offline
ThatKidWhoGames
Veteran Member
Join Date: Jun 2013
Location: IsValidClient()
Old 03-29-2022 , 14:29   Re: [L4D2] Actions
Reply With Quote #15

Quote:
Originally Posted by NightlyRaine View Post
This is how I was trying to use GetName(), if I change result.action.GetName(name, sizeof name); to action.GetName(name, sizeof name); it works, but I can't get the result name.

PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>

#include <actions>

public void OnActionCreatedBehaviorAction actionint actor, const char[] name )
{
    if ( 
strcmp(name"SurvivorLegsStayClose") == )
    {
        
action.OnUpdatePost SurvivorLegsStayClose_OnUpdatePost;
    }


/* ----------------------------------------------------------------------------------------------------*/
/* SurvivorLegsStayClose */
/* ----------------------------------------------------------------------------------------------------*/
public Action SurvivorLegsStayClose_OnUpdatePostBehaviorAction actionfloat intervalActionResult result )
{    
    if ( 
result.IsRequestingChange() )
    {
        if ( 
result.action != INVALID_ACTION )
        {
            
char name[ACTION_NAME_LENGTH];
            
result.action.GetName(namesizeof name);
            
PrintToServer"%s"name );
        }
    }

    return 
Plugin_Continue;

In game Console
PHP Code:

L 03
/24/2022 16:36:31: [SMException reportedInvalid action passed (66C1B5F0)
L 03/24/2022 16:36:31: [SMBlamingGetNameExample.smx
L 03
/24/2022 16:36:31: [SMCall stack trace:
L 03/24/2022 16:36:31: [SM]   [0BehaviorAction.GetName
L 03
/24/2022 16:36:31: [SM]   [1Line 27F:\SteamLibrary\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\GetNameExample.sp::SurvivorLegsStayClose_OnUpdatePost
133.27
Rochelle:: SurvivorLegsStayClose caused SurvivorLegsStayClose to SUSPEND_FOR SurvivorLegsRegroup  (I'm too far away from the closest human survivor)
133.27: Rochelle::  SUSPENDING SurvivorLegsStayClose
133.27: Rochelle::  SUSPENDING SurvivorLegsMoveOn
133.27: Rochelle::  STARTING SurvivorLegsRegroup
SurvivorLegsRegroup<<SurvivorLegsStayClose( SurvivorLegsMoveOn ) 

And side question, would it be possible to change actions to other existing exactions?
Like when SurvivorLegsMoveOn Suspends_For SurvivorLegsBattleStations, would it be possible to get it to suspend for L4D1SurvivorLegsBattlesStations? Or SurvivorLegsWait? Asking so I know what all is possible.
Just a suggestion, but when writing code, you should define the include files before adding these lines:
Code:
#pragma newdecls required
#pragma semicolon 1
This way, any include files which may be old or do not use semicolons for whatever reason should still allow your plugin to compile without errors.
ThatKidWhoGames is offline
E.4H
Junior Member
Join Date: Jul 2019
Old 03-29-2022 , 23:55   Re: [L4D2] Actions
Reply With Quote #16

Very cood Extension. If possible, could it support l4d1 please?
E.4H is offline
objir
New Member
Join Date: Mar 2022
Old 03-30-2022 , 02:07   Re: [L4D2] Actions
Reply With Quote #17

Getting a crash when the player is pounced by a SI, if Using this with Advanced Bot AI (https://steamcommunity.com/sharedfil...?id=1968764163). Any help please?
objir is offline
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 03-30-2022 , 03:12   Re: [L4D2] Actions
Reply With Quote #18

Quote:
Originally Posted by E.4H View Post
Very cood Extension. If possible, could it support l4d1 please?
I have almost made done l4d1 version, will be released when I'll make sure that it works correctly.

Quote:
Originally Posted by objir View Post
Getting a crash when the player is pounced by a SI, if Using this with Advanced Bot AI (https://steamcommunity.com/sharedfil...?id=1968764163). Any help please?
It's doesn't make any sense. I have no idea how this vscript addon can cause crash. Try to test it without 3rd party plugins also you can post accelerator crash id and i will try to find out what caused your crash.
__________________
cry

Last edited by BHaType; 03-30-2022 at 03:14.
BHaType is offline
Send a message via AIM to BHaType
objir
New Member
Join Date: Mar 2022
Old 03-30-2022 , 04:44   Re: [L4D2] Actions
Reply With Quote #19

@BHaType Thanks for pointing me to Accelerator.

A log (Tested at the beginning of Dead Center Ch.2.):
Got a presubmit token from server: 06b4ba61cd32830875e139b3001bacbd
Uploaded crash dump: Crash ID: EXQT-QIAX-MQFE

Before posting here, I have done some tests and it appears that the only way to stop the crash is to disable either the ai mod or this extension:
1. Tried to launch the game without -insecure: the crash is gone.
2. Launched the game with -insecure but with no smx plugins (even without the ones that come with Sourcemod and the ones that require this extension, like the Shove Direction Fix): still crashed.
(Will this extension be loaded at all if no plugins that require it are enabled?)
3. Launched the game with -insecure and smx plugins, but without this extension: the crash is gone.
4. Launched the game with -insecure and smx plugins, with this extension but without the ai mod: the crash is gone.

Edit:
a result for EXQT-QIAX-MQFE from crash.limetech.org:

Last edited by objir; 03-30-2022 at 05:38.
objir is offline
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 03-30-2022 , 06:16   Re: [L4D2] Actions
Reply With Quote #20

Quote:
Originally Posted by objir View Post
@BHaType Thanks for pointing me to Accelerator.

A log (Tested at the beginning of Dead Center Ch.2.):
Got a presubmit token from server: 06b4ba61cd32830875e139b3001bacbd
Uploaded crash dump: Crash ID: EXQT-QIAX-MQFE

Before posting here, I have done some tests and it appears that the only way to stop the crash is to disable either the ai mod or this extension:
1. Tried to launch the game without -insecure: the crash is gone.
2. Launched the game with -insecure but with no smx plugins (even without the ones that come with Sourcemod and the ones that require this extension, like the Shove Direction Fix): still crashed.
(Will this extension be loaded at all if no plugins that require it are enabled?)
3. Launched the game with -insecure and smx plugins, but without this extension: the crash is gone.
4. Launched the game with -insecure and smx plugins, with this extension but without the ai mod: the crash is gone.
Thanks for accelerator crash report but I played 3 campaigns and survival for 9 minutes and not a single crash happened. Are you sure that you have installed latest version if it's not then can you also attach version that you are using?

Quote:
Originally Posted by objir View Post
Will this extension be loaded at all if no plugins that require it are enabled?
Yep, this is necessary because the extension intercepts actions by their "inheritance" system. If some action is lost then subsequent actions will also be lost.
__________________
cry

Last edited by BHaType; 03-30-2022 at 06:16.
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 06:35.


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