Help Understanding Mod Error Appreciated

In the timespan between today and yesterday, I only found two things, one of which I could fix. Turns out some false statements a while back were missing semicolons. Necessary fix, but the mod’s still unplayable. Nah, I tried to throw the code into a script fixer, and the closest explanation I could find about my mod being unable to have its input ended without “unexpected tokens” was some kind of “Unrecoverable Syntax Error”. Still experimenting, but I’ve been making sure to give myself a break every now and again hoping I find some profound, unexpected solution.

Apologies for the delayed response. Would it be possible for you to send me your code (through PM would be possible if you’d prefer that)? That way I can understand the way you formatted your code better, and I’ll be able to find a solution for you.

Perfectly understandable, I’ve been busy with life myself. Honestly, I’m just grateful to get any kind of assistance. I’ll be sending the .txt file of the code here in a bit.

I’ve had a look at your source code and I believe I’ve found the problem.

From the point you implement the platforms (around line 1000), you aren’t closing the functions sufficiently (though sometimes you do). You need to close your functions as such:

(function () {
//code
})();

However, from line 1000 downwards, you’re closing them as so

(function () {
};
1 Like

So after making the necessary fixes, discovering new errors that were somehow overlooked and undetected, and fixing said new errors…I was finally able to start up the game without an error message popping up with my mod activated. Now I can finally playtest it! Seriously, thanks to everyone, I wouldn’t have made it this far without your help! Just goes to show how relevant formatting really is.

1 Like

Well I have some good news and bad news: The good news is that the mod is still capable of being loaded without a crippling error on startup. The bad news is, while it was partially playtestable for a time, it now instantly crashes upon starting a new game. I’ve deleted my saves and carefully ensured that the old saves weren’t being restored, yet it doesn’t work. The specific error reads: Error Uncaught error. Please report this to support@greenheartgames.com: Uncaught TypeError: Cannot read property ‘experience’ of null (file:///C:/Program%20Files%20(x86)/Steam/steamapps/common/Game%20Dev%20Tycoon/compressed/codeNw.js:1714) Please restart the game.

Now I actually did try to read that line of script in the Compressed CodeNw file, despite the fact that it’s a fecking nightmare to sort through. The only thing I vaguely understood was that it had something to do with the research sections of my mod (Which I found previously weren’t even being read because I accidentally formatted them as notes). What absolutely confuses me though is that I followed the API very closely, so there shouldn’t be anything wrong with the research section of my mod…but there is so there must be something I’m not seeing.