• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Can we make show_error() less stupid?

TheouAegis

Member
Code:
show_error("File error type mismatch",0);
That pops up a standard GMS error message window with the text "File error type mismatch" alright, but then immediately below it is " at gml_Script_doError (line 2) - show_error("File error type mismatch",0);" What's the point of the error message showing the code that says to show the error message? GM8's custom errors were cleaner than this. Is there an option I missed?

Ugh. This was just a quick little app I was writing up for myself and now I have to waste time on making viable error messages? If my HD on my laptop didn't just crap out on me, I'd be using GM8 for this project. ...So much data at risk of being wiped off my old laptop, assuming it can even run after I eventually reformat it. :(:bash:
 

TheouAegis

Member
The stack at the bottom I don't mind so much. It's the fact that it shows you the show_error() line itself, which is just ridiculous. What's the point of telling the error message to print out a message if it's just going to print out that same message twice -- once as you instructed it, and a second time as the current line? It's basically just saying, "Here's an error message because, as you can see, the programmer wanted to show an error message here and this was how (s)he programmed me to show you this." It's like an error message you'd expect the computer on The Heart Of Gold to spit out.
 

Yal

🐧 *penguin noises*
GMC Elder
C's #error preprocessor directive has the same stupid result (it generates an error condition with the custom error, then the compiler catches it and prints out a stack trace containing the entire line causing the error), so I'd say it works just fine as-is. (Not that C is the paragon of good programming language design or anything, but as long as GM isn't worse than C, I'd say it's doing its job).

Stop wasting time thinking about making good error messages, first of all - be happy you get the message and think about formatting later. What you need to do ASAP is to dump all the HDD contents on something less about to dying. Start with copying important files (if they're organized well enough that you can find them) and then just copy the entire disk to a new disk just to be sure. Tools that does this on a "raw" level (instead of a "file" level) might work better and induce less wear-and-tear on the disk.

Also, in the future, make sure to back up important files so you won't lose anything you care about even if a HDD is destroyed or lost. I personally recommend using Git to back things up since it both makes it trivial to restore a backup (git checkout <revision> in a existing repository, git clone <repo path> to restore it on a new machine, e.g. if the old one mega-died and you need to set up a new computer), and fairly easy to connect to a standard cloud service (as in Gitlab, Bitbucket - no idea if Dropbox has any native support for it).
 
Top