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

[L4D & L4D2] Left 4 DHooks Direct (1.146) [21-Apr-2024]


Post New Thread Reply   
 
Thread Tools Display Modes
King_OXO
Senior Member
Join Date: Dec 2020
Location: Brazil
Old 06-25-2023 , 19:27   Re: [L4D & L4D2] Left 4 DHooks Direct (1.133) [19-Jun-2023]
Reply With Quote #931

̶C̶o̶u̶l̶d̶ ̶y̶o̶u̶ ̶c̶r̶e̶a̶t̶e̶ ̶r̶e̶t̶u̶r̶n̶s̶ ̶t̶o̶ ̶d̶e̶t̶e̶c̶t̶ ̶t̶h̶e̶ ̶v̶i̶c̶t̶i̶m̶s̶ ̶o̶f̶ ̶t̶h̶e̶ ̶i̶n̶f̶e̶c̶t̶e̶d̶?̶


Found
__________________
My Noob Plugins

Discord:WhiteFire#1301
Steam:WhiteFire
Youtube

Last edited by King_OXO; 06-25-2023 at 19:41.
King_OXO is offline
NeoTM
AlliedModders Donor
Join Date: Feb 2013
Location: Britain
Old 06-28-2023 , 08:03   Re: [L4D & L4D2] Left 4 DHooks Direct (1.133) [19-Jun-2023]
Reply With Quote #932

I got this error at startup but the server look fine.

Spoiler


Is that important?
__________________
82.66.75.218:27015 - Walk In Dead Nightmare
82.66.75.218:27016 - Walk In Dead Rampage
82.66.75.218:27017 - Walk In Dead Vanilla
NeoTM is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 06-28-2023 , 08:32   Re: [L4D & L4D2] Left 4 DHooks Direct (1.133) [19-Jun-2023]
Reply With Quote #933

Quote:
Originally Posted by NeoTM View Post
I got this error at startup but the server look fine.

Spoiler


Is that important?
That's from my plug-in. It has nothing to do with this one.
cravenge is offline
Sev
Veteran Member
Join Date: May 2010
Old 07-01-2023 , 16:02   Re: [L4D & L4D2] Left 4 DHooks Direct (1.133) [19-Jun-2023]
Reply With Quote #934

Error

[left4dhooks.smx] Native L4D2_GetSurvivorSetMap should not be used before OnMapStart, please report to 3rd party plugin author.
Sev is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 07-01-2023 , 18:10   Re: [L4D & L4D2] Left 4 DHooks Direct (1.133) [19-Jun-2023]
Reply With Quote #935

Hey Silver I noticed that you added the following forwards that can block the round end.

PHP Code:
// Called before score calculations and the scoreboard display
forward Action L4D2_OnEndVersusModeRound(bool countSurvivors);

// Called after all score calculations are complete and the scoreboard shows
forward void L4D2_OnEndVersusModeRound_Post();

// Called after all score calculations are complete and the scoreboard shows
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D2_OnEndVersusModeRound_PostHandled(); 
This created a challenge for me as once you block the round end it completely removes the condition and you have no way to end the round. Since all the signatures are shared, can you add a SDK call native to end the round as well?

I did the testing and the following code worked for me. This is partial code, but you already have the rest of the framework so it should work.

PHP Code:
    g_pDirector        hGameData.GetAddress("CDirector");
    
g_pVersusMode    hGameData.GetOffset("VersusModePtr");
    
g_pVersusMode    LoadFromAddress(g_pDirector view_as<Address>(g_pVersusMode), NumberType_Int32);
    
    
StartPrepSDKCall(SDKCall_Raw);
    if( 
PrepSDKCall_SetFromConf(hGameDataSDKConf_Signature"CDirectorVersusMode::EndVersusModeRound") == false )
    {
        
LogError("Failed to find signature: \"CDirectorVersusMode::EndVersusModeRound\"");
    } else {
        
PrepSDKCall_AddParameter(SDKType_BoolSDKPass_Plain);
        
PrepSDKCall_SetReturnInfo(SDKType_PlainOldDataSDKPass_Plain);
        
g_hSDK_CDirectorVersusMode_EndVersusModeRound EndPrepSDKCall();
        if( 
g_hSDK_CDirectorVersusMode_EndVersusModeRound == null )
            
LogError("Failed to create SDKCall: \"CDirectorVersusMode::EndVersusModeRound\"");
    } 
Here is the actual call.

PHP Code:
SDKCall(g_hSDK_CDirectorVersusMode_EndVersusModeRoundg_pDirectorcountSurvivors); 
I also noticed that the description isn't super clear here.

PHP Code:
// Called before score calculations and the scoreboard display
forward Action L4D2_OnEndVersusModeRound(bool countSurvivors); 
I would suggest adding more detail to the bool.
  • 0 - Survivors didn't make it to saferoom.
  • 1 - Survivors made to the saferoom
__________________
Spirit_12 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 07-05-2023 , 10:30   Re: [L4D & L4D2] Left 4 DHooks Direct (1.133) [19-Jun-2023]
Reply With Quote #936

Quote:
Originally Posted by Spirit_12 View Post
This created a challenge for me as once you block the round end it completely removes the condition and you have no way to end the round. Since all the signatures are shared, can you add a SDK call native to end the round as well?

I did the testing and the following code worked for me. This is partial code, but you already have the rest of the framework so it should work.
I added the native L4D_EndVersusModeRound but calling it only ends the first round, it does not end the second.
__________________
Silvers is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 07-05-2023 , 16:33   Re: [L4D & L4D2] Left 4 DHooks Direct (1.133) [19-Jun-2023]
Reply With Quote #937

Quote:
Originally Posted by Silvers View Post
I added the native L4D_EndVersusModeRound but calling it only ends the first round, it does not end the second.
By first round you mean before the teams switch from survivor and infected right? If so then that's perfect and should be done that way.

Thanks!
__________________
Spirit_12 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 07-10-2023 , 13:09   Re: [L4D & L4D2] Left 4 DHooks Direct (1.134) [10-Jul-2023]
Reply With Quote #938

Code:
1.134 (10-Jul-2023)
    - Added "POINTER_SURVIVALMODE" enum for the "L4D_GetPointer" native to return the SurvivalMode pointer.
    - Added "L4D2CT_SurvivalSetupTimer" to the "L4D2CountdownTimer" enum for use with the "L4D2_CTimer*" natives.
    - Added stock "L4D_SetPlayerTempHealthFloat" to the "left4dhooks_stocks.inc" include file to set a players temporary health above 200 HP. Thanks to "Eyal282" for the code.
    - Added forwards "L4D_TankRock_BounceTouch", "L4D_TankRock_BounceTouch_Post" and "L4D_TankRock_BounceTouch_PostHandled" when a tank rock collides with something. Thanks to "Forgetest" for the code.
    - Added natives "L4D2_GetSurvivalStartTime" and "L4D2_SetSurvivalStartTime" to get and set the Survival start time. Requested by "Forgetest".
    - Added native "L4D2_SpawnAllScavengeItems" to spawn all Scavenge items. Thanks to "Eyal282" for some of the code and changes.
    - Added native "L4D2_Rematch" to restart a Versus game. Thanks to "Eyal282" for some of the code and changes.
    - Added native "L4D_EndVersusModeRound" to end the Versus round. Thanks to "Spirit_12" for some of the code and changes.
    - Fixed native "L4D2_Charger_StartCarryingVictim" removing teleporting and placement position bug. Thanks to "HarryPotter" for reporting.
    - Fixed L4D2 GameData offset for "L4D2_GetFirstSpawnClass" and "L4D2_SetFirstSpawnClass" natives. Thanks to "Forgetest" for reporting the new offset.
    - Errors about using natives before OnMapStart will now show the plugin causing it.

    - Updated: Plugin and test plugin.
    - Updated: "/scripting/gamedata/left4dhooks.l4d1.txt" GameData file.
    - Updated: "/scripting/gamedata/left4dhooks.l4d2.txt" GameData file.
    - Updated: "/scripting/include/left4dhooks.inc" Include file.
    - Updated: "/scripting/include/left4dhooks_stocks.inc" Include file.
    - Updated: "/scripting/l4dd/l4dd_forwards.sp" project file.
    - Updated: "/scripting/l4dd/l4dd_gamedata.sp" project file.
    - Updated: "/scripting/l4dd/l4dd_natives.sp" project file.
    - Updated: "/scripting/l4dd/l4dd_setup.sp" project file.
__________________
Silvers is offline
SpannerV2
Member
Join Date: Jun 2019
Old 07-14-2023 , 14:20   Re: [L4D & L4D2] Left 4 DHooks Direct (1.134) [10-Jul-2023]
Reply With Quote #939

Is using this and L4DToolz compatible with each other or will errors occur?
SpannerV2 is offline
Hawkins
Senior Member
Join Date: Jul 2021
Old 07-14-2023 , 14:39   Re: [L4D & L4D2] Left 4 DHooks Direct (1.134) [10-Jul-2023]
Reply With Quote #940

Quote:
Originally Posted by SpannerV2 View Post
Is using this and L4DToolz compatible with each other or will errors occur?
They are compatible.
Hawkins 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 14:21.


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