I have experienced several crashes since I first started designing in aok, which was for about 1 year ago.
More than 1 year has past since I first posted here on aokh, and I feel like I should share my experience
Now I know how to avoid crashing with triggers and how to fix it easily. Most of the crashes I have now is map-related rather than trigger-related. I'm going to tell you what can cause the game to crash, and how I solve it.
To find a crashing trigger
1. Make a copy of your file and name it like "Test Crash trigger" or something
2. Open the map
3. Go to trigger section
4. If you have tons of triggers (100+) read 4b), if you have only a few, read 4a)
4a) Turn off all triggers so that their starting status is OFF. Then turn on the triggers 1 by one and test. When you have the crashing trigger ON, the game will crash. Then you have the crashing trigger.
4b) Sort the triggers in to sections first, then delete 1 section at a time and test. When you find the section that has a trigger that crashes the game, do 4a) with that section only.
5) Check the effects in the trigger and see what might be crashing it. Check the list below to get some ideas what might be causing it to crash.
Triggers that can cause the game to crash
Stop Unit - Stop Unit seems to crash for me sometimes. I haven't really figured out how to fix this yet.
Freeze Unit - Same as Stop Unit, but crashes less than Stop Unit for me.
Task Object - Make sure to set Area/Objects to task to a location. If you don't do so, all units on the map belonging to that player will be tasked. If the player has over 300 objects, the game will crash.
Kill Object - If you kill more than 300 objects are once, the game will crash. Set specific objects and split it in to different effects to avoid crashing.
Remove Object - If you remove more than 300 objects are once, the game will crash. Set specific objects and split it in to different effects to avoid crashing.
Activate Trigger - When Activate Trigger effect doesn't have a trigger to activate, the game will crash. Usually if you place a trigger and uses Activate Trigger to make it fire, and then delete the trigger. Leaving the Activate Trigger with not trigger to activate.
Deactivate Trigger - When Deactivate Trigger effect doesn't have a trigger to deactivate, the game will crash. Usually if you place a trigger and uses Deactivate Trigger to stop it, and then delete the trigger. Leaving the Deactivate Trigger with not trigger to deactivate.
Unload - I've experienced several crashes with this one. Might be if you set no area/object you want to unload, or if you forget to set location. So make sure you have the desired area/object and location.
Change Ownership - If your effect has no object of area, it will change ownership of all units on map. If there are more than 300 units, the game will crash. Make sure you have correct area and objects selected to avoid crash. If it still crashes, split it in to several effects and areas.
Damage Object - If your effect has no object of area, it will damage all units on map. If there are more than 300 units, the game will crash. Make sure you have correct area and objects selected to avoid crash. If it still crashes, split it in to several effects and areas.
Change Object HP - If your effect has no object of area, it will change HP to all units on map. If there are more than 300 units, the game will crash. Make sure you have correct area and objects selected to avoid crash. If it still crashes, split it in to several effects and areas.
Change Object Attack - If your effect has no object of area, it will change attack to all units on map. If there are more than 300 units, the game will crash. Make sure you have correct area and objects selected to avoid crash. If it still crashes, split it in to several effects and areas.
Change View - Change View crashes if you change view over a very large distance or if you change very close to the edge of the map. Split it in to several triggers, each trigger changes view over a smaller distance
Play Sound - This effect is implemented in to Send Chat and Display instructions as well. I have no (or very little) experience with this effect. But it's is something with that sound file can not be more than 128 kbps or something like that.
If nothing of the above helped, you should read this:
Random Crashes in the editor
Sometimes you might find a so callad "issued tile". It will crash instantly if you try to paint terrain over it. Use map-copy over it to remove this. It should work fine afterwards.
If you place GAIA units and then go to triggers tab and change or add a trigger that changes a specific object. Then you'll see that the "Go to Object" button isn't working. To solve this, go to Units tab, choose a player manually. If you press the hotkeys (1,2,3,4,5,6,7,8 or 0) the game might crash!
When you map-copy areas, make sure you do not map-copy objects so that they get placed outside the edge of the map. This will cause the game to crash instantly.
Random Crashes when testing
If you have flowers or other objects laying over the edge, the map can be very instable and sometimes crash. Move the objects so that they don't go over the edge and it should be fine.
Ice and shallows at the edge of the map can also crash the game. Remove it and it should be fine.
A huge elevation variety on the edge of the map can be instable and cause the game to crash sometimes. Try to have as little elevation changes as possible near the edge and it should be fine.
Ice tiles in the middle of the map (not on the edge) can crash the game. I've only experienced single ice-tiles that crashes. It works fine when I replace the ice with another terrain, but as soon as I try to put back the ice, the game crashes. The crash occurs when just after "Saving Scenario" screen disappears when you test the scenario in the editor.
Map-copied objects on water can also be instable. I've experienced several crashes when I have map-copied old stoneheads on water and then tested. It usually work fine if I map-copy normal water on it and re-do it.
Every time you test your map, the map will be autosaved as Default0, open this file and save under a different name to get the file back if you forgot to save before.
And remember to save often and make back-up files in case you lose your file or it gets corrupted.
If this didn't help you, tryLord_Fadawas Game Crash Troubleshooting and the Scenario Design FAQ questions 122-132 in the section "Help it’s all gone wrong"
More than 1 year has past since I first posted here on aokh, and I feel like I should share my experience
Now I know how to avoid crashing with triggers and how to fix it easily. Most of the crashes I have now is map-related rather than trigger-related. I'm going to tell you what can cause the game to crash, and how I solve it.
1. Make a copy of your file and name it like "Test Crash trigger" or something
2. Open the map
3. Go to trigger section
4. If you have tons of triggers (100+) read 4b), if you have only a few, read 4a)
4a) Turn off all triggers so that their starting status is OFF. Then turn on the triggers 1 by one and test. When you have the crashing trigger ON, the game will crash. Then you have the crashing trigger.
4b) Sort the triggers in to sections first, then delete 1 section at a time and test. When you find the section that has a trigger that crashes the game, do 4a) with that section only.
5) Check the effects in the trigger and see what might be crashing it. Check the list below to get some ideas what might be causing it to crash.
If nothing of the above helped, you should read this:
Sometimes you might find a so callad "issued tile". It will crash instantly if you try to paint terrain over it. Use map-copy over it to remove this. It should work fine afterwards.
If you place GAIA units and then go to triggers tab and change or add a trigger that changes a specific object. Then you'll see that the "Go to Object" button isn't working. To solve this, go to Units tab, choose a player manually. If you press the hotkeys (1,2,3,4,5,6,7,8 or 0) the game might crash!
When you map-copy areas, make sure you do not map-copy objects so that they get placed outside the edge of the map. This will cause the game to crash instantly.
If you have flowers or other objects laying over the edge, the map can be very instable and sometimes crash. Move the objects so that they don't go over the edge and it should be fine.
Ice and shallows at the edge of the map can also crash the game. Remove it and it should be fine.
A huge elevation variety on the edge of the map can be instable and cause the game to crash sometimes. Try to have as little elevation changes as possible near the edge and it should be fine.
Ice tiles in the middle of the map (not on the edge) can crash the game. I've only experienced single ice-tiles that crashes. It works fine when I replace the ice with another terrain, but as soon as I try to put back the ice, the game crashes. The crash occurs when just after "Saving Scenario" screen disappears when you test the scenario in the editor.
Map-copied objects on water can also be instable. I've experienced several crashes when I have map-copied old stoneheads on water and then tested. It usually work fine if I map-copy normal water on it and re-do it.
Every time you test your map, the map will be autosaved as Default0, open this file and save under a different name to get the file back if you forgot to save before.
And remember to save often and make back-up files in case you lose your file or it gets corrupted.
If this didn't help you, try
[This message has been edited by Basse (edited 08-01-2011 @ 07:31 AM).]