Skip to main content

Blog Archive

Script Analysis Tool Highlights Possibly Game-Breaking Errors

October 2, 2014

by zeuxcg


The Script Analysis tool is meant to help developers make high-caliber games faster.

The Studio team is always working to ensure that our building and development kit is as robust and easy to use as possible, and we believe this update speaks precisely to that notion. We have launched a new Script Analysis tool, which highlights possible (and potentially game-breaking) errors in your scripts by underlining the problem areas in blue. This tool supplements Studio’s existing syntax checker, which highlights incorrectly formatted code by underlining it in red.

The Script Analysis feature should make the scripting and subsequent testing of your place or game a much more streamlined experience, while simultaneously saving you the time and energy of sifting through line after line of code to find what could be minor mistakes. There’s also now more comprehensive linkage between our Wiki and Studio to solve your problems faster than you ever could before.

As you probably know, ROBLOX games are scripted using Lua. Lua is more open-ended and less restrictive than other programming languages, like, say, C++. And though we love the openness of Lua, that very quality can bite you when you’re writing a ton of code and accidentally make typos that you didn’t see (hey, we’re human, it happens). In other words, it’s easy to make an error and not even recognize that you made it.

“Help” is the name of the game here. In this image, you see contextual Wiki help at left, and the Script Analysis panels in the center.

With our new Script Analysis tool, we’re hoping to end this scenario for good. After you enable the tool, you’ll start to notice blue lines appearing beneath your code — in addition to red lines that highlight outright errors that simply won’t run. The blue lines are “warning lines,” meaning the tool has determined that there may be a minor error in the way you’ve written your script. If you hover over the warning line errors, you can look at suggestions of errors. Have you ever used Google and had it ask you, “Did you mean?…” due to a spelling error? This functions something like that.

To use the Script Analysis tool, click View > Script Analysis in the ROBLOX Studio menu.

We’ve also added a new Studio panel that can show you what the errors or warnings you receive mean. This index is linked directly to the ROBLOX Wiki, and we’re embedding the information in Studio, so you never have to leave the game development environment to access information on the Wiki. What’s great about the warning lines is that they’re suggestions, not necessarily correct answers. This will in no way affect the way you script (we’ve seen some very unique methods over the years), so if you’ve intentionally written code that creates a blue warning line, you can choose to ignore it.

To view the contextual Wiki help, click View > Context Help in the ROBLOX Studio menu.

This is the beginning of several changes that are coming to Studio, many of which will be based on our new Script Analysis system. We’re currently working on getting this to work with more types of programming — it’s not robust enough to work with object-oriented programming in Lua, but it will be. We should also note here that, if you’re a beginner to ROBLOX Studio, we have embedded a series of tutorials you can see by clicking View > Tutorials in the ROBLOX Studio menu.

Ultimately, scripting is challenging, and we understand that. We want to continue building tools like our Script Analysis to streamline your coding and debugging processes. Any coder will tell you that the best way to fixing and patching bugs is to catch them while coding, not looking for the errors later. We hope this helps.