Raised This Month: $32 Target: $400
 8% 

[L4D & L4D2] Left 4 DHooks Direct (1.145) [03-Apr-2024]


Post New Thread Reply   
 
Thread Tools Display Modes
Accelerator
Senior Member
Join Date: Dec 2010
Location: Russia
Old 10-02-2021 , 01:00   Re: [L4D & L4D2] Left 4 DHooks Direct (1.60) [29-Sep-2021]
Reply With Quote #481

ACT_* ANIMATION VALUES
Maybe you should take this to a separate optionally connected #include? The way it is done now makes it difficult to browse the available natives and forwards and, in my opinion, is of no importance.

Also, I do not quite understand the purpose of the Animation Activities file, which is in the data folder. I didn't see that it was used in the code in any way, except for parsing on plugin start.
__________________

Last edited by Accelerator; 10-02-2021 at 01:19.
Accelerator is offline
Sempiro
Member
Join Date: Apr 2014
Old 10-02-2021 , 08:14   Re: [L4D & L4D2] Left 4 DHooks Direct (1.60) [29-Sep-2021]
Reply With Quote #482

Quote:
Originally Posted by HarryPotter View Post
use new version: https://forums.alliedmods.net/showthread.php?p=2712082
extension "Left 4 Downtown" is outdated and replaced by Left 4 DHooks Direct
Hey man, thank you. Yeah, I have already installed it and using it, but I find it a little bit confusing.

(OFFTOPIC)

Code:
// Admin Commands (ADMFLAG_KICK):
sm_forcepass <#userid|name> // Force to pass the Tank to target player.
sm_taketank <#userid|name> // Take control of the Tank AI.
1. Is it possible to make the plugin act just like it is with "Tank Swap" plugin without the hustle of adding "#userid|name" to the command? With "Tank Swap", if you are an admin, just "sm_taketank" is enough, and "sm_taketank" was bind to a hotkey on my keyboard, I want to have the same functionality with this new plugin, but not sure how.

2. Also I do not get the formatting for "#userid|name"? "userid" here is Steam ID and "name" is current Steam name?

3. What are the differences between "sm_forcepass" and "sm_taketank"? The latter is for when the tank is controlled by AI, and the former is when it is controlled either by AI or non-admin player?

(END OF OFFTOPIC)

Sorry and thanks in advance
Sempiro is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 10-02-2021 , 11:14   Re: [L4D & L4D2] Left 4 DHooks Direct (1.60) [29-Sep-2021]
Reply With Quote #483

Quote:
Originally Posted by Accelerator View Post
ACT_* ANIMATION VALUES
Maybe you should take this to a separate optionally connected #include? The way it is done now makes it difficult to browse the available natives and forwards and, in my opinion, is of no importance.

Also, I do not quite understand the purpose of the Animation Activities file, which is in the data folder. I didn't see that it was used in the code in any way, except for parsing on plugin start.
Yeah I'll do this for next update. The main include will include the animation include so no extra <include> required.



Quote:
Originally Posted by Sempiro View Post
Hey man, thank you. Yeah, I have already installed it and using it, but I find it a little bit confusing.

(OFFTOPIC)

Code:
// Admin Commands (ADMFLAG_KICK):
sm_forcepass <#userid|name> // Force to pass the Tank to target player.
sm_taketank <#userid|name> // Take control of the Tank AI.
1. Is it possible to make the plugin act just like it is with "Tank Swap" plugin without the hustle of adding "#userid|name" to the command? With "Tank Swap", if you are an admin, just "sm_taketank" is enough, and "sm_taketank" was bind to a hotkey on my keyboard, I want to have the same functionality with this new plugin, but not sure how.

2. Also I do not get the formatting for "#userid|name"? "userid" here is Steam ID and "name" is current Steam name?

3. What are the differences between "sm_forcepass" and "sm_taketank"? The latter is for when the tank is controlled by AI, and the former is when it is controlled either by AI or non-admin player?

(END OF OFFTOPIC)

Sorry and thanks in advance
UserID as in typing status in console and seeing the persons UserID (not Steam ID). Name as appears in game. You can do "sm_forcepass @me" to target yourself only.
__________________
Silvers is offline
Sempiro
Member
Join Date: Apr 2014
Old 10-02-2021 , 12:51   Re: [L4D & L4D2] Left 4 DHooks Direct (1.60) [29-Sep-2021]
Reply With Quote #484

Quote:
Originally Posted by Silvers View Post
Yeah I'll do this for next update. The main include will include the animation include so no extra <include> required.





UserID as in typing status in console and seeing the persons UserID (not Steam ID). Name as appears in game. You can do "sm_forcepass @me" to target yourself only.
Ah, thanks a lot, this is exactly what I was looking for! Cheers!
Sempiro is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 10-05-2021 , 07:02   Re: [L4D & L4D2] Left 4 DHooks Direct (1.61) [05-Oct-2021]
Reply With Quote #485

Code:
1.61 (05-Oct-2021)
    - Added natives "L4D_GetTempHealth" and "L4D_SetTempHealth" to handle Survivors temporary health buffer.
    - Added natives "L4D_PlayMusic" to play a specified music string to a client. Thanks to "DeathChaos25" and "Shadowysn" for "Dynamic Soundtrack Sets" plugin.
    - Added natives "L4D_StopMusic" to stop playing a specified music string to a client. Thanks to "DeathChaos25" and "Shadowysn" for "Dynamic Soundtrack Sets" plugin.
    - Moved the animation ACT_* enums from "include/left4dhooks.inc" to "include/left4dhooks_anim.inc". Suggested by "Accelerator". No plugin changes required.

    - Thanks to "Psyk0tik" for requesting the following forwards and natives and their signatures found here: https://github.com/Psykotikism/L4D1-2_Signatures

    - Added natives:
        - "L4D2_HasConfigurableDifficultySetting" - Returns if there is a configurable difficulty setting.
        - "L4D2_IsGenericCooperativeMode" - Returns if the current game mode is Coop/Realism mode.
        - "L4D_IsCoopMode" - Returns if the current game mode is Coop mode.
        - "L4D2_IsRealismMode" - Returns if the current game mode is Realism mode.
        - "L4D2_IsScavengeMode" - Returns if the current game mode is Scavenge mode.
        - "L4D_IsSurvivalMode" - Returns if the current game mode is Survival mode.
        - "L4D_IsVersusMode" - Returns if the current game mode is Versus mode.

    - Added forwards:
        - "L4D_OnFalling" - Called when a player is falling.
        - "L4D_OnFatalFalling" - Called when a player is falling in a fatal zone.
        - "L4D2_OnPlayerFling" - Called when a player is flung to the ground.
        - "L4D_OnEnterStasis" - Called when a Tank enters stasis mode in Versus mode.
        - "L4D_OnLeaveStasis" - Called when a Tank leaves stasis mode in Versus mode.

    - GameData files, include file and plugins updated.
__________________

Last edited by Silvers; 10-05-2021 at 07:07.
Silvers is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 10-05-2021 , 08:11   Re: [L4D & L4D2] Left 4 DHooks Direct (1.61) [05-Oct-2021]
Reply With Quote #486

silver, I have some problems in l4d1.
Basically, I try to use Plugin_Handled to block m2 deadstop on hunter.

PHP Code:
// Called for every single shovable and even some of the unshovable entities in the game
forward Action L4D2_OnEntityShoved(int clientint entityint weaponfloat vecDir[3], bool bIsHighPounce); 
In l4d1 windows and linux, Plugin_Handled is working but sometimes not.
When hunter is about to pounce and land straight on your head (see picture below), hunter can get deadstopped.


PHP Code:
// L4D2 only uses this on Special Infected. Blocks hunter dead stop
forward Action L4D_OnShovedBySurvivor(int clientint victim, const float vecDir[3]); 
In l4d1 windows and linux, Plugin_Handled is not working.
Hunter doesn't play stun animation, but hunter can't move and get stuck for few seconds.


this is part of my code
PHP Code:
HookEvent("player_shoved"Event_PlayerShoved);
public 
void Event_PlayerShoved(Event event, const char[] namebool dontBroadcast)
{
    
int attacker GetClientOfUserId(GetEventInt(event"attacker"));
    
int victim GetClientOfUserId(GetEventInt(event"userid"));
     if (!
IsSurvivor(attacker) || !IsHunter(victim) ) return;

     
PrintToChatAll("\x01%N Invoked \"Event_PlayerShoved\x01 on \x03%N\x01"attackervictim);
}

public 
Action L4D_OnShovedBySurvivor(int shoverint shovee, const float vecDir[3])
{

    if (!
IsSurvivor(shover) || !IsHunter(shovee) ) return Plugin_Continue;

    
PrintToChatAll("\x01%N Invoked \"L4D_OnShovedBySurvivor\x01 on \x03%N\x01"shovershovee);

    return 
Plugin_Handled;
}

public 
Action L4D2_OnEntityShoved(int clientint entityint weaponfloat vecDir[3], bool bIsHighPounce)
{
     if (!
IsSurvivor(client) || !IsHunter(entity))
         return 
Plugin_Continue;

     
PrintToChatAll("\x01%N Invoked \"L4D2_OnEntityShoved\x01 on \x03%N\x01, bIsHighPounce: %d"cliententitybIsHighPounce);
 
     return 
Plugin_Handled;
}

// check if client is on survivor team
bool IsSurvivor(int client)
{
    return (
client && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 2);
}

// check if client is on infected team
bool IsInfected(int client)
{
    return (
client && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 3);

__________________

Last edited by HarryPotter; 10-06-2021 at 09:27.
HarryPotter is offline
Forgetest
Member
Join Date: Aug 2020
Old 10-07-2021 , 08:43   Re: [L4D & L4D2] Left 4 DHooks Direct (1.61) [05-Oct-2021]
Reply With Quote #487

Hi silvers, Harry informed me of 2 forward issues which is related to clone functions on Linux L4D1:
Code:
L4D_OnShovedBySurvivor
L4D2_OnStagger
I tried to make a solution of L4D_OnShovedBySurvivor like before, and it seems working.
Note that L4D2_OnStagger isn't tested.
Here is the gamedata, might be helpful to you.

Detour setups:
Code:
            "OnStaggered_clone"
            {
                "signature"        "OnStaggered_clone"
                "callconv"        "cdecl"
                "return"        "void"
                "this"            "ignore"
                "arguments"
                {
                    "a1"
                    {
                        "type"    "cbaseentity"
                        "register" "eax"
                    }
                    "a2"
                    {
                        "type"    "cbaseentity"
                        "register" "edx"
                    }
                    "a3"
                    {
                        "type"    "vectorptr"
                    }
                }
            }

            "OnShovedBySurvivor_clone"
            {
                "signature"        "OnShovedBySurvivor_clone"
                "callconv"        "cdecl"
                "return"        "int"
                "this"            "ignore"
                "arguments"
                {
                    "a1"
                    {
                        "type"    "cbaseentity"
                        "register" "eax"
                    }
                    "a2"
                    {
                        "type"    "cbaseentity"
                        "register" "edx"
                    }
                    "a3"
                    {
                        "type"    "vectorptr"
                    }
                }
            }
Signatures:
PHP Code:
            /*
             * CTerrorPlayer::OnStaggered(CBaseEntity *, Vector const) [clone]
             */
            
"OnStaggered_clone"
            
{
                
"library"    "server"
                "linux"        "@_ZN13CTerrorPlayer11OnStaggeredEP11CBaseEntityPK6Vector.part.711"
            
}
            
            
/*
             * CTerrorPlayer::OnShovedBySurvivor(CTerrorPlayer*, Vector const&) [clone]
             */
            
"OnShovedBySurvivor_clone"
            
{
                
"library"    "server"
                "linux"     "@_ZN13CTerrorPlayer18OnShovedBySurvivorEPS_RK6Vector.part.822.constprop.1107"
            

Btw learned from Dragokas, the signature TryOfferingTankBot_Clone can be replaced with symbol one:
PHP Code:
            /*
             * CDirector::TryOfferingTankBot(void) [clone]
             * unique string "Tank offer: Starting the lottery\n"
             * Only using this for Linux.
             */
            
"TryOfferingTankBot_Clone"
            
{
                
"library"    "server"
                "linux"        "@_ZN8Director18TryOfferingTankBotEP11CBaseEntityb.part.203"
            

Forgetest is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 10-15-2021 , 05:54   Re: [L4D & L4D2] Left 4 DHooks Direct (1.63) [15-Oct-2021]
Reply With Quote #488

Another big update!

Code:
1.62 (08-Oct-2021)
    - L4D1 Linux: Update thanks to "Forgetest" for writing.
    - L4D1 Linux: Fixed issues with the forwards "L4D_OnShovedBySurvivor" and "L4D2_OnStagger". Thanks "HarryPotter" for reporting.

    - L4D1 GameData file and plugin updated.
Code:
1.63 (15-Oct-2021)
    - Changed all projectile natives to allow passing 0 (world) instead of a client index. Thanks to "BHaType" for reporting.
    - Changed forward "L4D_OnGameModeChange" from "Action" type to "Void". Thanks to "Psyk0tik" for reporting.
    - Fixed commands "sm_l4dd_detours" and "sm_l4dhooks_detours" not showing all forwards when they have pre and post hooks.

    - Added 11 new forwards to L4D1 and L4D2. Thanks to "Psyk0tik" for the suggestions, signatures and detour functions.
        - "L4D_TankClaw_DoSwing_Pre" - When a tank is swinging to punch.
        - "L4D_TankClaw_DoSwing_Post" - When a tank is swinging to punch.
        - "L4D_TankClaw_GroundPound_Pre" - When an tank punches the ground.
        - "L4D_TankClaw_GroundPound_Post" - When an tank punches the ground.
        - "L4D_TankClaw_OnPlayerHit_Pre" - When a tank swings and punches a player.
        - "L4D_TankClaw_OnPlayerHit_Post" - When a tank swings and punches a player.
        - "L4D_TankRock_OnDetonate" - When a tank rock hits something.
        - "L4D_TankRock_OnRelease" - When a tank rock is thrown.
        - "L4D_PlayerExtinguish" - When a player is about to be extinguished.
        - "L4D_PipeBombProjectile_Pre" - When a PipeBomb projectile is being created.
        - "L4D_PipeBombProjectile_Post" - After a PipeBomb projectile is created.

    - Added 1 new forward to L4D2. Thanks to "Lux" for the suggestion, signature and detour functions.
        - "L4D2_MeleeGetDamageForVictim" - When calculating melee damage to inflict on something.

    - GameData files, include file and plugins updated.
__________________

Last edited by Silvers; 10-15-2021 at 05:55.
Silvers is offline
JLmelenchon
Senior Member
Join Date: Mar 2019
Old 10-17-2021 , 22:49   Re: [L4D & L4D2] Left 4 DHooks Direct (1.61) [05-Oct-2021]
Reply With Quote #489

Quote:
Originally Posted by HarryPotter View Post
silver, I have some problems in l4d1.
Basically, I try to use Plugin_Handled to block m2 deadstop on hunter.

PHP Code:
// Called for every single shovable and even some of the unshovable entities in the game
forward Action L4D2_OnEntityShoved(int clientint entityint weaponfloat vecDir[3], bool bIsHighPounce); 
In l4d1 windows and linux, Plugin_Handled is working but sometimes not.
When hunter is about to pounce and land straight on your head (see picture below), hunter can get deadstopped.


PHP Code:
// L4D2 only uses this on Special Infected. Blocks hunter dead stop
forward Action L4D_OnShovedBySurvivor(int clientint victim, const float vecDir[3]); 
In l4d1 windows and linux, Plugin_Handled is not working.
Hunter doesn't play stun animation, but hunter can't move and get stuck for few seconds.


this is part of my code
PHP Code:
HookEvent("player_shoved"Event_PlayerShoved);
public 
void Event_PlayerShoved(Event event, const char[] namebool dontBroadcast)
{
    
int attacker GetClientOfUserId(GetEventInt(event"attacker"));
    
int victim GetClientOfUserId(GetEventInt(event"userid"));
     if (!
IsSurvivor(attacker) || !IsHunter(victim) ) return;

     
PrintToChatAll("\x01%N Invoked \"Event_PlayerShoved\x01 on \x03%N\x01"attackervictim);
}

public 
Action L4D_OnShovedBySurvivor(int shoverint shovee, const float vecDir[3])
{

    if (!
IsSurvivor(shover) || !IsHunter(shovee) ) return Plugin_Continue;

    
PrintToChatAll("\x01%N Invoked \"L4D_OnShovedBySurvivor\x01 on \x03%N\x01"shovershovee);

    return 
Plugin_Handled;
}

public 
Action L4D2_OnEntityShoved(int clientint entityint weaponfloat vecDir[3], bool bIsHighPounce)
{
     if (!
IsSurvivor(client) || !IsHunter(entity))
         return 
Plugin_Continue;

     
PrintToChatAll("\x01%N Invoked \"L4D2_OnEntityShoved\x01 on \x03%N\x01, bIsHighPounce: %d"cliententitybIsHighPounce);
 
     return 
Plugin_Handled;
}

// check if client is on survivor team
bool IsSurvivor(int client)
{
    return (
client && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 2);
}

// check if client is on infected team
bool IsInfected(int client)
{
    return (
client && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 3);

Left 4 Dead 2 had this problem too.
JLmelenchon is offline
Tonblader
Senior Member
Join Date: Jul 2011
Location: Peru
Old 10-19-2021 , 16:46   Re: [L4D & L4D2] Left 4 DHooks Direct (1.63) [15-Oct-2021]
Reply With Quote #490

Can you add new target filters?

@deads - target dead survivors (all survivors, including bots)
@deadis - target dead infected special (all infected special, including bots)
@deadsp - target dead survivors players (no bots)
@deadisp - target dead survivors players (no bots)
@deadsb - target survivors bots (no players)
@deadisb - target infected special bots (no players)

@sp - target survivors players (no bots)
@isp - target infected special players (no bots)

Quote:
Originally Posted by Silvers View Post
PHP Code:
"@incappedsurvivorbot",      // Random Incapped Survivor Bot
"@isb",                      // Random Incapped Survivor Bot
"@survivorbot",              // Random Survivor Bot
"@sb",                       // Random Survivor Bot
"@infectedbot",              // Random Infected Bot
"@ib",                       // Random Infected Bot
"@tankbot",                  // Random Tank Bot
"@tb",                       // Random Tank Bot 
The problem with these targets is that they don't start with @r (which implies that they would be random targets).
Example:
@risb // Random Incapped Survivor Bot

Also missing their corresponding versions of those target filters to select all the targets within that target filter.
Example:
@isb // Incapped Survivor Only Bots
@isp // Incapped Survivor Only Players

Last edited by Tonblader; 10-19-2021 at 16:55.
Tonblader 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 23:38.


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