Page 1 of 1

Cause of crashing when loading a saved game, isolated?

Posted: Tue Jan 06, 2009 2:31 am
by Xenon
Several missions (The Siege of Kanai, Dragon's Eye etc) crash with an access violation every time a saved game is loaded (at least for me...). Both of these, and likely several others, have a combination of functions that are likely the culprit.

The problem looks like this:

Set temppoint = (Center of (Playable map area))
Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility from temppoint to a radius of 512.00
Custom script:  call RemoveLocation(udg_temppoint)

Inserting this into the initialization of a simple map will make it crash every time the saved game is loaded. Perhaps upon loading, the visibility modifier is recreated using its specified variable, except that in this case that variable has already been removed by RemoveLocation.

It could probably be fixed by giving each visibility modifier its own point variable that is never removed.

Re: Cause of crashing when loading a saved game, isolated?

Posted: Wed Jan 14, 2009 2:02 pm
by Thadeu
Thats happen with me too. But just in book 4  :-\ . You need win without save the game(cant load some phases), and this is bad.

Re: Cause of crashing when loading a saved game, isolated?

Posted: Wed Jan 14, 2009 4:15 pm
by Theia_Loki
I've had this happen to me. It occurred whenever I loaded a saved game in the chapter in Book 3 that involved those neat siege devices that launch hawk soldiers of sorts to help open the doors to the fort from within. I've had to resort to winning that chapter without saving myself.

Re: Cause of crashing when loading a saved game, isolated?

Posted: Fri Jan 16, 2009 5:49 pm
by Xenon
In the Temple of the Dragon King, some of the crashes after loading a saved game are probably related to the triggers that try to update the color of lightnings that no longer exist because they were not saved by the saved game. Re-initializing the lightnings upon loading a saved game might fix it.

Like RCX said, the coding for lightnings and images is shoddy; I found this bug a while ago. After all, these variable types were added as an afterthought.

Edit: it seems the more critical problem is the Zapfield Gen trigger destroying the lightnings that weren't saved. It crashes when loading a game saved while the lightnings are active, adding to the apparently random nature of this crash. My proposed solution: add a "Cancel Destroying Lightnings" boolean that is set to false when creating the lightnings, and set to true when loading a saved game. When it's true, have the trigger skip the "destroy lightnings" line.

I also noticed some code to check whether udg_KeelaPortrait == null. As I understand it, when the game is loaded, the variable isn't null, it still has a value that points to data that was never loaded.