Prison Architect Guide

Script Debugger: how to find bugging objects for Prison Architect

Script Debugger: how to find bugging objects

Overview

Do you have the Script Debugger window popping up when playing a game, but no idea what’s bugging you?This little guide will explain how to find out what’s wrong with one of your mods.

Script Debugger window with no errors…

Sometimes a scripted mod can have a bug which will produce an error. Unfortunately the Script Debugger window is bugged by itself, leading to confusions. What’s going on here?

When a script error pops up, it will open the Script Debugger window. But this window won’t open on the bugging object. Instead, it will open on some random scripted object on the map.

So what you will get is a window with no error messages, as shown in the screenshot.
The example opened the StreetManager object, but as you can see this object is perfectly fine. So the bugging object is something completely different…

Finding the bugged object

What you have to do is press the bottom left button of this window. A list will appear with all scripted objects on your map.

This can be a real pain if you have a large map with many scripted objects. The example shows only a few, but this list can become HUGE.

Click on an item in the list to open the Script Debugger for that object. No errors? Click the button again and check the next object from the list… Until you finally find the error.

Error found!

If you are lucky, you will find the object with the bug sooner or later. This screenshot shows the bugging object. As you can see, the error wasn’t in the StreetManager object, but in the CarFrontLesson object, on line 86 of that script to be exact…
When you have many mods enabled, this will be a big problem. You think at first that the StreetManager was bugging you, since it opens on that object. But that script window was empty, so the mod which has the StreetManager in it had NOTHING to do with the actual bug. It has become a Russian Roulette since PA update 8, when the devs ♥♥♥ up the Script Debugger…

Debug.txt – another way to find script errors

Another way to find script errors is by looking into the debug.txt file which is made by the game. To see what’s going on in this file, open the game menu and go to the Options screen, where you click on Open Save Folder.

The Windows Explorer window will open and there you have debug.txt
Quit the game once you’ve opened this window.

Debug.txt will be constantly updated by the game, so scroll to the bottom of the file and there you will find the error soon enough.


With a bit of luck the errors will show up just after a bugged script has been run by the game, so you should be able to know which script was bugging you. Unfortunately, the error in this example remains a mystery, since there was no script directly above it… instead the game just saved the preferences.txt file on the moment this error occurred. Sometimes you can guess which kind of object it was, depending on the kind of error you see…

Conclusion

Script errors have become very confusing.

The Script Debugger window pops up, and the only thing you saw at first was ‘StreetManager’, so you would think that the mod with that object has a bug.

Next, you’d probably start complaining at that mods’ comments section that this mod has bugs and opens the debugger. But the author of that mod has nothing to do with the bug you are experiencing.

In fact, it can be a completely different mod, and it usually IS a completely different mod which is bugging you.

So before you start posting your complaints at a mods page, you should be sure that you have actually pinpointed that particular mod to be problematic. Because in 99% of the cases it’s NOT that mod which gave you problems.

SteamSolo.com