Cause of crashing when loading a saved game, isolated?

Created by RazorclawX, Wanderers of Sorceria tells an epic length story through multiple chapters and books for WarCraft III.

Moderator: RazorclawX

Post Reply
User avatar
Xenon
Zerg Queen's Nest Slave Trainee
Zerg Queen's Nest Slave Trainee
Posts: 771
Joined: Mon Oct 23, 2006 3:29 pm

Cause of crashing when loading a saved game, isolated?

Post 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.
User avatar
Thadeu
Terran Barracks Laundry Master
Terran Barracks Laundry Master
Posts: 32
Joined: Sun Sep 09, 2007 8:24 am

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

Post 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.
User avatar
Theia_Loki
Zerg Infested Terran (Unemployed)
Zerg Infested Terran (Unemployed)
Posts: 295
Joined: Thu Jul 03, 2008 6:26 pm
Location: clarington area (residence better left unknown)

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

Post 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.
"I figure language is a poor enough a means of communication as it is so we have to use all the words we've got. Besides, there are damned few words that everybody understands"
~Henry Drummond, Lawyer from Inherit the Wind

First Time Attempt at an LP:
[url]https://plus.google.com/u/0/110762779327102029687/posts/A1UWNRafWZT?pid=6149648681644876370&oid=110762779327102029687P[/url]
User avatar
Xenon
Zerg Queen's Nest Slave Trainee
Zerg Queen's Nest Slave Trainee
Posts: 771
Joined: Mon Oct 23, 2006 3:29 pm

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

Post 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.
Last edited by Xenon on Sat Jan 17, 2009 12:37 pm, edited 1 time in total.
Post Reply