TTT-2 / TTT2

Trouble in Terrorist Town 2 for Garry's Mod (gmod)
https://steamcommunity.com/sharedfiles/filedetails/?id=1357204556
178 stars 74 forks source link

Console error on Clients #1207

Open mexikoedi opened 10 months ago

mexikoedi commented 10 months ago

Your version of TTT2 (mandatory)

Describe the bug (mandatory)

Some Clients get an error in the console which appears to happen random? I cannot pinpoint it but it only happens on some Clients. For example I didn't get this error. This error was not present in earlier TTT2 versions. (prior 0.12.0)

To reproduce

Steps to reproduce the behaviour:

  1. Join a game
  2. Play around
  3. An error should appear in the console after some time/some action

Expected behaviour

This error shouldn't appear.

Context (please provide as much as you can)

TimGoll commented 10 months ago

I don't really see how this can break. The error is happening in this line: image

However I can't see any scenario where line is a nil value: image

mexikoedi commented 10 months ago

I also don't know why. I hadn't this issue, only some other players. This appeared randomly but I think most of the time right after round start. And it's a new issue, this only started to appear recently after 0.12.0. But I couldn't pinpoint it down. They also redownloaded TTT2 from the Steam Workshop but it didn't help them.

sbzlzh commented 10 months ago

I also don't know why. I hadn't this issue, only some other players. This appeared randomly but I think most of the time right after round start. And it's a new issue, this only started to appear recently after 0.12.0. But I couldn't pinpoint it down. They also redownloaded TTT2 from the Steam Workshop but it didn't help them.

I think it might be a plugin conflict.

mexikoedi commented 8 months ago

More information for this issue: This error seems to appear if you switch to a specific weapon. For example from holstered to a specific weapon. But only while the round is active and even then not always. For example I experienced this issue once recently while switching to this item: https://steamcommunity.com/sharedfiles/filedetails/?id=2846938449 But I didn't get this error before TTT2 version 0.12.x. Some other weapons also cause this error to pop up.

Some new players on my server have also received this error and one person has reported this issue to me via a Steam Workshop comment, that's why I decided to provide more information which could help identify the cause of this issue.

EntranceJew commented 8 months ago

This is because you're using the legacy function AddHUDHelp, which wasn't included in previous versions of TTT2:

if CLIENT then self:AddHUDHelp("ttt2_kiss_help1", "ttt2_kiss_help2", true) end

when what you should be using is this function:

if CLIENT then self:AddTTT2HudHelp("ttt2_kiss_help1", "ttt2_kiss_help2") end
TimGoll commented 8 months ago

While this is true, TTT2 should still support (and it did in the past, maybe we messed something up) the old function call

EntranceJew commented 8 months ago

i can't test it with the current version at this second, but a lot of errors have had to do with resetting the HUDHelp struct and not initializing bindingLines to an empty table, prior to changes made in the latest few releases -- ClearHUDHelp should be handling that situation now where it wasn't previously but it's been a while since that released. some people are still having the scoreboard problem on workshop.

mexikoedi commented 8 months ago

Didn't notice that this was changed. I have always used the "old" function call since it was introduced. Is there any significant difference between them and why does it create errors and why only sometimes?

TimGoll commented 8 months ago

Didn't notice that this was changed. I have always used the "old" function call since it was introduced. Is there any significant difference between them and why does it create errors and why only sometimes?

The change was introduced at least 3 years ago. The old one doesn't support icons etc, you should most definitely use the new function if you have the choice

mexikoedi commented 8 months ago

i can't test it with the current version at this second, but a lot of errors have had to do with resetting the HUDHelp struct and not initializing bindingLines to an empty table, prior to changes made in the latest few releases -- ClearHUDHelp should be handling that situation now where it wasn't previously but it's been a while since that released. some people are still having the scoreboard problem on workshop.

I also get the "scoreboard stuck error" sometimes and reported it here: https://github.com/TTT-2/TTT2/issues/1292

mexikoedi commented 8 months ago

Didn't notice that this was changed. I have always used the "old" function call since it was introduced. Is there any significant difference between them and why does it create errors and why only sometimes?

The change was introduced at least 3 years ago. The old one doesn't support icons etc, you should most definitely use the new function if you have the choice

Wow, ok. Completely missed it. Will update my addons to the new one. Good to know, thanks.

TimGoll commented 8 months ago

i can't test it with the current version at this second, but a lot of errors have had to do with resetting the HUDHelp struct and not initializing bindingLines to an empty table, prior to changes made in the latest few releases -- ClearHUDHelp should be handling that situation now where it wasn't previously but it's been a while since that released. some people are still having the scoreboard problem on workshop.

I also get the "scoreboard stuck error" sometimes and reported it here: #1292

I've seen this issue once in a video by dhalu, but I'm unable to reproduce it on my machine