• 🏆 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!

[Trigger] How Can I find what is crashing warcraft 3?

Status
Not open for further replies.
Level 6
Joined
Feb 10, 2011
Messages
188
I made my own risk system and about 10 minutes into a game (when im doing nothing) wc3 crashes

I have attached the systems test map, a screenshot of the crash error and posted the triggers below


  • Map Int
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set turn = 0
      • Set timeIntegerStart = 60
      • Set defaultUnitType = |cffff8000Private|r
      • Set dummyType = Guard Dummy
      • Set circleOfPowerType = COP
      • Set Guard_AoE = 150.00
      • Set Guard_MaximumRange = 700.00
      • Game - Set the time of day to 12.00
      • Game - Set time of day speed to 0.00% of the default speed
      • Game - Turn the day/night cycle Off
      • Game - Set game speed to Fastest
      • Game - Lock the game speed
      • For each (Integer P) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player(P)) slot status) Equal to Is playing
            • Then - Actions
              • Trigger - Add to Zoom <gen> the event (Player - (Player(P)) types a chat message containing -c as A substring)
              • Trigger - Add to Angle <gen> the event (Player - (Player(P)) types a chat message containing -a as A substring)
              • Trigger - Add to Rotation <gen> the event (Player - (Player(P)) types a chat message containing -r as A substring)
              • Camera - Set (Player(P))'s camera Distance to target to 2900.00 over 0.00 seconds
              • Camera - Set (Player(P))'s camera Angle of attack to -70.00 over 0.00 seconds
              • Set income = 8
              • Set incomeBase = 8
              • Set playerAliveString = |cff00ff00Alive|r
            • Else - Actions
      • Custom script: call DestroyTrigger( GetTriggeringTrigger() )
  • Start Message
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Please wait while t...
  • Set Countries
    • Events
      • Time - Elapsed game time is 3.00 seconds
    • Conditions
    • Actions
      • -------- Count Players --------
      • Set tempForce1 = (All players matching (((Matching player) slot status) Equal to Is playing))
      • Set numOfPlayers = (Number of players in tempForce1)
      • -------- ------------------------- --------
      • Set activeCityCount = (Number of units in (Units owned by Neutral Hostile matching (((Matching unit) is A structure) Equal to True)))
      • Set numOfBasesPerPlayer = (activeCityCount / numOfPlayers)
      • -------- ------------------------- --------
      • -------- Set Bases --------
      • -------- ------------------------- --------
      • Set B = 1
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 001 <gen>
      • Set countryName[B] = Morocco
      • Set countrySpawn[B] = 1 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 003 <gen>
      • Set countryName[B] = Algeria
      • Set countrySpawn[B] = 2 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = 3 <gen>
      • Set countryName[B] = Malta
      • Set countrySpawn[B] = 23 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 010 <gen>
      • Set countryName[B] = Sardinia
      • Set countrySpawn[B] = 11 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 007 <gen>
      • Set countryArea2[B] = Region 008 <gen>
      • Set countryName[B] = Italy
      • Set countrySpawn[B] = 10 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 012 <gen>
      • Set countryName[B] = Spain
      • Set countrySpawn[B] = 12 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 014 <gen>
      • Set countryName[B] = Portugal
      • Set countrySpawn[B] = 13 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 016 <gen>
      • Set countryArea2[B] = Region 017 <gen>
      • Set countryName[B] = France
      • Set countrySpawn[B] = 14 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 034 <gen>
      • Set countryName[B] = Switzerland
      • Set countrySpawn[B] = 20 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 032 <gen>
      • Set countryName[B] = Austria
      • Set countrySpawn[B] = 21 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 036 <gen>
      • Set countryName[B] = Slovenia
      • Set countrySpawn[B] = 22 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 038 <gen>
      • Set countryName[B] = Bosnia
      • Set countrySpawn[B] = 25 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 040 <gen>
      • Set countryName[B] = Greece
      • Set countrySpawn[B] = 24 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 058 <gen>
      • Set countryName[B] = Turkey
      • Set countrySpawn[B] = 7 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 056 <gen>
      • Set countryName[B] = Isreal
      • Set countrySpawn[B] = 6 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 054 <gen>
      • Set countryName[B] = Egypt
      • Set countrySpawn[B] = 5 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 052 <gen>
      • Set countryName[B] = Libya
      • Set countrySpawn[B] = 4 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 060 <gen>
      • Set countryName[B] = Georgia
      • Set countrySpawn[B] = 8 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 062 <gen>
      • Set countryName[B] = Armenia
      • Set countrySpawn[B] = 9 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 019 <gen>
      • Set countryName[B] = Belguim
      • Set countrySpawn[B] = 15 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 021 <gen>
      • Set countryName[B] = Netherlands
      • Set countrySpawn[B] = 16 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 023 <gen>
      • Set countryName[B] = Denmark
      • Set countrySpawn[B] = 17 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 025 <gen>
      • Set countryArea2[B] = 18 <gen>
      • Set countryName[B] = Germany
      • Set countrySpawn[B] = Region 024 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 044 <gen>
      • Set countryName[B] = Hungary
      • Set countrySpawn[B] = 26 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 030 <gen>
      • Set countryName[B] = Czechoslovakia
      • Set countrySpawn[B] = 30 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 028 <gen>
      • Set countryName[B] = Poland
      • Set countrySpawn[B] = 19 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 048 <gen>
      • Set countryName[B] = Belarus
      • Set countrySpawn[B] = 31 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 046 <gen>
      • Set countryName[B] = Ukraine
      • Set countrySpawn[B] = 29 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 064 <gen>
      • Set countryName[B] = Moldova
      • Set countrySpawn[B] = 28 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 042 <gen>
      • Set countryName[B] = Romania
      • Set countrySpawn[B] = 27 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 050 <gen>
      • Set countryName[B] = Lithuania
      • Set countrySpawn[B] = 32 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 065 <gen>
      • Set countryArea2[B] = Region 066 <gen>
      • Set countryName[B] = Russia
      • Set countrySpawn[B] = 33 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 069 <gen>
      • Set countryName[B] = Finland
      • Set countrySpawn[B] = 34 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 071 <gen>
      • Set countryArea2[B] = Region 072 <gen>
      • Set countryName[B] = Sweden
      • Set countrySpawn[B] = 35 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 073 <gen>
      • Set countryArea2[B] = Region 074 <gen>
      • Set countryName[B] = Norway
      • Set countrySpawn[B] = 36 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 077 <gen>
      • Set countryName[B] = Svalbard
      • Set countrySpawn[B] = 37 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 081 <gen>
      • Set countryName[B] = Ireland
      • Set countrySpawn[B] = 40 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 082 <gen>
      • Set countryName[B] = Wales
      • Set countrySpawn[B] = 39 <gen>
      • -------- ------------------------- --------
      • Set B = (B + 1)
      • -------- ------------------------- --------
      • Set countryArea1[B] = Region 083 <gen>
      • Set countryArea2[B] = Region 084 <gen>
      • Set countryName[B] = England
      • Set countrySpawn[B] = 38 <gen>
      • -------- ------------------------- --------
      • -------- ------------------------- --------
      • -------- ------------------------- --------
      • Set countryCount = B
      • -------- ------------------------- --------
      • -------- ------------------------- --------
      • -------- ------------------------- --------
      • For each (Integer B) from 1 to countryCount, do (Actions)
        • Loop - Actions
          • Set countryRegions[B] = (Units in countryArea1[B] owned by Neutral Hostile)
          • Unit Group - Add all units of (Units in countryArea2[B] owned by Neutral Hostile) to countryRegions[B]
          • Set countryCityCount[B] = ((Number of units in (Units in countryArea1[B] owned by Neutral Hostile)) + (Number of units in (Units in countryArea2[B] owned by Neutral Hostile)))
          • Set tempPointArray1[B] = (Center of countrySpawn[B])
          • Set tempPointArray2[B] = (tempPointArray1[B] offset by (-85.00, -125.00))
          • Floating Text - Create floating text that reads (|cFFFF0303 + (countryName[B] + ((( + () + ((String(countryCityCount[B])) + ))) + |r))) at tempPointArray2[B] with Z offset 0.00, using font size 13.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • -------- ------------------------- --------
          • -------- ------------------------- --------
          • -------- ------------------------- --------
          • Unit Group - Pick every unit in (Random numOfPlayers units from (Units owned by Neutral Hostile matching (((Matching unit) is in countryRegions[B]) Equal to True))) and do (Actions)
            • Loop - Actions
              • Set tempUnit1 = (Picked unit)
              • Set tempPoint1 = (Position of tempUnit1)
              • Set tempPoint2 = (tempPoint1 offset by (0.00, -220.00))
              • Set tempPlayer1 = (Random player from tempForce1)
              • Set G_TempGroup = (Units within 150.00 of tempPoint2 matching ((((((Matching unit) is alive) Equal to True) and (((Matching unit) is in G_Group) Not equal to True)) and (((Matching unit) is A structure) Not equal to True)) and ((Owner of (Matching unit)) Equal to tempPlayer1))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (G_TempGroup is empty) Equal to False
                • Then - Actions
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • tempInt[(Player number of tempPlayer1)] Less than numOfBasesPerPlayer
                      • tempInt[(Player number of tempPlayer1)] Less than 40
                    • Then - Actions
                      • Unit - Create 1 defaultUnitType for tempPlayer1 at tempPoint2 facing Default building facing degrees
                      • Set tempUnit2 = (Last created unit)
                      • Unit - Change ownership of tempUnit1 to tempPlayer1 and Change color
                      • Unit - Order tempUnit1 to Undead Necromancer - Unholy Frenzy tempUnit2
                      • Set tempInt[(Player number of tempPlayer1)] = (tempInt[(Player number of tempPlayer1)] + 1)
                      • Player Group - Remove tempPlayer1 from tempForce1
                      • Player Group - Add tempPlayer1 to tempForce2
                    • Else - Actions
              • Custom script: call RemoveLocation( udg_tempPoint1 )
              • Custom script: call RemoveLocation( udg_tempPoint2 )
              • Custom script: call DestroyGroup( udg_G_TempGroup )
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of players in tempForce1) Equal to 0
                • Then - Actions
                  • Player Group - Pick every player in tempForce2 and do (Actions)
                    • Loop - Actions
                      • Player Group - Add (Picked player) to tempForce1
                      • Player Group - Remove (Picked player) from tempForce2
                • Else - Actions
          • Unit Group - Pick every unit in (Units owned by Neutral Hostile matching (((Matching unit) is in countryRegions[B]) Equal to True)) and do (Actions)
            • Loop - Actions
              • Set tempUnit1 = (Picked unit)
              • Set tempPoint1 = (Position of tempUnit1)
              • Set tempPoint2 = (tempPoint1 offset by (0.00, -220.00))
              • Unit - Create 1 defaultUnitType for Neutral Hostile at tempPoint2 facing Default building facing degrees
              • Set tempUnit2 = (Last created unit)
              • Unit - Order tempUnit1 to Undead Necromancer - Unholy Frenzy tempUnit2
      • Game - Display to (All players) the text: The game will begin...
  • Player Colors
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set player_Colour[1] = (Name of Player 1 (Red))
      • Set player_Colour[2] = (Name of Player 2 (Blue))
      • Set player_Colour[3] = (Name of Player 3 (Teal))
      • Set player_Colour[4] = (Name of Player 4 (Purple))
      • Set player_Colour[5] = (Name of Player 5 (Yellow))
      • Set player_Colour[6] = (Name of Player 6 (Orange))
      • Set player_Colour[7] = (Name of Player 7 (Green))
      • Set player_Colour[8] = (Name of Player 8 (Pink))
      • Set player_Colour[9] = (Name of Player 9 (Gray))
      • Set player_Colour[10] = (Name of Player 10 (Light Blue))
      • Set player_Colour[11] = (Name of Player 11 (Dark Green))
      • Set player_Colour[12] = (Name of Player 12 (Brown))
      • Set colorCode[1] = |cffff0000
      • Set colorCode[2] = |cff0000ff
      • Set colorCode[3] = |cff00ffff
      • Set colorCode[4] = |cffa020f0
      • Set colorCode[5] = |cffffff00
      • Set colorCode[6] = |cffee9a00
      • Set colorCode[7] = |cff00cd00
      • Set colorCode[8] = |cffdb7093
      • Set colorCode[9] = |cff7f7f7f
      • Set colorCode[10] = |cff87ceeb
      • Set colorCode[11] = |cff006400
      • Set colorCode[12] = |cff804000
      • Set colourColor[1] = Red
      • Set colourColor[2] = Blue
      • Set colourColor[3] = Teal
      • Set colourColor[4] = Purple
      • Set colourColor[5] = Yellow
      • Set colourColor[6] = Orange
      • Set colourColor[7] = Green
      • Set colourColor[8] = Pink
      • Set colourColor[9] = Gray
      • Set colourColor[10] = Light Blue
      • Set colourColor[11] = Dark Green
      • Set colourColor[12] = Brown
      • For each (Integer P) from 1 to 12, do (Actions)
        • Loop - Actions
          • For each (Integer C) from 1 to 12, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Color of (Player(P))) Equal to colourColor[C]
                • Then - Actions
                  • Set player_Colour = (colorCode[C] + player_Colour)
                • Else - Actions
      • Custom script: call DestroyTrigger( GetTriggeringTrigger() )
  • Create Multiboard
    • Events
      • Time - Elapsed game time is 10.00 seconds
    • Conditions
    • Actions
      • Visibility - Disable fog of war
      • Visibility - Disable black mask
      • Multiboard - Create a multiboard with 4 columns and 2 rows, titled Scoreboard
      • Set mBoard = (Last created multiboard)
      • Multiboard - Change the title of mBoard to (|cffD70000 + (Middle Earth Risk + |r))
      • Multiboard - Set the width for mBoard item in column 1, row 1 to 9.00% of the total screen width
      • Multiboard - Set the width for mBoard item in column 2, row 1 to 6.00% of the total screen width
      • Multiboard - Set the width for mBoard item in column 3, row 1 to 0.10% of the total screen width
      • Multiboard - Set the width for mBoard item in column 4, row 1 to 0.10% of the total screen width
      • Multiboard - Set the width for mBoard item in column 1, row 2 to 6.00% of the total screen width
      • Multiboard - Set the width for mBoard item in column 2, row 2 to 3.50% of the total screen width
      • Multiboard - Set the width for mBoard item in column 3, row 2 to 3.50% of the total screen width
      • Multiboard - Set the width for mBoard item in column 4, row 2 to 9.00% of the total screen width
      • Multiboard - Set the text for mBoard item in column 2, row 1 to (|cffFF0080 + (Turn + (|r + (|cffffcc00 + ((String(turn)) + |r)))))
      • Multiboard - Set the text for mBoard item in column 1, row 2 to (|cffffcc00 + (Player + |r))
      • Multiboard - Set the text for mBoard item in column 2, row 2 to (|cffFFD700 + (Income + |r))
      • Multiboard - Set the text for mBoard item in column 3, row 2 to (|cffffcc00 + (Cities + |r))
      • Multiboard - Set the text for mBoard item in column 4, row 2 to (|cffffcc00 + (Status + |r))
      • Multiboard - Set the display style for mBoard item in column 1, row 1 to Show text and Hide icons
      • Multiboard - Set the display style for mBoard item in column 2, row 1 to Show text and Hide icons
      • Multiboard - Set the display style for mBoard item in column 3, row 1 to Show text and Hide icons
      • Multiboard - Set the display style for mBoard item in column 4, row 1 to Show text and Hide icons
      • Multiboard - Set the display style for mBoard item in column 1, row 2 to Show text and Hide icons
      • Multiboard - Set the display style for mBoard item in column 2, row 2 to Show text and Hide icons
      • Multiboard - Set the display style for mBoard item in column 3, row 2 to Show text and Hide icons
      • Multiboard - Set the display style for mBoard item in column 4, row 2 to Show text and Hide icons
      • Set tempInt[1] = 2
      • For each (Integer tempInt[0]) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: set udg_tempPlayer1 = Player( udg_tempInt[0] - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (tempPlayer1 slot status) Equal to Is playing
            • Then - Actions
              • Set tempInt[1] = (tempInt[1] + 1)
              • Multiboard - Change the number of rows for mBoard to tempInt[1]
              • Multiboard - Set the width for mBoard item in column 1, row tempInt[1] to 6.00% of the total screen width
              • Multiboard - Set the width for mBoard item in column 2, row tempInt[1] to 3.50% of the total screen width
              • Multiboard - Set the width for mBoard item in column 3, row tempInt[1] to 3.50% of the total screen width
              • Multiboard - Set the width for mBoard item in column 4, row tempInt[1] to 3.50% of the total screen width
              • Multiboard - Set the text for mBoard item in column 1, row tempInt[1] to player_Colour[(Player number of tempPlayer1)]
              • Multiboard - Set the text for mBoard item in column 2, row tempInt[1] to (|cFFF8FC00 + ((String(income[(Player number of tempPlayer1)])) + |r))
              • Multiboard - Set the text for mBoard item in column 3, row tempInt[1] to (|cFFB4B7E3 + ((String(cities[(Player number of tempPlayer1)])) + |r))
              • Multiboard - Set the text for mBoard item in column 4, row tempInt[1] to playerAliveString[(Player number of tempPlayer1)]
              • Multiboard - Set the display style for mBoard item in column 1, row tempInt[1] to Show text and Hide icons
              • Multiboard - Set the display style for mBoard item in column 2, row tempInt[1] to Show text and Hide icons
              • Multiboard - Set the display style for mBoard item in column 3, row tempInt[1] to Show text and Hide icons
              • Multiboard - Set the display style for mBoard item in column 4, row tempInt[1] to Show text and Hide icons
            • Else - Actions
      • Custom script: set udg_tempPlayer1 = null
      • Trigger - Turn on Multiboard Timer <gen>
      • Trigger - Turn on Update Board <gen>
      • Trigger - Turn on Update Player Status <gen>
      • Custom script: call DestroyTrigger( GetTriggeringTrigger() )
  • Multiboard Timer
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • timeInteger Equal to 0
        • Then - Actions
          • Set timeInteger = timeIntegerStart
          • Set turn = (turn + 1)
          • Multiboard - Set the text for mBoard item in column 2, row 1 to (|cffFF0080 + (Turn + (|r + (|cff00FF00 + ((String(turn)) + |r)))))
          • For each (Integer P) from 1 to 12, do (Actions)
            • Loop - Actions
              • Set income = 8
              • For each (Integer B) from 1 to countryCount, do (Actions)
                • Loop - Actions
                  • Set tempInt[B] = (Number of units in (Units owned by (Player(P)) matching (((Matching unit) is in countryRegions[B]) Equal to True)))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • tempInt[B] Equal to countryCityCount[B]
                    • Then - Actions
                      • Set income = (income + (countryCityCount[B] - 1))
                      • Set tempPoint1 = (Center of countrySpawn[B])
                      • Unit - Create (countryCityCount[B] - 1) defaultUnitType for (Player(P)) at tempPoint1 facing Default building facing degrees
                      • Custom script: call RemoveLocation( udg_tempPoint1 )
                    • Else - Actions
              • Player - Add income to (Player(P)) Current gold
              • Player - Set (Player(P)) Food cap to turn
              • Player - Set (Player(P)) Food used to 60
              • Player - Add 1 to (Player(P)) Current lumber
        • Else - Actions
          • For each (Integer P) from 1 to 12, do (Actions)
            • Loop - Actions
              • Player - Add -1 to (Player(P)) Food used
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • timeInteger Less than or equal to 5
        • Then - Actions
          • Set turnTimerColor = |cffff0000
          • Multiboard - Set the text for mBoard item in column 1, row 1 to (|cffFF00FF + (Next Turn + (turnTimerColor + ((String(timeInteger)) + |r))))
        • Else - Actions
          • Set turnTimerColor = |cff00FF00
          • Multiboard - Set the text for mBoard item in column 1, row 1 to (|cffFF00FF + (Next Turn + (turnTimerColor + ((String(timeInteger)) + |r))))
      • Set timeInteger = (timeInteger - 1)
      • Trigger - Run Update Board <gen> (checking conditions)
      • Trigger - Run Update Player Status <gen> (checking conditions)
  • Update Board
    • Events
    • Conditions
    • Actions
      • Set tempInt[2] = 2
      • For each (Integer tempInt[0]) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: set udg_tempPlayer1 = Player( udg_tempInt[0] - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (tempPlayer1 slot status) Equal to Is playing
            • Then - Actions
              • Set tempInt[2] = (tempInt[2] + 1)
              • Set cities[(Player number of tempPlayer1)] = (Number of units in (Units owned by tempPlayer1 matching (((Matching unit) is A town-hall-type unit) Equal to True)))
              • Multiboard - Set the text for mBoard item in column 2, row tempInt[2] to (|cFFF8FC00 + (String(income[(Player number of tempPlayer1)])))
              • Multiboard - Set the text for mBoard item in column 3, row tempInt[2] to (|cFFB4B7E3 + (String(cities[(Player number of tempPlayer1)])))
              • Multiboard - Set the text for mBoard item in column 4, row tempInt[2] to playerAliveString[(Player number of tempPlayer1)]
            • Else - Actions
      • Custom script: set udg_tempPlayer1 = null
  • Update Player Status
    • Events
    • Conditions
    • Actions
      • For each (Integer P) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player(P)) slot status) Equal to Has left the game
            • Then - Actions
              • Set playerAliveString = |cff00ff00Left|r
            • Else - Actions
      • For each (Integer P) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in (Units owned by (Player(P)) matching (((Matching unit) is A town-hall-type unit) Equal to True))) Equal to 0
            • Then - Actions
              • Set playerAliveString = |cff00ff00Dead|r
            • Else - Actions
  • Guard
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Guard
      • (Owner of (Casting unit)) Equal to (Owner of (Target unit of ability being cast))
    • Actions
      • -------- --------------------------------------------------------------------------------------------------------------------------- --------
      • -------- Checking if target is already guarding. --------
      • -------- --------------------------------------------------------------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) is in G_Group) Equal to True
        • Then - Actions
          • Do nothing
        • Else - Actions
          • -------- --------------------------------------------------------------------------------------------------------------------------- --------
          • -------- Replacing current Guard, if cast on a new unit. --------
          • -------- --------------------------------------------------------------------------------------------------------------------------- --------
          • For each (Integer G_Loop) from 1 to G_Index, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • G_Caster[G_Loop] Equal to (Casting unit)
                • Then - Actions
                  • -------- --------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- Removing Dummy flag --------
                  • -------- --------------------------------------------------------------------------------------------------------------------------- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of G_Unit[G_Loop]) Equal to Guard Dummy
                    • Then - Actions
                      • Unit - Remove G_Unit[G_Loop] from the game
                    • Else - Actions
                  • Unit Group - Remove G_Unit[G_Loop] from G_Group
                  • Set G_Unit[G_Loop] = (Target unit of ability being cast)
                  • Unit Group - Add G_Unit[G_Loop] to G_Group
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • G_Index Equal to 1
                    • Then - Actions
                      • Trigger - Turn on Guard Loop <gen>
                    • Else - Actions
                  • Skip remaining actions
                • Else - Actions
          • Set G_Index = (G_Index + 1)
          • Set G_Caster[G_Index] = (Casting unit)
          • Set G_Unit[G_Index] = (Target unit of ability being cast)
          • Unit Group - Add G_Unit[G_Index] to G_Group
          • Set G_OffsetDistance[G_Index] = 320.00
          • Set G_Location[G_Index] = ((Position of G_Caster[G_Index]) offset by G_OffsetDistance[G_Index] towards 270.00 degrees)
          • Unit - Create 1 circleOfPowerType for (Owner of G_Caster[G_Index]) at G_Location[G_Index] facing Default building facing degrees
          • Set G_Cop[G_Index] = (Last created unit)
          • Set G_Location[G_Index] = (Position of G_Cop[G_Index])
          • Unit - Move G_Unit[G_Index] instantly to G_Location[G_Index]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • G_Index Equal to 1
            • Then - Actions
              • Trigger - Turn on Guard Loop <gen>
            • Else - Actions
  • Guard Killer Replacement
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Killing unit) is in G_Group) Not equal to True
    • Actions
      • For each (Integer G_Loop) from 1 to G_Index, do (Actions)
        • Loop - Actions
          • -------- --------------------------------------------------------------------------------------------------------------------------- --------
          • -------- Makes the killer the new guard, Killer takes control of building. --------
          • -------- --------------------------------------------------------------------------------------------------------------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • G_Unit[G_Loop] Equal to (Dying unit)
            • Then - Actions
              • -------- --------------------------------------------------------------------------------------------------------------------------- --------
              • -------- Checking if dying guard has any buddies in the circle with him, who are able to become the new gaurd. --------
              • -------- --------------------------------------------------------------------------------------------------------------------------- --------
              • Set G_TempGroup = (Units within Guard_AoE of G_Location[G_Loop] matching (((((((Matching unit) is A structure) Equal to False) and ((Matching unit) Not equal to G_Caster[G_Loop])) and ((((Matching unit) is alive) Equal to True) and ((Matching unit) Not equal to G_Cop[G_Loop]))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (G_TempGroup is empty) Equal to True
                • Then - Actions
                  • Set tempPlayer1 = (Owner of (Killing unit))
                  • Unit Group - Remove G_Unit[G_Loop] from G_Group
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Killing unit) is A structure) Equal to True
                    • Then - Actions
                      • Unit - Create 1 Guard Dummy for tempPlayer1 at G_Location[G_Loop] facing Default building facing degrees
                      • Set G_Unit[G_Loop] = (Last created unit)
                      • Unit Group - Add (Last created unit) to G_Group
                      • Unit - Change ownership of G_Caster[G_Loop] to tempPlayer1 and Change color
                      • Unit - Change ownership of G_Cop[G_Loop] to tempPlayer1 and Change color
                      • Custom script: set udg_tempPlayer1 = null
                    • Else - Actions
                      • Unit - Move (Killing unit) instantly to G_Location[G_Loop]
                      • Set G_Unit[G_Loop] = (Killing unit)
                      • Unit Group - Add (Killing unit) to G_Group
                      • Unit - Change ownership of G_Caster[G_Loop] to tempPlayer1 and Change color
                      • Unit - Change ownership of G_Cop[G_Loop] to tempPlayer1 and Change color
                      • Custom script: set udg_tempPlayer1 = null
                • Else - Actions
                  • Unit Group - Remove G_Unit[G_Loop] from G_Group
                  • Set G_Unit[G_Loop] = (Random unit from G_TempGroup)
                  • Unit Group - Add G_Unit[G_Loop] to G_Group
              • Custom script: call DestroyGroup (udg_G_TempGroup)
            • Else - Actions
  • Guard Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer G_Loop) from 1 to G_Index, do (Actions)
        • Loop - Actions
          • -------- --------------------------------------------------------------------------------------------------------------------------- --------
          • -------- Checking if guard left his/her post. --------
          • -------- --------------------------------------------------------------------------------------------------------------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (G_Unit[G_Loop] is in (Units within Guard_AoE of G_Location[G_Loop])) Equal to False
            • Then - Actions
              • -------- --------------------------------------------------------------------------------------------------------------------------- --------
              • -------- Replacing leaving Guard with someone else in the circle. --------
              • -------- --------------------------------------------------------------------------------------------------------------------------- --------
              • Set G_TempGroup = (Units within Guard_AoE of G_Location[G_Loop] matching (((((((Matching unit) is A structure) Equal to False) and ((Matching unit) Not equal to G_Caster[G_Loop])) and ((((Matching unit) is alive) Equal to True) and ((Matching unit) Not equal to G_Cop[G_Loop]))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (G_TempGroup is empty) Equal to True
                • Then - Actions
                  • Unit - Move G_Unit[G_Loop] instantly to G_Location[G_Loop]
                • Else - Actions
                  • Unit Group - Remove G_Unit[G_Loop] from G_Group
                  • Set G_Unit[G_Loop] = (Random unit from G_TempGroup)
                  • Unit Group - Add G_Unit[G_Loop] to G_Group
              • Custom script: call DestroyGroup (udg_G_TempGroup)
            • Else - Actions
          • -------- --------------------------------------------------------------------------------------------------------------------------- --------
          • -------- Scanning for new guard, if guard dies. --------
          • -------- --------------------------------------------------------------------------------------------------------------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (G_Unit[G_Loop] is dead) Equal to True
            • Then - Actions
              • Unit Group - Remove G_Unit[G_Loop] from G_Group
              • Set G_TempGroup = (Units within Guard_MaximumRange of G_Location[G_Loop] matching (((((((Matching unit) is A structure) Equal to False) and ((Matching unit) Not equal to G_Caster[G_Loop])) and ((((Matching unit) is alive) Equal to True) and ((Matching unit) Not equal to G_Cop[
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (G_TempGroup is empty) Equal to False
                • Then - Actions
                  • Set G_Unit[G_Loop] = (Random unit from G_TempGroup)
                  • Unit Group - Add G_Unit[G_Loop] to G_Group
                • Else - Actions
                  • Unit - Create 1 dummyType for (Owner of G_Caster[G_Loop]) at G_Location[G_Loop] facing Default building facing degrees
                  • Set G_Unit[G_Loop] = (Last created unit)
                  • Unit Group - Add G_Unit[G_Loop] to G_Group
              • Custom script: call DestroyGroup (udg_G_TempGroup)
            • Else - Actions
  • Zoom
    • Events
    • Conditions
    • Actions
      • Set Real[1] = (Real((Substring((Entered chat string), 4, (Length of (Entered chat string))))))
      • Camera - Set (Triggering player)'s camera Distance to target to Real[1] over 0.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Real[1] Less than 1200.00
        • Then - Actions
          • Camera - Set (Triggering player)'s camera Distance to target to 1200.00 over 0.00 seconds
          • Game - Display to (All players) the text: The minimum distanc...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Real[1] Greater than 4000.00
        • Then - Actions
          • Camera - Set (Triggering player)'s camera Distance to target to 4000.00 over 0.00 seconds
          • Game - Display to (All players) the text: The max distance is...
        • Else - Actions
  • Angle
    • Events
    • Conditions
    • Actions
      • Set Real[2] = (Real((Substring((Entered chat string), 4, (Length of (Entered chat string))))))
      • Camera - Set (Triggering player)'s camera Angle of attack to Real[2] over 0.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Real[2] Less than 300.00
        • Then - Actions
          • Camera - Set (Triggering player)'s camera Angle of attack to 300.00 over 0.00 seconds
          • Game - Display to (Player group((Triggering player))) the text: You can only change...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Real[2] Greater than 360.00
        • Then - Actions
          • Camera - Set (Triggering player)'s camera Angle of attack to 360.00 over 0.00 seconds
          • Game - Display to (Player group((Triggering player))) the text: You can only change...
        • Else - Actions
  • Rotation
    • Events
    • Conditions
    • Actions
      • Set Real[3] = (Real((Substring((Entered chat string), 4, (Length of (Entered chat string))))))
      • Camera - Set (Triggering player)'s camera Rotation to Real[3] over 0.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Real[3] Less than 0.00
        • Then - Actions
          • Game - Display to (All players) the text: You can only rotate...
          • Camera - Set (Triggering player)'s camera Rotation to 0.00 over 0.00 seconds
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Real[3] Greater than 360.00
        • Then - Actions
          • Game - Display to (All players) the text: You can only rotate...
          • Camera - Set (Triggering player)'s camera Rotation to 360.00 over 0.00 seconds
        • Else - Actions
 

Attachments

  • Risk Revo .02.w3x
    362.7 KB · Views: 58
  • error.png
    error.png
    1,013.6 KB · Views: 159
Last edited:
Too massive memory leaks.

Example:
  • Set tempInt[B] = (Number of units in (Units owned by (Player(P)) matching (((Matching unit) is in countryRegions[B]) Gleich True)))
^all actions like this "Number Of Units In (UnitGroup)" functions create a new unit group.

Also are you sure dummy units are all correctly removed? Idk, might be, I just mentioned you create a lot of them.

Read this tutorial, it explains how to code better filters, and readable code -> easier bug finding, and such, too.
 
Level 6
Joined
Feb 10, 2011
Messages
188
Too massive memory leaks.

Example:
  • Set tempInt[B] = (Number of units in (Units owned by (Player(P)) matching (((Matching unit) is in countryRegions[B]) Gleich True)))
^all actions like this "Number Of Units In (UnitGroup)" functions create a new unit group.

Also are you sure dummy units are all correctly removed? Idk, might be, I just mentioned you create a lot of them.

Read this tutorial, it explains how to code better filters, and readable code -> easier bug finding, and such, too.

Okay I am back for good life has chilled and i been working on this

so I read the tutorial but i have a question
I redid my trigger and followed the tutorial, it works but I am having an issue with the group leak
the trigger works correctly when i do not clear it using a custom script, but when i do clear it. the trigger ceases to function properly

did I do something wrong?

the trigger is in here, the first one is the original unfixed trigger
  • Multiboard Timer Copy
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • timeInteger Equal to 0
        • Then - Actions
          • Set timeInteger = timeIntegerStart
          • Set turn = (turn + 1)
          • Multiboard - Set the text for mBoard item in column 2, row 1 to (|cffFF0080 + (Turn + (|r + (|cff00FF00 + ((String(turn)) + |r)))))
          • For each (Integer P) from 1 to 12, do (Actions)
            • Loop - Actions
              • Set income = 8
              • For each (Integer B) from 1 to countryCount, do (Actions)
                • Loop - Actions
                  • Set tempInt[B] = (Number of units in (Units owned by (Player(P)) matching (((Matching unit) is in countryRegions[B]) Equal to True)))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • tempInt[B] Equal to countryCityCount[B]
                    • Then - Actions
                      • Set income = (income + (countryCityCount[B] - 1))
                      • Set tempPoint1 = (Center of countrySpawn[B])
                      • Unit - Create (countryCityCount[B] - 1) defaultUnitType for (Player(P)) at tempPoint1 facing Default building facing degrees
                      • Custom script: call RemoveLocation( udg_tempPoint1 )
                    • Else - Actions
              • Player - Add income to (Player(P)) Current gold
              • Player - Set (Player(P)) Food cap to turn
              • Player - Set (Player(P)) Food used to 60
              • Player - Add 1 to (Player(P)) Current lumber
        • Else - Actions
          • For each (Integer P) from 1 to 12, do (Actions)
            • Loop - Actions
              • Player - Add -1 to (Player(P)) Food used
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • timeInteger Less than or equal to 5
        • Then - Actions
          • Set turnTimerColor = |cffff0000
          • Multiboard - Set the text for mBoard item in column 1, row 1 to (|cffFF00FF + (Next Turn + (turnTimerColor + ((String(timeInteger)) + |r))))
        • Else - Actions
          • Set turnTimerColor = |cff00FF00
          • Multiboard - Set the text for mBoard item in column 1, row 1 to (|cffFF00FF + (Next Turn + (turnTimerColor + ((String(timeInteger)) + |r))))
      • Set timeInteger = (timeInteger - 1)
      • Trigger - Run Update Board <gen> (checking conditions)
      • Trigger - Run Update Player Status <gen> (checking conditions)
  • [/hidden]

This is the fixed filtering no leak clear on the unit group, trigger works as intended
  • Multiboard Timer
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • timeInteger Equal to 0
        • Then - Actions
          • Set timeInteger = timeIntegerStart
          • Set turn = (turn + 1)
          • Multiboard - Set the text for mBoard item in column 2, row 1 to (|cffFF0080 + (Turn + (|r + (|cff00FF00 + ((String(turn)) + |r)))))
          • For each (Integer P) from 1 to 12, do (Actions)
            • Loop - Actions
              • Set income = 8
              • For each (Integer B) from 1 to countryCount, do (Actions)
                • Loop - Actions
                  • Set tempGroup1 = countryRegions[B]
                  • Unit Group - Pick every unit in tempGroup1 and do (Actions)
                    • Loop - Actions
                      • Set tempUnit1 = (Picked unit)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of tempUnit1) Equal to (Player(P))
                          • ((Unit-type of tempUnit1) Equal to |cffff8000City|r) or ((Unit-type of tempUnit1) Equal to |cffff8000Port|r)
                        • Then - Actions
                          • Set tempInt[B] = (tempInt[B] + 1)
                        • Else - Actions
                          • Set tempInt[B] = 0
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • tempInt[B] Equal to countryCityCount[B]
                    • Then - Actions
                      • Set income = (income + (countryCityCount[B] - 1))
                      • Set tempPoint1 = (Center of countrySpawn[B])
                      • Unit - Create (countryCityCount[B] - 1) defaultUnitType for (Player(P)) at tempPoint1 facing Default building facing degrees
                      • Custom script: call RemoveLocation( udg_tempPoint1 )
                    • Else - Actions
              • Player - Add income to (Player(P)) Current gold
              • Player - Set (Player(P)) Food cap to turn
              • Player - Set (Player(P)) Food used to 60
              • Player - Add 1 to (Player(P)) Current lumber
        • Else - Actions
          • For each (Integer P) from 1 to 12, do (Actions)
            • Loop - Actions
              • Player - Add -1 to (Player(P)) Food used
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • timeInteger Less than or equal to 5
        • Then - Actions
          • Set turnTimerColor = |cffff0000
          • Multiboard - Set the text for mBoard item in column 1, row 1 to (|cffFF00FF + (Next Turn + (turnTimerColor + ((String(timeInteger)) + |r))))
        • Else - Actions
          • Set turnTimerColor = |cff00FF00
          • Multiboard - Set the text for mBoard item in column 1, row 1 to (|cffFF00FF + (Next Turn + (turnTimerColor + ((String(timeInteger)) + |r))))
      • Set timeInteger = (timeInteger - 1)
      • Trigger - Run Update Board <gen> (checking conditions)
      • Trigger - Run Update Player Status <gen> (checking conditions)

this is the trigger with a custom script to clear the unit group, it creates a bug of some sort and makes the trigger not work properly
  • Multiboard Timer
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • timeInteger Equal to 0
        • Then - Actions
          • Set timeInteger = timeIntegerStart
          • Set turn = (turn + 1)
          • Multiboard - Set the text for mBoard item in column 2, row 1 to (|cffFF0080 + (Turn + (|r + (|cff00FF00 + ((String(turn)) + |r)))))
          • For each (Integer P) from 1 to 12, do (Actions)
            • Loop - Actions
              • Set income = 8
              • For each (Integer B) from 1 to countryCount, do (Actions)
                • Loop - Actions
                  • Set tempGroup1 = countryRegions[B]
                  • Unit Group - Pick every unit in tempGroup1 and do (Actions)
                    • Loop - Actions
                      • Set tempUnit1 = (Picked unit)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of tempUnit1) Equal to (Player(P))
                          • ((Unit-type of tempUnit1) Equal to |cffff8000City|r) or ((Unit-type of tempUnit1) Equal to |cffff8000Port|r)
                        • Then - Actions
                          • Set tempInt[B] = (tempInt[B] + 1)
                        • Else - Actions
                          • Set tempInt[B] = 0
                  • Custom script: call DestroyGroup(udg_tempGroup1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • tempInt[B] Equal to countryCityCount[B]
                    • Then - Actions
                      • Set income = (income + (countryCityCount[B] - 1))
                      • Set tempPoint1 = (Center of countrySpawn[B])
                      • Unit - Create (countryCityCount[B] - 1) defaultUnitType for (Player(P)) at tempPoint1 facing Default building facing degrees
                      • Custom script: call RemoveLocation( udg_tempPoint1 )
                    • Else - Actions
              • Player - Add income to (Player(P)) Current gold
              • Player - Set (Player(P)) Food cap to turn
              • Player - Set (Player(P)) Food used to 60
              • Player - Add 1 to (Player(P)) Current lumber
        • Else - Actions
          • For each (Integer P) from 1 to 12, do (Actions)
            • Loop - Actions
              • Player - Add -1 to (Player(P)) Food used
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • timeInteger Less than or equal to 5
        • Then - Actions
          • Set turnTimerColor = |cffff0000
          • Multiboard - Set the text for mBoard item in column 1, row 1 to (|cffFF00FF + (Next Turn + (turnTimerColor + ((String(timeInteger)) + |r))))
        • Else - Actions
          • Set turnTimerColor = |cff00FF00
          • Multiboard - Set the text for mBoard item in column 1, row 1 to (|cffFF00FF + (Next Turn + (turnTimerColor + ((String(timeInteger)) + |r))))
      • Set timeInteger = (timeInteger - 1)
      • Trigger - Run Update Board <gen> (checking conditions)
      • Trigger - Run Update Player Status <gen> (checking conditions)
 
The logic was changed.

Set tempInt = (Number of units in (Units owned by (Player(P)) matching (((Matching unit) is in countryRegions) Equal to True)))
->
Following ling will create a new unit group each time:
(Number of units in (Units owned by (Player(P)) matching (((Matching unit) is in countryRegions) Equal to True)))
->

New groups, never destroy -> leak

===

Now, when we do:
Set tempGroup1 = countryRegions
-> no new group is created, we just refer to our already existing group "countryRegions"
-> when we destroy this group, then it will not exist anymore, meaning if we destroy "tempGroup1", we will destroy "countryRegions", too, because they at this moment refer to the same object, the same unit group.
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
Seriously

Why hasn't someone made a tool that can pin point possible crashes within a map?

I opened up a map the other day and it is clear to me that it would be pretty easy to check.

It would just take an excessive about of time initially but so what, many people spend years making a map so why not take years making the ultimate fix?
 
Level 6
Joined
Feb 10, 2011
Messages
188
oh shit iceman, i see what i did now

ill post again when i need more help if i do.

and when i update it all
 
Last edited:
Level 19
Joined
Jul 2, 2011
Messages
2,162
Seriously, go make it.
I was going to make a spell check for warcraft maps, but after I got such a negative response from the hive community I stopped trying

I managed to get to a point where it takes a map and gets all the strings used

I asked the community for non-words that warcraft uses, this because the spell check was flagging them as error, and bam

negative responses.

still that doesn't stop someone else from implementing the same idea
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,197
Only people who know for sure what is crashing WC3 is Blizzard as they have access to the debug symbols and source code to match them against. Sure due to Optimizations this process is not easy, but at least it is a lot easier than having to debug from x86 assembly...
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,197
I've tested it in past, and for me it crashed due to memory usage.
As a result of an infinite allocation loop or due to excessive memory usage?

WC3 should crash around 2 GB of memory usage (assuming non-extended addressing in build, common with x86 built applications). In reality I have never seen WC3 use that much memory, even when a map had so many leaks its performance was not playable any more.

Most out of memory crashes are a result of an infinite allocation loop, when the game recursively allocates memory for an impossible to meet condition. The process space will expand at the rate of hundreds of megabytes per second until it crashes, all the time the game appears frozen. I recall the most common version of this is if one accidently uses teleport regions such that the target point results in the unit entering the source region of another teleport in such a way that the unit it infinitely teleported. Since the unit enters region event interrupts trigger execution during unit move actions, the result is a new trigger thread is allocated on the heap for each teleport hop and since the unit must hop infinitely the result is that memory increases infinitely until the game crashes very quickly with an out of memory style error.
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
As a result of an infinite allocation loop or due to excessive memory usage?

WC3 should crash around 2 GB of memory usage (assuming non-extended addressing in build, common with x86 built applications). In reality I have never seen WC3 use that much memory, even when a map had so many leaks its performance was not playable any more.

Most out of memory crashes are a result of an infinite allocation loop, when the game recursively allocates memory for an impossible to meet condition. The process space will expand at the rate of hundreds of megabytes per second until it crashes, all the time the game appears frozen. I recall the most common version of this is if one accidently uses teleport regions such that the target point results in the unit entering the source region of another teleport in such a way that the unit it infinitely teleported. Since the unit enters region event interrupts trigger execution during unit move actions, the result is a new trigger thread is allocated on the heap for each teleport hop and since the unit must hop infinitely the result is that memory increases infinitely until the game crashes very quickly with an out of memory style error.
can't we create a simple program that tells you exactly which trig ran last?

that way you would at least know where the problem is
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,197
can't we create a simple program that tells you exactly which trig ran last?
I doubt there would be anything "simple" about such program. Especially without the debug symbols and source code to know where such data is in process memory.

This also assumes triggers are the only way to cause this. I am pretty sure there are object data errors that can also cause an infinite allocation loop.
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
I doubt there would be anything "simple" about such program. Especially without the debug symbols and source code to know where such data is in process memory.

This also assumes triggers are the only way to cause this. I am pretty sure there are object data errors that can also cause an infinite allocation loop.
if there is a program which can show you possible leaks, which there is, then it should be possible to make a program that automatically adds a debug message to every trig showing that it is running
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,197
if there is a program which can show you possible leaks, which there is, then it should be possible to make a program that automatically adds a debug message to every trig showing that it is running
Problem is that the final batch of messages, the messages that show where the crash is, do not get rendered. Triggers run between frames with their output being displayed at earliest on the next frame. If the game crashes due to something the triggers do then the output is never shown.
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
Problem is that the final batch of messages, the messages that show where the crash is, do not get rendered. Triggers run between frames with their output being displayed at earliest on the next frame. If the game crashes due to something the triggers do then the output is never shown.
Huh that is a problem

Ok what about text files. I know there are some programmers that are good enough to make warcraft produce txt files. Surely these text files will printout problem even after warcraft crashes. I mean if the problem is display, then this will not require a display. Even if it is one second after crash more than the display option. It might work
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,197
Ok what about text files. I know there are some programmers that are good enough to make warcraft produce txt files. Surely these text files will printout problem even after warcraft crashes. I mean if the problem is display, then this will not require a display. Even if it is one second after crash more than the display option. It might work
It might work if the file I/O is done as part of the triggers.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,197
sounds like a lot of lag but it is just for debugging
There should be no lag unless it explicitly writes the files in write out mode (no buffering). Otherwise it will write them to the file cache and allow the OS to write them out over time, even after the application crashes. OS do this for I/O performance on mechanical drives as they are far more efficient at writing a lot of data, even if that data is scattered randomly, than single blocks of data at a time.
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
There should be no lag unless it explicitly writes the files in write out mode (no buffering). Otherwise it will write them to the file cache and allow the OS to write them out over time, even after the application crashes. OS do this for I/O performance on mechanical drives as they are far more efficient at writing a lot of data, even if that data is scattered randomly, than single blocks of data at a time.
See I don't understand why people complain about Blizzard not giving the error code when clearly there are other solutions. Why hasn't anyone written a code to solve this problem?

I'm doing my part but I can't help with something I know nothing about.

I'm working on a spell check for hive maps, again a simple fix and yet no one has made one
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
There should be no lag unless it explicitly writes the files in write out mode (no buffering). Otherwise it will write them to the file cache and allow the OS to write them out over time, even after the application crashes. OS do this for I/O performance on mechanical drives as they are far more efficient at writing a lot of data, even if that data is scattered randomly, than single blocks of data at a time.
I just finished off making a warcraft map spell check.

It will probably take 2 more days before it is complete but....

I can't believe no one has tried to make one before. It was relatively easy. now no more map rejections for extremely bad spelling.
 
The main cause of crashes in WC3 is access violaiton/null pointer exception - basically, when you try to use a reference variable with no value assigned. There are also some other more specific causes, such as doing certain stuff during map initialization which have to be done after the game has started (creating multiboards, adding a rect to a region, etc). Leaks generally won't cause crashes in the sense of consuming too much memory, they'll rather just slow your game down until it freezes, but some handles have a stack size limit (such as text tags and effects) which i believe results in a null return value when you try to create new ones after that point... which in turn can cause issues. I also noticed that making a player declare war on the neutral passive player crashes the game.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
There are lots and lots of reasons for a crash that may or may not be statically analyzable. The more you stray off from vanilla WE map making, the more you will discover. And it's not just about singletons but also combinations of conditions. So yeah, have fun.

About the trigger debugging you can get some ideas from my signature (did not fit into my signature back then I guess) -> Advanced debugging techniques, jassAid. But you are right: program transformations, inserting debugging stuff for ingame also blows up the performance.

Actually, while you are at it, write a map validator: a tool that checks if a given map/campaign file is playable in wc3 and if not, tells where are the conflicts.
 
Last edited:
Status
Not open for further replies.
Top