• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Game crash after loading saved game

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
I have a large campaign. During one of the maps, there is a side mission where the hero leaves his army and does a small dungeon. During this time, I've hidden the rest of the map, paused all the units, and so forth.

Problem: If the players saves the game during this side mission nothing bad happens. But when he loads that saved game, the game appears (you can see your hero for a split second) and then crashes.

The actual triggers are very complicated, so I don't expect people to comb through them (I've included some below just to be complete). What I'm hoping for is a list of what it possibly could be. I read somewhere that lightning effects can crash the game... and there are lightning effects that are used in the side dungeon, though when I remove them entirely it still doesn't work.

I understand there are some minor leaks here, so don't worry about those unless they could cause game crashes.

  • Begin Side Quest
    • Events
      • Player - Player 7 (Green) types a chat message containing side as An exact match
    • Conditions
    • Actions
      • Set SideBusy = True
      • Game - Set time of day speed to 0.00% of the default speed
      • Cinematic - Turn on letterbox mode (hide interface) for (All players): fade out over 2.00 seconds
      • Cinematic - Turn cinematic mode On for (All players)
      • Cinematic - Fade out over 4.00 seconds using texture war3campImported\Gnomekin Crystalomancer Fadeout.BLP and color (100.00%, 100.00%, 100.00%) with 0.00% transparency
      • Destructible - Pick every destructible in path blocker entrance <gen> and do (Destructible - Kill (Picked destructible))
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Not equal to Visible Fire Tornado)) and do (Actions)
        • Loop - Actions
          • Unit - Pause (Picked unit)
      • Unit - Move Crystalomancer instantly to (Center of SideEntranceEnter <gen>), facing 90.00 degrees
      • Unit Group - Pick every unit in (Units in Side Quest <gen>) and do (Unit - Unpause (Picked unit))
      • Unit Group - Pick every unit in (Units owned by Player 7 (Green) matching (((Matching unit) Not equal to Crystalomancer) and ((Matching unit) Not equal to Muse))) and do (Unit - Change ownership of (Picked unit) to Player 11 (Dark Green) and Retain color)
      • Visibility - Create an initially Enabled visibility modifier for Player 7 (Green) emitting Fog of war across Side Quest <gen>
      • Visibility - Create an initially Enabled visibility modifier for Player 7 (Green) emitting Black mask across VisionNotSide <gen>
      • Set VisibilityNotSide = (Last created visibility modifier)
      • -------- Set Traps --------
      • Animation - Play the death animation for all doodads of type Trap Fire within Side Trap 3 Middle Flames <gen>
      • Destructible - Make Dungeon Gate (Horizontal) 2255 <gen> Invulnerable
      • Trigger - Turn on Trap 3 Middle 3 <gen>
      • Set guardianPoint = (Center of Side Guardian Pole <gen>)
      • Lightning - Create a Magic Leash lightning effect from source guardianPoint to target (Position of Guardian Devil 0086 <gen>)
      • Set sideGuardianLightning = (Last created lightning effect)
      • Trigger - Turn on Set Lightning <gen>
      • Trigger - Turn on Trap 5 Lightning Turn Off <gen>
      • Trigger - Turn on Side Lightning Repeat <gen>
      • Trigger - Run Trap 5 Lightning Start <gen> (ignoring conditions)
      • -------- Bring back vision --------
      • Wait 4.00 game-time seconds
      • Unit - Hide Circle of Power 0002 <gen>
      • Unit - Hide Circle of Power 0005 <gen>
      • Camera - Apply Side Entrance <gen> for Player 7 (Green) over 0.00 seconds
      • Camera - Apply Side Entrance 2 <gen> for Player 7 (Green) over 20.00 seconds
      • Cinematic - Fade in over 4.00 seconds using texture war3campImported\Gnomekin Crystalomancer Fadeout.BLP and color (100.00%, 100.00%, 100.00%) with 0.00% transparency
      • Wait 4.00 game-time seconds
      • Cinematic - Send transmission to (All players) from Crystalomancer named Tora Obedio: Play No sound and display I hope this is wort.... Modify duration: Set to 7.00 seconds and Wait
      • Wait 1.00 game-time seconds
      • Cinematic - Send transmission to (All players) from Muse named Lilyandra: Play No sound and display I will help as best.... Modify duration: Set to 6.00 seconds and Don't wait
      • Wait 5.00 game-time seconds
      • Cinematic - Turn cinematic mode Off for (All players)
      • Cinematic - Turn off letterbox mode (show interface) for (All players): fade in over 2.00 seconds
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Not equal to Visible Fire Tornado)) and do (Actions)
        • Loop - Actions
          • Unit - Pause (Picked unit)
      • Unit Group - Pick every unit in (Units in Side Quest <gen>) and do (Unit - Unpause (Picked unit))
      • Unit - Unpause Muse
      • Camera - Reset camera for Player 7 (Green) to standard game-view over 0.00 seconds
      • Selection - Select Crystalomancer for Player 7 (Green)
      • Wait 3.00 game-time seconds
      • Game - Display to (All players) the text: |cff32cd32WARNING|r...
Here is a periodic trigger that fires during the side mission:

  • Set Lightning
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Set tempPoint = (Position of Guardian Devil 0086 <gen>)
      • Lightning - Destroy sideGuardianLightning
      • Lightning - Create a Magic Leash lightning effect from source guardianPoint to target tempPoint
      • Set sideGuardianLightning = (Last created lightning effect)
      • Custom script: call RemoveLocation (udg_tempPoint)
When the side quest is done, this trigger fires:

  • Restart Regular Triggers after side
    • Events
    • Conditions
    • Actions
      • Game - Set time of day speed to 40.00% of the default speed
      • Unit - Unpause all units
      • Unit Group - Pick every unit in (Units in Side Quest <gen>) and do (Unit - Pause (Picked unit))
      • Special Effect - Destroy sideGuardianSpEffect
      • Special Effect - Destroy sideLightningBurnSpEffect
      • Special Effect - Destroy side1trapspeffect
      • Camera - Reset camera for Player 7 (Green) to standard game-view over 0.00 seconds
      • Camera - Pan camera as necessary for Player 7 (Green) to (Center of Crystalomancer Restore <gen>) over 1.00 seconds
      • Visibility - Create an initially Enabled visibility modifier for Player 7 (Green) emitting Black mask across Side Quest <gen>
      • -------- hide lightning --------
      • For each (Integer LightningCounter) from 1 to 5, do (Actions)
        • Loop - Actions
          • Lightning - Change color of sideLightning[LightningCounter] to (0.00 0.00 0.00) with 1.00 alpha
      • Unit - Order Shadow Wizard 0098 <gen> to Patrol To (Center of Wyrm Flight <gen>)
      • AI - Start campaign AI script for Player 9 (Gray): war3mapImported\ChananRaider.ai
      • AI - Start campaign AI script for Player 12 (Brown): war3mapImported\ch5DruhkChanan.ai

Does anyone have an idea about what could cause a crash after a load game? I'd be happy to hunt for it, but I have no idea what I'm looking for.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
never use this
  • Camera - Pan camera as necessary for Player 7 (Green) to (Center of Crystalomancer Restore <gen>) over 1.00 seconds
It can create desyncs.
Also your triggers leak.
Don't use waits.
Anything you use twice or more store in a variable and use the variable.
Look at the tutorial things that leak.
Also look at my tutorial things a guier should know.
 
Level 14
Joined
Aug 30, 2004
Messages
909
This is a 1-player campaign, so I'm not worried about desyncing.

I know it has some leaks in it, but for one use triggers I tend to ignore those. And I know waits are imprecise, but they wouldn't cause loading errors would they?

I haven't seen your tutorial yet, but I'll give it a look. Do you have any idea what would cause a crash after loading a game though?
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Every leak should be taken care of. You have about 50 leaks in these triggers alone. That is a lot of memory that doesn't need to be used.
Why have useless things in memory when they can be removed ? Game will last longer.

That pan camera as necessary creates tons of leaks. It also cause desyncs which is unwanted behaviour. A player can still desync from a one player game even though it's rare.

I can't see this trigger.
Trigger - Run Trap 5 Lightning Start <gen> (ignoring conditions)

This can crash if the lightning isn't created before calling this.
For each (Integer LightningCounter) from 1 to 5, do (Actions)
Loop - Actions
Lightning - Change color of sideLightning[LightningCounter] to (0.00 0.00 0.00) with 1.00 alpha

if this isn't set before this is called i believe it can cause crash. Not 100% sure about that tho.
Selection - Select Crystalomancer for Player 7 (Green)
 
Level 14
Joined
Aug 30, 2004
Messages
909
I'll try removing the pan camera as necessary; I don't need that in particular.

Here is the trigger you were referring to:

  • Trap 5 Lightning Start
    • Events
    • Conditions
    • Actions
      • Set LightningRodPoints[1] = (Center of Lightning A1 <gen>)
      • Set LightningRodPoints[2] = (Center of Lightning A10 B1 <gen>)
      • Set LightningRodPoints[3] = (Center of Lightning D8 E1 <gen>)
      • Set LightningRodPoints[4] = (Center of Lightning C1 <gen>)
      • Set LightningRodPoints[5] = (Center of Lightning C9 <gen>)
      • -------- ------- --------
      • Lightning - Create a Healing Wave - Primary lightning effect from source LightningRodPoints[1] to target LightningRodPoints[2]
      • Set sideLightning[1] = (Last created lightning effect)
      • Lightning - Create a Healing Wave - Primary lightning effect from source LightningRodPoints[2] to target LightningRodPoints[3]
      • Set sideLightning[2] = (Last created lightning effect)
      • Lightning - Create a Healing Wave - Primary lightning effect from source LightningRodPoints[3] to target LightningRodPoints[4]
      • Set sideLightning[3] = (Last created lightning effect)
      • Lightning - Create a Healing Wave - Primary lightning effect from source LightningRodPoints[4] to target LightningRodPoints[5]
      • Set sideLightning[4] = (Last created lightning effect)
      • Lightning - Create a Healing Wave - Primary lightning effect from source LightningRodPoints[4] to target LightningRodPoints[2]
      • Set sideLightning[5] = (Last created lightning effect)
What's so weird to me is that it's not crashing while you play (I'm used to looking for those infinite loops that cause that), it's only after I load.
 
Level 14
Joined
Aug 30, 2004
Messages
909
UPDATE:

I think I found a work around. The problem appeared to be with the lightning. For some reason, when I saved the game various created lightnings didn't save right. So when I loaded, those variables no longer referred to anything. It crashed when I tried to change the lightning's colors.

I found a work around that destroys lightning when I save (then revives them if they need reviving...either upon loading or upon continuing after the save).
 
Status
Not open for further replies.
Top