Please don't keep loading saves after syntax errors occur

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
Post Reply
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Please don't keep loading saves after syntax errors occur

Post by Dugi »

This feature of the game is very annoying for anyone who develops an add-on. When the game loads and an error occurs, such as invalid closing tag or nested quoted string, the game stops loading that add-on, but continues trying to load the save file. This delays anyone who writes a campaign, but more importantly, it usually results in a failure to load the save file. It finds some add-on specific units in the save file or some custom terrain tiles and reports that message afterwards. The second message is much shorter, less technical and easier to remember and a player is more likely to report the second error than the first one, although the second error message is utterly useless.

Example (the most sick case I can think of at the moment):
The campaign requires a dependency that was suddenly updated and it changes the definition of a macro the campaign uses. The campaign uses some custom units.

All works fine for the campaign's developer. The player updates add-ons and suddenly the compatibility is broken. Loading throws this error:

Code: Select all

This add-on has errors and could not be loaded:
The Bald Cadaver
Please report this message to the add-on's author:
Macro SUMMON_MANIACAL_MISCREATION expects 3 arguments, but is given 2 arguments at ~add-ons/The_Bald_Cadaver/scenarios/24_Year_Dungeon_Party.cfg:666 included from ~add-ons/The_Bald_Cadaver/_main.cfg:66
The player hits Enter, hoping that the error will go, it keeps loading for a while and then it reports:

Code: Select all

Error while playing game: Unknown unit type: Cerebral Bore
I have seen many times that the player is very likely to report the second error, not the first one. Even if it's a beginning add-on creator and he is asking on the forums what is the cause of his error. As a result, nobody can learn what can be wrong, only that something is wrong. In the above described case, it would take very long to the add-on's author to learn what is causing the problem.

So, I would be glad if this issue could be somehow resolved. In singleplayer, a simple and working solution could be to stop loading once an error occurs. For multiplayer, it might be more problematic, because one broken add-on should not break whole multiplayer. Another solution could be to have it remember what was broken and repeat the error when loading a save fails and an error message about it is displayed (however, if the message is done via exceptions, it might be hard to implement).

Note: This particular error message was completely fabricated, I am not developing such a campaign (it would also infringe some copyrights, but I doubt that these Scotsmen would ever find out) .
Post Reply