Lua Errors

A couple of updates ago I started reporting Lua errors back to our servers. This was to serve a few purposes.

  • Show us workshop addons that were erroring, so we could warn/remove them
  • Show me where my scripts were erroring, so I could fix them
  • Show me where something in an update caused problems with addons, so I could retain compatibility

So I got a rudimentary site up here, and it’s working pretty well, serving its purpose.

One thing that was apparent was that people were getting Lua errors that they shouldn’t have been getting. For example..

lua/postprocess/morph.lua:6: attempt to call method 'SetMaterialTexture' (a nil value)

This shouldn’t have been happening because morph.lua isn’t included in GMod anymore. This file must have got left over somehow. (one of my theorys is that it’s still on some dedicated servers – but at the time my stats didn’t reveal whether error reporting clients were connected to servers). So I added some code to delete the file if it found it.. and the errors faded out.

The fact that they faded out instead of just dying dead suggests to me that they were probably being sent by servers. Since the server update was optional, the servers might not have restarted for hours – but clients could still join and get the old Lua files.

To prove this theory, here’s another graph. This error was happening when people loaded an old save with a camera in it, a bug I fixed with yesterday’s update. As you can see, the error dies straight away.

So it’s working out pretty good. I’m going to expand the system so that we can show all the errors created by a particular gamemode, addon or addon author. Maybe one day we will have a GMod where players don’t have to live with an error notification on their screen while they play.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s