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

[L4D & L4D2] Tank Rock Lag Compensation


Post New Thread Reply   
 
Thread Tools Display Modes
larrybrains
Senior Member
Join Date: May 2017
Old 12-27-2019 , 16:34   Re: [L4D & L4D2] Tank Rock Lag Compensation
Reply With Quote #11

This plugin seems to cause issues with the hunting rifle being able to hit tank rocks.

When the plugin is enabled, nobody on my server can destroy tank rocks with the hunting rifle. If I disable this plugin, the issue goes away.

EDIT: I think I found a fix:

For "IsRifle", needed to add a line for "hunting_rifle"

PHP Code:
public bool IsRifle(const char[] weaponName)
{
    return 
StrEqual(weaponName"rifle")
        || 
StrEqual(weaponName"rifle_ak47")
        || 
StrEqual(weaponName"rifle_desert")
        || 
StrEqual(weaponName"rifle_m60")
        || 
StrEqual(weaponName"rifle_sg552")
        || 
StrEqual(weaponName"hunting_rifle");

EDIT 2: Actually, it might fit better under IsSniper, but works either way.

Last edited by larrybrains; 12-27-2019 at 17:11. Reason: A note
larrybrains is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 12-28-2019 , 08:18   Re: [L4D & L4D2] Tank Rock Lag Compensation
Reply With Quote #12

Quote:
Originally Posted by larrybrains View Post
This plugin seems to cause issues with the hunting rifle being able to hit tank rocks.

Oh, never noticed that before,thanks
I modify code and test
if StrEqual(weaponName, "hunting_rifle") under IsRifle(),
hunting rifle needs 3~4 shots to break tank

if under IsSniper(), only need 1 shot
__________________

Last edited by HarryPotter; 12-28-2019 at 08:19.
HarryPotter is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 03-04-2020 , 21:41   Re: [L4D & L4D2] Tank Rock Lag Compensation
Reply With Quote #13

This plugin conflicts with the Anomaly plugin and causes the errors below to spam the error log. Please could you add in the following to fix?

Code:
L 03/05/2020 - 02:20:04: [SM] Exception reported: Entity -1 (-2019573042) is invalid
L 03/05/2020 - 02:20:04: [SM] Blaming: l4d_rock_lagcomp.smx
L 03/05/2020 - 02:20:04: [SM] Call stack trace:
L 03/05/2020 - 02:20:04: [SM]   [0] GetEntPropVector
L 03/05/2020 - 02:20:04: [SM]   [1] Line 230, l4d_rock_lagcomp.sp::OnGameFrame
You're storing EntIndexToEntRef but never verify it on retrieval. Remove invalid rocks from the array, line 230 add:
PHP Code:
if( !rockEntity || EntRefToEntIndex(rockEntity) == INVALID_ENT_REFERENCE )
{
    
Array_RemoveRock(rockEntitiesArrayrockEntity);
    continue;

To avoid a further conflict where this plugin makes the Anomaly rock visible I would suggest checking the "m_iHammerID". It would be most efficient to do:

PHP Code:
// Add this line before "Array_AddNewRock" in "OnEntityCreated"
SDKHook(entityRefSDKHook_SpawnPostSpawnPost);

// Add this below outside "OnEntityCreated" function.
void SpawnPost(int entity)
{
    if( 
GetEntProp(entityProp_Data"m_iHammerID") == 92950 )
    {
        
Array_RemoveRock(rockEntitiesArrayEntIndexToEntRef(entity));
    }

That way the rock is removed from the array and saving many CPU cycles from the OnGameFrame function.

I would have made Anomaly compatible with this plugin but it's not possible on my end and the fix has to come from this plugin.

Thank you.


Edit: Since author is probably inactive, I've attached the plugin. Requires SMLib to compile so I've attached the compile version too.
Attached Files
File Type: smx l4d_rock_lagcomp.smx (13.3 KB, 211 views)
File Type: sp Get Plugin or Get Source (l4d_rock_lagcomp.sp - 205 views - 19.4 KB)
__________________

Last edited by Silvers; 03-05-2020 at 14:04.
Silvers is offline
larrybrains
Senior Member
Join Date: May 2017
Old 03-29-2020 , 14:13   Re: [L4D & L4D2] Tank Rock Lag Compensation
Reply With Quote #14

Quote:
Originally Posted by fbef0102 View Post
I found one more issue with this plugin
mounted machine gun being unable to hit tank rocks

I guess the author missed this weapon name
PHP Code:
weaponName"prop_mounted_machine_gun" 
Edit:
-fixed two missing weapon names "hunting_rifle" and "prop_mounted_machine_gun"
-add some codes from Silvers
When I try to compile this, I get some warnings on some of the new lines related to the mounted machine gun:

PHP Code:
l4d_rock_lagcomp.sp(166) : warning 213tag mismatch
l4d_rock_lagcomp
.sp(178) : warning 213tag mismatch
l4d_rock_lagcomp
.sp(459) : warning 213tag mismatch
l4d_rock_lagcomp
.sp(460) : warning 213tag mismatch 
larrybrains is offline
kmah
Junior Member
Join Date: Oct 2019
Old 08-01-2020 , 10:23   Re: [L4D & L4D2] Tank Rock Lag Compensation
Reply With Quote #15

Quote:
Originally Posted by larrybrains View Post
This plugin seems to cause issues with the hunting rifle being able to hit tank rocks.

When the plugin is enabled, nobody on my server can destroy tank rocks with the hunting rifle. If I disable this plugin, the issue goes away.

EDIT: I think I found a fix:

For "IsRifle", needed to add a line for "hunting_rifle"

PHP Code:
public bool IsRifle(const char[] weaponName)
{
    return 
StrEqual(weaponName"rifle")
        || 
StrEqual(weaponName"rifle_ak47")
        || 
StrEqual(weaponName"rifle_desert")
        || 
StrEqual(weaponName"rifle_m60")
        || 
StrEqual(weaponName"rifle_sg552")
        || 
StrEqual(weaponName"hunting_rifle");

EDIT 2: Actually, it might fit better under IsSniper, but works either way.

man many thanks i was looking for that for age, thanks bunch dude you save my life
kmah is offline
kmah
Junior Member
Join Date: Oct 2019
Old 08-01-2020 , 10:48   Re: [L4D & L4D2] Tank Rock Lag Compensation
Reply With Quote #16

Quote:
Originally Posted by fbef0102 View Post
Oh, never noticed that before,thanks
I modify code and test
if StrEqual(weaponName, "hunting_rifle") under IsRifle(),
hunting rifle needs 3~4 shots to break tank

if under IsSniper(), only need 1 shot
thank you for the additional information
kmah is offline
Shao
Senior Member
Join Date: Jan 2015
Old 08-12-2020 , 16:07   Re: [L4D & L4D2] Tank Rock Lag Compensation
Reply With Quote #17

I'm unable to get this plugin working, rocks simply don't break no matter how many times they are shot or the settings used. I can confirm the ability to shoot them because when the plugin is turned off, they break just fine.

I've used the latest gamedata and plugin version to no good result.
Shao is offline
MasterMe
Member
Join Date: Mar 2010
Location: Netherlands
Old 10-04-2020 , 08:53   Re: [L4D & L4D2] Tank Rock Lag Compensation
Reply With Quote #18

For me it works fine, also after the land stand update. I used rock_lagcomp.txt from OP and plugin itself from fbef0102 above https://forums.alliedmods.net/showpo...0&postcount=14. I had to compile it locally from the scripting directory, using the transitional_syntax branch of smlib for SourceMod 1.10 https://github.com/bcserv/smlib/tree...itional_syntax. Note that I use Linux for the server.

I attached the compiled plugin here in case it helps anyone, for the source see fbef0102's post as mentioned earlier.
Attached Files
File Type: smx l4d_rock_lagcomp.smx (13.6 KB, 127 views)
__________________
MasterMe is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 06-18-2021 , 11:11   Re: [L4D & L4D2] Tank Rock Lag Compensation
Reply With Quote #19

confirmed that windows signature is broken because I can't break the rock
here is update

v1.14 (2022/1/30 )

- Signature update for L4D2's "2.2.1.3" update
- New syntax code
- Compatibility support for SourceMod 1.11. Fixed various warnings.

PHP Code:
    "left4dead2"
    
{
        
"Signatures"
        
{
            
/* identifier string "tank_rock_throw_impact"*/
            
"CTankRock::Detonate"
            
{
                
"library"        "server"
                "linux"            "@_ZN9CTankRock8DetonateEv"
                "windows"        "\x55\x8B\xEC\x83\xEC\x34\x53\x56\x8B\xF1\x80\xBE\x7C\x1A\x00\x00\x00"
                                
/* 55 8B EC 83 EC 34 53 56 8B F1 80 BE 7C 1A 00 00 00  */
            
}
        }
    } 
Attached Files
File Type: txt rock_lagcomp.txt (845 Bytes, 270 views)
File Type: sp Get Plugin or Get Source (l4d_rock_lagcomp.sp - 320 views - 20.2 KB)
__________________

Last edited by HarryPotter; 01-30-2022 at 07:05.
HarryPotter is offline
strikeraot
Senior Member
Join Date: Dec 2018
Location: Viet Nam
Old 01-30-2022 , 06:00   Re: [L4D & L4D2] Tank Rock Lag Compensation
Reply With Quote #20

Quote:
Originally Posted by HarryPotter View Post
confirmed that windows signature is broken because I can't break the rock
here is update

- Signature update for L4D2's "2.2.1.3" update
- New syntax code
PHP Code:
    "left4dead2"
    
{
        
"Signatures"
        
{
            
/* identifier string "tank_rock_throw_impact"*/
            
"CTankRock::Detonate"
            
{
                
"library"        "server"
                "linux"            "@_ZN9CTankRock8DetonateEv"
                "windows"        "\x55\x8B\xEC\x83\xEC\x34\x53\x56\x8B\xF1\x80\xBE\x7C\x1A\x00\x00\x00"
                                
/* 55 8B EC 83 EC 34 53 56 8B F1 80 BE 7C 1A 00 00 00  */
            
}
        }
    } 
failed to compile
Quote:
//// l4d_rock_lagcomp.sp
//
// C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2 Dedicated Server\left4dead2\addons\sourcemod\scripting\ include\smlib\entities.inc(1773) : error 418: deprecated syntax; see https://wiki.alliedmods.net/SourcePa...yntax#Typedefs
// C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2 Dedicated Server\left4dead2\addons\sourcemod\scripting\ l4d_rock_lagcomp.sp(1773) : error 001: expected token: "-identifier-", but found "public"
// C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2 Dedicated Server\left4dead2\addons\sourcemod\scripting\ l4d_rock_lagcomp.sp(1773) : error 122: expected type expression
// C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2 Dedicated Server\left4dead2\addons\sourcemod\scripting\ l4d_rock_lagcomp.sp(1773) : error 010: invalid function or declaration
//
strikeraot is offline
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 10:50.


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