View Single Post
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 02-27-2020 , 16:15   Re: [L4D & L4D2] Left 4 DHooks Direct (1.3) [27-Feb-2020]
Reply With Quote #30

Quote:
Originally Posted by Kai0205 View Post
I'm so sorry that I don't understand English, I want to ask something briefly.
This plugin will replace "[L4D2] Left 4 Downtown 2" ?
Yes.


Quote:
Originally Posted by TiTz View Post
But on booting the server I got this error
Thanks, fixed. Forgot to add a check to exclude L4D1 from Director Variables fix.


Quote:
Originally Posted by hoanganh81097 View Post
native L4D_OnGetScriptValueInt still wont work. Plugin cant spawn more "MaxSpecials"
Well it's definitely being read again. Maybe the director already has the value and won't change when reading a new one, but that doesn't seem right since on some maps the var is triggered many times during gameplay and dynamically changed.

Edit: so I added this to test, used z_spawn hunter, and it was limiting the number of special infected allowed to spawn. Each time I used z_spawn it would trigger "MaxSpecials" below. See the results:
PHP Code:
public Action L4D_OnGetScriptValueInt(const char[] keyint &retVal)
{
    if (
StrEqual(key"MaxSpecials") )
    {
        
PrintToServer("TEST_FWD ############## %s %d"keyretVal);
        
retVal = -1// No specials can spawn.
        
retVal 0// 1 special can spawn.
        
retVal 1// 2 specials can spawn.
        
return Plugin_Handled;
    }
    return 
Plugin_Continue;

It's strange setting the value to 1 less than the amount you want to spawn, but that's just how it seems to work. That's the games odd behaviour, left4dhooks isn't randomly setting -1 on the variable you change.

When left4dhooks starts, it calls the variable "MaxSpecials" which triggers the "L4D_OnGetScriptValueInt" forward with "MaxSpecials" variable.

If there are any other director variables not being set because they're triggered too early let me know and I'll add them to also trigger forwards when the plugin starts.




Updated:
Code:
1.4 (28-Feb-2020)
    - AnimHooks no longer affect the same client index if the previous user disconnected and someone else connected.
    - Clarified AnimHooks details in the include file. All AnimHooks are removed on map change.
    - Fixed L4D1: "Invalid Handle" errors caused by Director Variables fix. Thanks to "TiTz" for reporting.
__________________

Last edited by Silvers; 02-27-2020 at 21:04.
Silvers is offline