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
xerox8521
Senior Member
Join Date: Sep 2011
Old 11-16-2021 , 10:22   Re: [L4D & L4D2] Left 4 DHooks Direct (1.74) [16-Nov-2021]
Reply With Quote #521

Wouldn't it be just easier to use the return value of GetEntPropEnt for functions like L4D_GetVictimHunter (with the l4d2 check where required) ? So it's consistent with other functions that return entities.

Also I think the additional include files need some clean up to remove all duplicate definitions like teams and infected classes. Maybe let the main include add the others ?
xerox8521 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 11-16-2021 , 10:42   Re: [L4D & L4D2] Left 4 DHooks Direct (1.74) [16-Nov-2021]
Reply With Quote #522

Quote:
Originally Posted by xerox8521 View Post
Wouldn't it be just easier to use the return value of GetEntPropEnt for functions like L4D_GetVictimHunter (with the l4d2 check where required) ? So it's consistent with other functions that return entities.

Also I think the additional include files need some clean up to remove all duplicate definitions like teams and infected classes. Maybe let the main include add the others ?
To return -1 instead of 0? Since these are new, I prefer to return 0 so it's easier to check the value such as: if(L4D_GetVictimHunter()) instead of if(L4D_GetVictimHunter != -1) for example.

There are many duplicate natives and stocks etc, this is to keep backwards compatibility with plugins which may use them.
__________________
Silvers is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 11-16-2021 , 11:01   Re: [L4D & L4D2] Left 4 DHooks Direct (1.74) [16-Nov-2021]
Reply With Quote #523

Quote:
Originally Posted by xerox8521 View Post
Also I think the additional include files need some clean up to remove all duplicate definitions like teams and infected classes. Maybe let the main include add the others ?
Keep in mind that L4DH serves as a combination (and replacement) of several past projects that have been abandoned by their authors long ago while also bringing relevance to newer projects with never-before-seen features/assets. A lot of those projects tend to overlap with each other so L4DH oversees them to make it easier for end-users to transition from any of those old projects to L4DH.
__________________
Psyk0tik is offline
user2000
Member
Join Date: Nov 2015
Location: Peru - Lima
Old 11-16-2021 , 22:05   Re: [L4D & L4D2] Left 4 DHooks Direct (1.74) [16-Nov-2021]
Reply With Quote #524

I can't compile it

PHP Code:
//// left4dhooks.sp
//
// E:\JuegosSteam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\include\left4dhooks_stocks.inc(154) : error 009: invalid array size (negative, zero or out of bounds)
// E:\JuegosSteam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\include\left4dhooks_stocks.inc(163) : error 010: invalid function or declaration
// E:\JuegosSteam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\include\left4dhooks_stocks.inc(1541) : error 009: invalid array size (negative, zero or out of bounds)
// E:\JuegosSteam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\include\left4dhooks_stocks.inc(1599) : error 010: invalid function or declaration
// E:\JuegosSteam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\include\left4dhooks_stocks.inc(1601) : error 009: invalid array size (negative, zero or out of bounds)
// E:\JuegosSteam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\include\left4dhooks_stocks.inc(1636) : error 010: invalid function or declaration
// E:\JuegosSteam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\include\left4dhooks_stocks.inc(1672) : error 010: invalid function or declaration
//
// 7 Errors.
//
// Compilation Time: 0.81 sec
// ---------------------------------------- 
user2000 is offline
Forgetest
Member
Join Date: Aug 2020
Old 11-17-2021 , 06:21   Re: [L4D & L4D2] Left 4 DHooks Direct (1.74) [16-Nov-2021]
Reply With Quote #525

Hey Silvers big thanks for the great work.
I'd like to post a few issues found when skimming through, mainly in left4dhooks_stocks.inc.
  • L4D_HasAnySurvivorLeftSafeArea becomes duplicate because it exists both in main include and the _stocks include. Though it doesn't seem to make compilation fails.
  • PHP Code:
    /**
     * Returns whether player has visible threats.
     *
     * Note: This function only works on Survivors. Survivors looking upon
     * specials, witch or tank will be marked as has visisble threats. However
     * looking at commons will not be seen as has visible threats. The common has
     * to be awkaen from its slumber before beings seen as a threat.
     *
     * @parma client        Client index.
     * @return              True if player has visible threats, false otherwise.
     * @error               Invalid client index.
     */
    stock bool L4D_HasVisibleThreats(int client)
    {
        return 
    view_as<bool>(GetEntProp(clientProp_Send"m_hasVisibleThreats"));

    I'd suggest the description is not correct because I've seen a plugin utilizing this netprop on Infected ghosts to see if they are "visible" to Survivors.

The least one not quite an issue, but personally I think it would be better to merge your include, which is _silver.inc, and the _stocks.inc, as it's kinda weird when I include the stocks and find that it's missing a function that tells if player is hanging ledge, and there're some functions that are kind of duplicate (e.g. L4D_IsPlayerIncapacitated and L4D_IsPlayerIncapped).

Nonetheless, good job man
Forgetest is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 11-17-2021 , 09:38   Re: [L4D & L4D2] Left 4 DHooks Direct (1.74) [16-Nov-2021]
Reply With Quote #526

Quote:
Originally Posted by user2000 View Post
I can't compile it
Would be helpful if you mentioned which SM version. I tried on 1.10 and latest 1.11 and have no issues.



Quote:
Originally Posted by Forgetest View Post
L4D_HasAnySurvivorLeftSafeArea becomes duplicate because it exists both in main include and the _stocks include. Though it doesn't seem to make compilation fails.
Should I remove the SDKCall or stock? Or I'm thinking better to rename the stock to L4D_HasAnySurvivorLeftSafeAreaStock. Description is copy paste from l4d_stocks but I will update that.


Quote:
Originally Posted by Forgetest View Post
The least one not quite an issue, but personally I think it would be better to merge your include, which is _silver.inc, and the _stocks.inc, as it's kinda weird when I include the stocks and find that it's missing a function that tells if player is hanging ledge, and there're some functions that are kind of duplicate (e.g. L4D_IsPlayerIncapacitated and L4D_IsPlayerIncapped).

Nonetheless, good job man
You're saying to merge "_silver.inc" and "_stocks.inc" together? I wanted to keep them separate since "_stocks.inc" is from "l4d_stocks.inc". I didn't want to completely change "_stocks.inc" and wanted to separate my additions. I didn't realize incapped one was duped, maybe I should remove before anyone uses. You only need to "#include <left4dhooks>" to use them all.

Maybe I should merge them into 1. Hmmm.



So far this is 1.75 update:
Code:
    - Fixed forward "L4D2_OnHitByVomitJar" throwing errors about null pointer.
    - Forwards "L4D_OnVomitedUpon" and "L4D2_OnHitByVomitJar" attacker now can be reported as 0.
    - Deprecated stock "L4D_IsPlayerIncapped" from the "left4dhooks_silver" include.
    - Renamed the stock "L4D_HasAnySurvivorLeftSafeArea" to "L4D_HasAnySurvivorLeftSafeAreaStock" (the native "L4D_HasAnySurvivorLeftSafeArea" still exists).
    - Include <left4dhooks> will load all <left4dhooks_*> includes. Other <left4dhooks_*> includes will attempt to load each other.
So you can include any of the other "<left4dhooks_*>" includes and they will attempt to include each other. Or just use the main "<left4dhooks>" include to include everything. This allows you to only include one of the "<left4dhooks_*> includes if you don't want to use the main "<left4dhooks>" include. Problem is when others want to compile and you only use 1 or 2 includes they must be told which ones.

For example "#include <left4dhooks_stocks>" will do this:
PHP Code:
#tryinclude <left4dhooks_anim>
#tryinclude <left4dhooks_silver>
#tryinclude <left4dhooks_lux_library> 
__________________

Last edited by Silvers; 11-17-2021 at 10:37.
Silvers is offline
Forgetest
Member
Join Date: Aug 2020
Old 11-17-2021 , 11:32   Re: [L4D & L4D2] Left 4 DHooks Direct (1.74) [16-Nov-2021]
Reply With Quote #527

Quote:
Originally Posted by Silvers View Post
You're saying to merge "_silver.inc" and "_stocks.inc" together? I wanted to keep them separate since "_stocks.inc" is from "l4d_stocks.inc". I didn't want to completely change "_stocks.inc" and wanted to separate my additions. I didn't realize incapped one was duped, maybe I should remove before anyone uses. You only need to "#include <left4dhooks>" to use them all.

Maybe I should merge them into 1. Hmmm.
Sorry that before I posted that opinion I didn't confirm if there's actually an issue that sourcemod will include enums despite unused, which leads to unexpected larger compiled file. Since the concern doesn't exist after practice, there could probably no need to merge these includes of stocks into a huge set, and I won't need to avoid doing #include <left4dhooks> which had been supposed to raise the file size.

In my opinion, it's just a bit weird that the _stocks.inc doesn't contain some functions that should be there, while they can be found in _silver.inc.

Anyway, this probably isn't an issue and will not cause any issue, but it's really appreciated that you've come up with a decent solution on this slight "complaint". Many thanks.

Last edited by Forgetest; 11-17-2021 at 11:37.
Forgetest is offline
user2000
Member
Join Date: Nov 2015
Location: Peru - Lima
Old 11-17-2021 , 12:32   Re: [L4D & L4D2] Left 4 DHooks Direct (1.74) [16-Nov-2021]
Reply With Quote #528

Quote:
Originally Posted by Silvers View Post
Would be helpful if you mentioned which SM version. I tried on 1.10 and latest 1.11 and have no issues.
sourcemod 1.11.0.6711
metamod 11.0-dev+1143V

maybe i have to update my sourcemod?
user2000 is offline
tRololo312312
Senior Member
Join Date: Apr 2015
Old 11-17-2021 , 15:54   Re: [L4D & L4D2] Left 4 DHooks Direct (1.74) [16-Nov-2021]
Reply With Quote #529

Getting crashes since updating Left 4 Dhooks.

https://crash.limetech.org/ei3lwu5zkogx
https://crash.limetech.org/pamhaxdntnbj
https://crash.limetech.org/dwrshy7fqaqm

EDIT: Oops i was supposed to post this under L4DD thread... Anyway, the crash seems to come from IsReachable.

Last edited by Silvers; 11-17-2021 at 18:06. Reason: moved post
tRololo312312 is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 11-17-2021 , 17:50   Re: [L4D & L4D2] Left 4 DHooks Direct (1.74) [16-Nov-2021]
Reply With Quote #530

Quote:
Originally Posted by Silvers View Post
Would be helpful if you mentioned which SM version. I tried on 1.10 and latest 1.11 and have no issues.
The latest sm 1.11.

That happens due to stricter check of array declaration. See:
https://github.com/alliedmodders/sourcepawn/issues/702
https://github.com/alliedmodders/sou...#array-changes
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas 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 10:06.


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