Throw us a freaking bone here (Exceptions)

7 posts / 0 new
Last post
Throw us a freaking bone here (Exceptions)

I'm not sure of Haxe or ActionScript or any of the things you're using to code the game support throwing Exceptions, but I have noticed that the various errors that pop up in modding never have an error screen or any kind of exception handling.

For example, the File Not Found error, when the loading freezes on file 7. That could easily be a Thrown error, or at least an Error code, actually saying "File not found".

That's a good suggestion! ActionScript 3, the language NEO Scavenger uses, does support thrown exceptions. The lack of thrown errors is mostly due to my limited programming skill (or laziness).

Right now, if the file is missing, I believe it throws "Error #2032." The freezing you're seeing, could it be something else?

In either case, maybe I can try to catch some of the more common thrown exceptions and print out something more helpful in the loading log. To wit, file not found, bad ID, bad file format, or anything else I can readily identify. I'm not sure how easy it'll be, but it seems like I should be able to do some.

Any other loading error situations that come up a lot in modding?

Edit: I'm going to move this discussion over to the modding forums, as it seems worth getting others' input.

Dan Fedor - Founder, Blue Bottle Games

Something along of the syntax error, maybe? Like if there is a one coma too many somewhere, stuff like that.

<--Mighty (mini)Mod of Doom-->
DeviantArt Gallery of MoD Sprites

Yes, choking on spaces within the csv list of fields. I always seem to want to add spaces for readability.

I've made a little progress on this today. Namely:

Added code to trim spaces out of neogame.xml mod ID and data ID references before trying them.
Added code to display error message if file not found while loading game data and mods.
Added code to display error message if xml file is badly formed or has errors. (E.g. missing close bracket, quote, or closing tag)
Added code to display error if getmods.php has a missing mod, wrong mod name, or wrong mod path.

This'll catch a lot of the more common cases, but there could be others that I'm missing. The "extra commas" check would be useful, but I'm not sure I could write error-checking for each specific case. Since different fields have different comma amounts, and some allow any number, I'd run into trouble.

Were there any specific examples you guys ran into that I should test? I've been randomly breaking data and filenames here and there to see where the most common errors pop up. But I may miss some.

Dan Fedor - Founder, Blue Bottle Games

Mostly what you mentioned already. Stuff like wrong image file types or images actually missing, the "0:" missing and things pointing to the non-existing data, stuff like this.

You maybe could, I think, make the code that hunts for stuff that should not be there at all, to find at least some coma problems. Things like double coma ",,", double pipe "||" or one of those right next to the line-closing bracket ",<" or "|<" are the succession of signs that are never used for anything, in a healthy code. So finding those can always scream "Warning!" I believe :D

<--Mighty (mini)Mod of Doom-->
DeviantArt Gallery of MoD Sprites

How about Chiko's infamous comment start tags that don't have an end tag? Having <!-- without the --> end tag breaks my XMLImport in the Mod Editor as it is an invalid XML construct. Your game imports the file fine though.