HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Tips on how to not make Warcraft 3 crash

04-09-2006, 12:18 AM#1
Ignitedstar
I think we all know that there plenty of ways to make Warcraft 3 crash. I'm sure many people have experienced a game crash playing single player, LAN, or Battle.net. This thread is to ask everyone who is willing to participate to give their tips on what certain things in the World Editor that have a possiblility of making Warcraft 3 crash, so people can avoid doing such things later.

It's probably true that most situations people wouldn't dare do, but there are exceptions.

NOTE: Keep in mind that when Warcraft 3 crashes, most computers would automattically close Warcraft and give you a fatal error warning. Or it could also be when Warcraft completely freezes.
04-09-2006, 02:33 AM#2
TaintedReality
I know there are many more I've encountered..but this is the one I always forget about and that always takes me forever to find and fix:

When using the specific unit event 'Unit Takes Damage', if you order 'Event Damage Source' to damage 'Triggering Unit' (damaged unit) immediately, it crashes.
04-09-2006, 03:01 AM#3
paidan_fain
Quote:
Originally Posted by TaintedReality
When using the specific unit event 'Unit Takes Damage', if you order 'Event Damage Source' to damage 'Triggering Unit' (damaged unit) immediately, it crashes.
A.K.A - Infinite loops with no chance to get out.
04-09-2006, 03:12 AM#4
PipeDream
- using str/agi/int tomes on non heroes
- units outside of map
- high number of attack dice
- battlestations on a hero
- ExecuteFunc a func that doesn't exist, or that takes arguments/returns
- bad value to Player() such as -1
04-09-2006, 06:14 AM#5
Vuen
Quote:
Originally Posted by paidan_fain
A.K.A - Infinite loops with no chance to get out.

Not all infinite loops crash WC3; afaik only the types that spawn threads in the loop, like this one, crash. Otherwise the game just stops executing triggers when it hits an infinite loop.
04-09-2006, 09:07 AM#6
Rao Dao Zao
I've got a few involving custom models that cause crashes - things assigned to non-existant things, such as a geoset pointing to material 14 when there is no material 14. Also, non-negative "minimum extents" seem to cause problems.
04-09-2006, 01:10 PM#7
Immoralis
when you dont use endif, crashes when saves
also when you dont have a final return as pipedream pointed out
04-09-2006, 04:23 PM#8
Vuen
Quote:
Originally Posted by Immoralis
when you dont use endif, crashes when saves
also when you dont have a final return as pipedream pointed out

We're talking about crashing Warcraft 3, not the World Editor.
04-09-2006, 04:42 PM#9
Earth-Fury
Quote:
Originally Posted by Vuen
We're talking about crashing Warcraft 3, not the World Editor.

Redundency is the only way to preserve and spread information to the masses, so why prevent it by limiting a thread to a single topic, when other closely-related topics are also of much use?
04-09-2006, 05:42 PM#10
Vuen
Quote:
Originally Posted by Earth-Fury
Redundency is the only way to preserve and spread information to the masses, so why prevent it by limiting a thread to a single topic, when other closely-related topics are also of much use?

If someone's map is crashing Warcraft 3, and they come read this thread, they'll be wasting their time going through their code looking for incomplete if blocks. It's the difference between runtime errors and compiler errors; they are completely unrelated.
04-09-2006, 09:52 PM#11
Immoralis
Quote:
Originally Posted by Vuen
If someone's map is crashing Warcraft 3, and they come read this thread, they'll be wasting their time going through their code looking for incomplete if blocks. It's the difference between runtime errors and compiler errors; they are completely unrelated.

Wasting his/her time to read to sentences, i dont know about you but i can read 2 sentences in little time, if you are taking the time to read 2 sentence fragments to the extent that you "wasting your time" then you have some serious problems. Also, posting useless comments isn't a real time saver as well.
04-09-2006, 10:56 PM#12
PipeDream
I think his point is that it will confuse people with out proper organization.
04-10-2006, 12:21 AM#13
Vuen
Quote:
Originally Posted by Immoralis
Wasting his/her time to read to sentences, i dont know about you but i can read 2 sentences in little time, if you are taking the time to read 2 sentence fragments to the extent that you "wasting your time" then you have some serious problems. Also, posting useless comments isn't a real time saver as well.

What the heck are you talking about? Read my post again, you read it wrong. They won't be wasting time 'reading his post', they'll waste time looking through their code for an if-endif block. Some maps have many thousands of lines of code, which would take many hours to go through. It's a waste of time looking for missing endifs because that couldn't possibly be the problem, since the map wouldn't even compile in the first place.

In every other programming language, errors are very well defined as either "compiler errors" or "runtime errors" for this exact reason. If you're getting a runtime error, it makes no sense to spend hours looking through your code for compiler errors because the code would never have compiled in the first place!
04-10-2006, 08:35 AM#14
Captain Griffen
How about we stop arguing randomly in this thread over whether or not to put things which crash a part of Warcraft 3 (the editor) in a thread about how not to crash Warcraft 3?
04-10-2006, 05:10 PM#15
FriendlyWarlord
Ok.

- Event is "unit is issued order" or similar to that, and an action issues another order for that unit (unless there's a wait first).
- Changing the camera bounds when the camera rotation isn't 90 degrees (I haven't tested this outside of WEU). Fixed by changing rotation to 90 right before changing the camera bounds (i.e. in the same trigger, one after another).