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

I am in need of more help, Leak Checking. Info inside

Status
Not open for further replies.
Level 6
Joined
Feb 10, 2011
Messages
188
Ok, so I have been making a Risk system for a while now and I'm constantly trying new things I finally sat down and made a majority of the system. Me and a friend were testing the map for bugs when we realized around turn 5, it gets laggy and the longer it goes on the worse it gets around turn 15 it was unplayable. (turns are 60 seconds.) I tested it on single player, i just sat there and didnt do anything, and still after 5 turns it got laggy and so on. So im going to post my triggers, if i missed a leak let me know.

  • Map Int
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Visibility - Disable fog of war
      • Visibility - Disable black mask
      • Set turn = 0
      • Set timeIntegerStart = 60
      • Set DefaultUnitType = Private
      • 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 Cam Commands <gen> the event (Player - (Player(P)) types a chat message containing - as A substring)
              • Camera - Set (Player(P))'s camera CAMERA_FIELD_TARGET_DISTANCE 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 = 12
              • Set incomeBase = 12
              • Set playerAliveString = |cff00ff00Alive|r
            • Else - Actions
      • Custom script: call DestroyTrigger( GetTriggeringTrigger() )
  • Set Countries
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set countryArea1[1] = Region 000 <gen>
      • Set countryName[1] = Ireland
      • Set countrySpawn[1] = Ireland <gen>
      • Set countryArea1[2] = Region 001 <gen>
      • Set countryName[2] = Wales
      • Set countrySpawn[2] = Wales <gen>
      • Set countryArea1[3] = Region 002 <gen>
      • Set countryArea2[3] = Region 003 <gen>
      • Set countryName[3] = England
      • Set countrySpawn[3] = England <gen>
      • Set countryArea1[4] = Region 006 <gen>
      • Set countryName[4] = Svalbard
      • Set countrySpawn[4] = Svalbard <gen>
      • Set countryArea1[5] = Region 004 <gen>
      • Set countryArea2[5] = Region 005 <gen>
      • Set countryName[5] = Norway
      • Set countrySpawn[5] = Norway <gen>
      • Set countryArea1[6] = Region 007 <gen>
      • Set countryArea2[6] = Region 008 <gen>
      • Set countryName[6] = Sweden
      • Set countrySpawn[6] = Sweden <gen>
      • Set countryArea1[7] = Region 009 <gen>
      • Set countryName[7] = Finland
      • Set countrySpawn[7] = Finland <gen>
      • Set countryArea1[8] = Region 010 <gen>
      • Set countryName[8] = Lithuania
      • Set countrySpawn[8] = Lithuana <gen>
      • Set countryArea1[9] = Region 012 <gen>
      • Set countryArea2[9] = Region 011 <gen>
      • Set countryName[9] = Russia
      • Set countrySpawn[9] = Russia <gen>
      • Set countryArea1[10] = Region 013 <gen>
      • Set countryName[10] = Moldova
      • Set countrySpawn[10] = Moldova <gen>
      • Set countryArea1[11] = Region 014 <gen>
      • Set countryName[11] = Ukraine
      • Set countrySpawn[11] = Ukraine <gen>
      • Set countryArea1[12] = Region 015 <gen>
      • Set countryName[12] = Romania
      • Set countrySpawn[12] = Romania <gen>
      • Set countryArea1[13] = Region 016 <gen>
      • Set countryName[13] = Belarus
      • Set countrySpawn[13] = Belarus <gen>
      • Set countryArea1[14] = Region 017 <gen>
      • Set countryName[14] = Czechoslovakia
      • Set countrySpawn[14] = Chez <gen>
      • Set countryArea1[15] = Region 018 <gen>
      • Set countryName[15] = Poland
      • Set countrySpawn[15] = Poland <gen>
      • Set countryArea1[16] = Region 019 <gen>
      • Set countryName[16] = Denmark
      • Set countrySpawn[16] = Denmark <gen>
      • Set countryArea1[17] = Region 020 <gen>
      • Set countryName[17] = Netherlands
      • Set countrySpawn[17] = Netherlands <gen>
      • Set countryArea1[18] = Region 021 <gen>
      • Set countryName[18] = Belgium
      • Set countrySpawn[18] = Belgium <gen>
      • Set countryArea1[19] = Region 022 <gen>
      • Set countryName[19] = Germany
      • Set countrySpawn[19] = Germany <gen>
      • Set countryArea1[20] = Region 023 <gen>
      • Set countryName[20] = Switzerland
      • Set countrySpawn[20] = Switz <gen>
      • Set countryArea1[21] = Region 024 <gen>
      • Set countryName[21] = Austria
      • Set countrySpawn[21] = Austria <gen>
      • Set countryArea1[22] = Region 025 <gen>
      • Set countryName[22] = Hungary
      • Set countrySpawn[22] = Hungary <gen>
      • Set countryArea1[23] = Region 026 <gen>
      • Set countryName[23] = Solvenia
      • Set countrySpawn[23] = Solvenia <gen>
      • Set countryArea1[24] = Region 027 <gen>
      • Set countryName[24] = Bosnia
      • Set countrySpawn[24] = Bosnia <gen>
      • Set countryArea1[25] = Region 029 <gen>
      • Set countryArea2[25] = Region 028 <gen>
      • Set countryName[25] = France
      • Set countrySpawn[25] = Frace <gen>
      • Set countryArea1[26] = Region 030 <gen>
      • Set countryName[26] = Spain
      • Set countrySpawn[26] = Spain <gen>
      • Set countryArea1[27] = Region 031 <gen>
      • Set countryName[27] = Portugal
      • Set countrySpawn[27] = Portugal <gen>
      • Set countryArea1[28] = Region 032 <gen>
      • Set countryName[28] = Morocco
      • Set countrySpawn[28] = Morrocco <gen>
      • Set countryArea1[29] = Region 033 <gen>
      • Set countryName[29] = Algeria
      • Set countrySpawn[29] = Algeria <gen>
      • Set countryArea1[30] = Region 034 <gen>
      • Set countryName[30] = Malta
      • Set countrySpawn[30] = Malta <gen>
      • Set countryArea1[31] = Region 035 <gen>
      • Set countryName[31] = Sardania
      • Set countrySpawn[31] = Sardania <gen>
      • Set countryArea1[32] = Region 036 <gen>
      • Set countryArea2[32] = Region 037 <gen>
      • Set countryName[32] = Italy
      • Set countrySpawn[32] = Italy <gen>
      • Set countryArea1[33] = Region 038 <gen>
      • Set countryName[33] = Libya
      • Set countrySpawn[33] = Libya <gen>
      • Set countryArea1[34] = Region 039 <gen>
      • Set countryName[34] = Egypt
      • Set countrySpawn[34] = Egypt <gen>
      • Set countryArea1[35] = Region 040 <gen>
      • Set countryName[35] = Greece
      • Set countrySpawn[35] = Greece <gen>
      • Set countryArea1[36] = Region 041 <gen>
      • Set countryName[36] = Turkey
      • Set countrySpawn[36] = Turkey <gen>
      • Set countryArea1[37] = Region 042 <gen>
      • Set countryName[37] = Isreal
      • Set countrySpawn[37] = Isreal <gen>
      • Set countryArea1[38] = Region 043 <gen>
      • Set countryName[38] = Georgia
      • Set countrySpawn[38] = Georgia <gen>
      • Set countryArea1[39] = Region 044 <gen>
      • Set countryName[39] = Armenia
      • Set countrySpawn[39] = Armenia <gen>
      • For each (Integer B) from 1 to 39, do (Actions)
        • Loop - Actions
          • Unit Group - Add all units of (Units in countryArea1[B] matching (((Unit-type of (Matching unit)) Equal to City) or ((Unit-type of (Matching unit)) Equal to Port))) to countryRegions[B]
          • Unit Group - Add all units of (Units in countryArea2[B] matching (((Unit-type of (Matching unit)) Equal to City) or ((Unit-type of (Matching unit)) Equal to Port))) to countryRegions[B]
          • Set countryCityCount[B] = (Number of units in countryRegions[B])
          • Set tempPoint1 = (Center of countrySpawn[B])
          • Set tempPoint2 = (tempPoint1 offset by (-85.00, -125.00))
          • Floating Text - Create floating text that reads (|cFFFF0303 + (countryName[B] + |r)) at tempPoint2 with Z offset 0.00, using font size 13.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Custom script: call RemoveLocation( udg_tempPoint1 )
          • Custom script: set udg_tempPoint1 = null
          • Custom script: call RemoveLocation( udg_tempPoint2 )
          • Custom script: set udg_tempPoint2 = null
      • Custom script: call DestroyTrigger( GetTriggeringTrigger() )
  • Randomize Bases
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • -------- Count Bases --------
      • Set tempBasesInt = 0
      • Set tempGroup1 = (Units owned by Neutral Hostile matching (((Unit-type of (Matching unit)) Equal to City) or ((Unit-type of (Matching unit)) Equal to Port)))
      • Set numOfBases = (Number of units in tempGroup1)
      • Unit Group - Pick every unit in tempGroup1 and do (Actions)
        • Loop - Actions
          • Set tempBasesInt = (tempBasesInt + 1)
          • Set baseCity[tempBasesInt] = (Picked unit)
          • Unit - Set the custom value of (Picked unit) to tempBasesInt
      • -------- Create Bases --------
      • For each (Integer D) from 1 to numOfBases, do (Actions)
        • Loop - Actions
          • Set tempPoint1 = (Position of baseCity[D])
          • Set tempPoint2 = (tempPoint1 offset by 280.00 towards 260.00 degrees)
          • Unit - Create 1 COP (large) for Neutral Passive at tempPoint2 facing Default building facing degrees
          • Set baseCircle[D] = (Last created unit)
          • Unit - Set the custom value of baseCircle[D] to (Custom value of baseCity[D])
          • Set tempPoint3 = (Position of baseCircle[D])
          • Unit - Create 1 Tower for Neutral Hostile at tempPoint3 facing 270.00 degrees
          • Set baseTower[D] = (Last created unit)
          • Unit - Set the custom value of baseTower[D] to (Custom value of baseCity[D])
          • Unit - Create 1 DefaultUnitType for Neutral Hostile at tempPoint3 facing Default building facing degrees
          • Set baseDefender[D] = (Last created unit)
          • Unit Group - Add baseDefender[D] to baseDefenders
          • Custom script: call RemoveLocation( udg_tempPoint1 )
          • Custom script: call RemoveLocation( udg_tempPoint2 )
          • Custom script: call RemoveLocation( udg_tempPoint3 )
      • -------- Count Players --------
      • Set tempPlayerInt = 0
      • Set tempForce1 = (All players matching (((Matching player) slot status) Equal to Is playing))
      • Set numOfPlayers = (Number of players in tempForce1)
      • For each (Integer D) from 1 to numOfBases, do (Actions)
        • Loop - Actions
          • Player Group - Pick every player in tempForce1 and do (Actions)
            • Loop - Actions
              • Set tempPlayerInt = (tempPlayerInt + 1)
              • Set tempPlayerArray1[tempPlayerInt] = (Random player from tempForce1)
          • Unit - Change ownership of baseCity[D] to (Player(tempPlayerInt)) and Change color
          • Unit - Change ownership of baseTower[D] to (Player(tempPlayerInt)) and Change color
          • Unit - Change ownership of baseDefender[D] to (Player(tempPlayerInt)) and Change color
          • Set cities[(Player number of (Player(tempPlayerInt)))] = (cities[(Player number of (Player(tempPlayerInt)))] + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • tempPlayerInt Greater than numOfPlayers
            • Then - Actions
              • Set tempPlayerInt = 0
            • Else - Actions
      • Custom script: call DestroyForce( udg_tempForce1 )
      • Custom script: set udg_tempForce1 = null
      • Custom script: call DestroyGroup( udg_tempGroup1 )
      • Custom script: set udg_tempGroup1 = null
      • Custom script: call DestroyTrigger( GetTriggeringTrigger() )
  • Change Defender Range
    • Events
      • Time - Every 0.15 seconds of game time
    • Conditions
    • Actions
      • For each (Integer D) from 1 to numOfBases, do (Actions)
        • Loop - Actions
          • Set tempUnit1 = baseCircle[D]
          • Set tempPoint1 = (Position of tempUnit1)
          • Set tempUnit2 = baseDefender[D]
          • Set tempPoint2 = (Position of tempUnit2)
          • Set tempGroup1 = (Units within 175.00 of tempPoint1 matching ((((Matching unit) is A structure) Equal to False) and ((Owner of (Matching unit)) Equal to (Owner of tempUnit2))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (Distance between (Position of tempUnit2) and tempPoint1) Greater than or equal to 175.00
                  • (Number of units in tempGroup1) Equal to 0
            • Then - Actions
              • Unit - Move tempUnit2 instantly to tempPoint1
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (Distance between (Position of tempUnit2) and tempPoint1) Greater than or equal to 175.00
                  • (Number of units in tempGroup1) Greater than or equal to 1
            • Then - Actions
              • Unit Group - Remove tempUnit2 from tempGroup1
              • Unit Group - Remove tempUnit2 from baseDefenders
              • Set tempUnit3 = (Random unit from tempGroup1)
              • Set baseDefender[D] = tempUnit3
              • Unit Group - Add tempUnit3 to baseDefenders
            • Else - Actions
          • Custom script: call DestroyGroup( udg_tempGroup1 )
          • Custom script: set udg_tempGroup1 = null
          • Custom script: set udg_tempUnit1 = null
          • Custom script: call RemoveLocation( udg_tempPoint1 )
          • Custom script: set udg_tempPoint1 = null
          • Custom script: set udg_tempUnit2 = null
          • Custom script: call RemoveLocation( udg_tempPoint2 )
          • Custom script: set udg_tempPoint2 = null
          • Custom script: set udg_tempUnit3 = null
  • Defender Death
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in baseDefenders) Equal to True
    • Actions
      • Set tempUnit1 = (Killing unit)
      • Set tempPoint4 = (Position of tempUnit1)
      • Set tempPlayer1 = (Owner of tempUnit1)
      • Set tempUnit2 = (Triggering unit)
      • Set tempPlayer2 = (Owner of tempUnit2)
      • Set tempPoint1 = (Position of tempUnit2)
      • Set tempGroup1 = (Units within 600.00 of tempPoint1 matching (((Matching unit) is A structure) Equal to True))
      • Set tempUnit3 = (Random unit from tempGroup1)
      • Set tempPoint2 = (Position of tempUnit3)
      • Unit Group - Remove tempUnit2 from baseDefenders
      • Unit Group - Add tempUnit1 to baseDefenders
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (tempUnit1 is A structure) Equal to True
              • (tempUnit1 is dead) Equal to True
        • Then - Actions
          • Set tempGroup2 = (Units within 600.00 of tempPoint4 matching ((((Matching unit) is A structure) Equal to False) and ((Owner of (Matching unit)) Equal to tempPlayer1)))
          • Set tempUnit1 = (Random unit from tempGroup2)
        • Else - Actions
      • Unit Group - Pick every unit in tempGroup1 and do (Actions)
        • Loop - Actions
          • Unit - Change ownership of (Picked unit) to tempPlayer1 and Change color
          • Unit - Change ownership of (Picked unit) to tempPlayer1 and Change color
          • Unit - Change ownership of (Picked unit) to tempPlayer1 and Change color
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Unit-type of (Picked unit)) Equal to City
                  • (Unit-type of (Picked unit)) Equal to Port
            • Then - Actions
              • Set baseDefender[(Custom value of (Picked unit))] = tempUnit1
              • Unit - Set the custom value of tempUnit1 to (Custom value of (Picked unit))
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to COP (large)
            • Then - Actions
              • Set tempPoint3 = (Position of (Picked unit))
            • Else - Actions
      • Unit - Move tempUnit1 instantly to tempPoint3
      • Set cities[(Player number of tempPlayer1)] = (cities[(Player number of tempPlayer1)] + 1)
      • Set cities[(Player number of tempPlayer2)] = (cities[(Player number of tempPlayer2)] - 1)
      • Custom script: set udg_tempUnit1 = null
      • Custom script: set udg_tempUnit2 = null
      • Custom script: set udg_tempUnit3 = null
      • Custom script: call RemoveLocation( udg_tempPoint1 )
      • Custom script: set udg_tempPoint1 = null
      • Custom script: call RemoveLocation( udg_tempPoint2 )
      • Custom script: set udg_tempPoint2 = null
      • Custom script: call RemoveLocation( udg_tempPoint3 )
      • Custom script: set udg_tempPoint3 = null
      • Custom script: call RemoveLocation( udg_tempPoint4 )
      • Custom script: set udg_tempPoint4 = null
      • Custom script: set udg_tempPlayer1 = null
      • Custom script: set udg_tempPlayer2 = null
      • Custom script: call DestroyGroup( udg_tempGroup1 )
      • Custom script: set udg_tempGroup1 = null
      • Custom script: call DestroyGroup( udg_tempGroup2 )
      • Custom script: set udg_tempGroup2 = null
  • Set Player Colors
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Set PlayerColour --------
      • Set playerColour[1] = (Name of Player 1 (Red))
      • Set playerColour[2] = (Name of Player 2 (Blue))
      • Set playerColour[3] = (Name of Player 3 (Teal))
      • Set playerColour[4] = (Name of Player 4 (Purple))
      • Set playerColour[5] = (Name of Player 5 (Yellow))
      • Set playerColour[6] = (Name of Player 6 (Orange))
      • Set playerColour[7] = (Name of Player 7 (Green))
      • Set playerColour[8] = (Name of Player 8 (Pink))
      • Set playerColour[9] = (Name of Player 9 (Gray))
      • Set playerColour[10] = (Name of Player 10 (Light Blue))
      • Set playerColour[11] = (Name of Player 11 (Dark Green))
      • Set playerColour[12] = (Name of Player 12 (Brown))
      • -------- Set ColourCode --------
      • Set colourCode[1] = |cffff0000
      • Set colourCode[2] = |cff0000ff
      • Set colourCode[3] = |cff00ffff
      • Set colourCode[4] = |cffa020f0
      • Set colourCode[5] = |cffffff00
      • Set colourCode[6] = |cffee9a00
      • Set colourCode[7] = |cff00cd00
      • Set colourCode[8] = |cffdb7093
      • Set colourCode[9] = |cff7f7f7f
      • Set colourCode[10] = |cff87ceeb
      • Set colourCode[11] = |cff006400
      • Set colourCode[12] = |cff804000
      • -------- Set ColourColor --------
      • 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 playerColour = (colourCode[C] + playerColour)
                • Else - Actions
      • Custom script: call DestroyTrigger( GetTriggeringTrigger() )
  • Create Multiboard
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 4 columns and 2 rows, titled Information
      • Set mboard = (Last created multiboard)
      • Multiboard - Change the title of mboard to (|cffD70000 + (Risk Revolution + |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 3.50% 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 playerColour[(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)])))
              • Multiboard - Set the text for mboard item in column 3, row tempInt[1] to (|cFFB4B7E3 + (String(cities[(Player number of tempPlayer1)])))
              • 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
          • -------- Run Checks Here --------
          • 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
              • Player - Set (Player(P)) Food cap to turn
              • Player - Set (Player(P)) Food used to 60
              • Player - Add income to (Player(P)) Current gold
              • 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 3
        • 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))
          • Sound - Play BattleNetTick <gen>
        • 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)
              • 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)) of type City)) Equal to 0) and ((Number of units in (Units owned by (Player(P)) of type Port)) Equal to 0)
            • Then - Actions
              • Set playerAliveString = |cff00ff00Dead|r
            • Else - Actions
I got all the leaks I noticed so far, if you can tell me if i missed any or why my game get laggy let me know, I would post the map but idk how to use the pastebin.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
this leaks. in trig 4
  • (Distance between (Position of tempUnit2) and tempPoint1) Greater than or equal to 175.00
get rid of the and conditions. Ive told u b4 the only time u use and conditions is inside an or conditions.

this should be stored in a variable. (Unit-type of (Picked unit))
same with anything used twice or more.

u destroy locations that may not be made yet in trigger 5.
This can create problems and should be avoided.

in trig 8 this is not enough to check if that slot is playing.
(tempPlayer1 slot status) Equal to Is playing
you also need to check if it is controlled by a player.
 
Level 6
Joined
Feb 10, 2011
Messages
188
Distance between (Position of tempUnit2) and tempPoint1) Greater than or equal to 175.00
(Number of units in (Units owned by (Player(P)) of type City)) Equal to 0) and ((Number of units in (Units owned by (Player(P)) of type Port)) Equal to 0)
this leaks. in trig 4
  • (Distance between (Position of tempUnit2) and tempPoint1) Greater than or equal to 175.00
get rid of the and conditions. Ive told u b4 the only time u use and conditions is inside an or conditions.

this should be stored in a variable. (Unit-type of (Picked unit))
same with anything used twice or more.

u destroy locations that may not be made yet in trigger 5.
This can create problems and should be avoided.

in trig 8 this is not enough to check if that slot is playing.
(tempPlayer1 slot status) Equal to Is playing
you also need to check if it is controlled by a player.

ok so i worked on it a little bit and i believe i fixed the 2 leaks that maker pointed out. i got rid of the and conditions, stored picked unit in a var. now in trigger 5, im guessing u meant temppoint4? i changed where i destroy it, lmk if that is correct.

now for the trig 8 thing u mention (which, i think u meant trig 7 and 9)
How come i cant use (tempPlayer1 slot status) Equal to Is playing? you recommended i also check if its controlled by a player, but the thing is. computer players are also added to the board along with all the info a normal player gets. so was the getting rid of computers the point of checking if its a player? or is it something else?

lmk if i fixed the 2 leaks mentioned by maker. (and the 1 by u, but its the same)

  • Update Player Status
    • Events
      • Time - Every 1.00 seconds of game time
    • 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
          • Set tempGroup1 = (Units owned by (Player(P)) of type City)
          • Set tempGroup2 = (Units owned by (Player(P)) of type Port)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Number of units in tempGroup1) Equal to 0) and ((Number of units in tempGroup2) Equal to 0)
            • Then - Actions
              • Set playerAliveString = |cff00ff00Dead|r
            • Else - Actions
          • Custom script: call DestroyGroup( udg_tempGroup1 )
          • Custom script: set udg_tempGroup1 = null
          • Custom script: call DestroyGroup( udg_tempGroup2)
          • Custom script: set udg_tempGroup2 = null

  • Change Defender Range
    • Events
      • Time - Every 0.15 seconds of game time
    • Conditions
    • Actions
      • For each (Integer D) from 1 to numOfBases, do (Actions)
        • Loop - Actions
          • Set tempUnit1 = baseCircle[D]
          • Set tempPoint1 = (Position of tempUnit1)
          • Set tempUnit2 = baseDefender[D]
          • Set tempPoint2 = (Position of tempUnit2)
          • Set tempGroup1 = (Units within 175.00 of tempPoint1 matching ((((Matching unit) is A structure) Equal to False) and ((Owner of (Matching unit)) Equal to (Owner of tempUnit2))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between tempPoint2 and tempPoint1) Greater than or equal to 175.00
              • (Number of units in tempGroup1) Equal to 0
            • Then - Actions
              • Unit - Move tempUnit2 instantly to tempPoint1
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between tempPoint2 and tempPoint1) Greater than or equal to 175.00
              • (Number of units in tempGroup1) Greater than or equal to 1
            • Then - Actions
              • Unit Group - Remove tempUnit2 from tempGroup1
              • Unit Group - Remove tempUnit2 from baseDefenders
              • Set tempUnit3 = (Random unit from tempGroup1)
              • Set baseDefender[D] = tempUnit3
              • Unit Group - Add tempUnit3 to baseDefenders
            • Else - Actions
          • Custom script: call DestroyGroup( udg_tempGroup1 )
          • Custom script: set udg_tempGroup1 = null
          • Custom script: set udg_tempUnit1 = null
          • Custom script: call RemoveLocation( udg_tempPoint1 )
          • Custom script: set udg_tempPoint1 = null
          • Custom script: set udg_tempUnit2 = null
          • Custom script: call RemoveLocation( udg_tempPoint2 )
          • Custom script: set udg_tempPoint2 = null
          • Custom script: set udg_tempUnit3 = null
 
Level 6
Joined
Feb 10, 2011
Messages
188
in trig 4 do you mean i need to null tempUnit3? and when using the
  • Set tempUnit = No Unit
is there any difference between it and using the custom script to null units?
  • Change Defender Range
    • Events
      • Time - Every 0.15 seconds of game time
    • Conditions
    • Actions
      • For each (Integer D) from 1 to numOfBases, do (Actions)
        • Loop - Actions
          • Set tempUnit1 = baseCircle[D]
          • Set tempPoint1 = (Position of tempUnit1)
          • Set tempUnit2 = baseDefender[D]
          • Set tempPoint2 = (Position of tempUnit2)
          • Set tempGroup1 = (Units within 175.00 of tempPoint1 matching ((((Matching unit) is A structure) Equal to False) and ((Owner of (Matching unit)) Equal to (Owner of tempUnit2))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between tempPoint2 and tempPoint1) Greater than or equal to 175.00
              • (Number of units in tempGroup1) Equal to 0
            • Then - Actions
              • Unit - Move tempUnit2 instantly to tempPoint1
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between tempPoint2 and tempPoint1) Greater than or equal to 175.00
              • (Number of units in tempGroup1) Greater than or equal to 1
            • Then - Actions
              • Unit Group - Remove tempUnit2 from tempGroup1
              • Unit Group - Remove tempUnit2 from baseDefenders
              • Set tempUnit3 = (Random unit from tempGroup1)
              • Set baseDefender[D] = tempUnit3
              • Unit Group - Add tempUnit3 to baseDefenders
              • Custom script: set udg_tempUnit3 = null
            • Else - Actions
          • Custom script: call DestroyGroup( udg_tempGroup1 )
          • Custom script: set udg_tempGroup1 = null
          • Custom script: set udg_tempUnit1 = null
          • Custom script: call RemoveLocation( udg_tempPoint1 )
          • Custom script: set udg_tempPoint1 = null
          • Custom script: set udg_tempUnit2 = null
          • Custom script: call RemoveLocation( udg_tempPoint2 )
          • Custom script: set udg_tempPoint2 = null
  • Defender Death
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in baseDefenders) Equal to True
    • Actions
      • Set tempUnit1 = (Killing unit)
      • Set tempPoint4 = (Position of tempUnit1)
      • Set tempPlayer1 = (Owner of tempUnit1)
      • Set tempUnit2 = (Triggering unit)
      • Set tempPlayer2 = (Owner of tempUnit2)
      • Set tempPoint1 = (Position of tempUnit2)
      • Set tempGroup1 = (Units within 600.00 of tempPoint1 matching (((Matching unit) is A structure) Equal to True))
      • Set tempUnit3 = (Random unit from tempGroup1)
      • Set tempPoint2 = (Position of tempUnit3)
      • Unit Group - Remove tempUnit2 from baseDefenders
      • Unit Group - Add tempUnit1 to baseDefenders
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (tempUnit1 is A structure) Equal to True
              • (tempUnit1 is dead) Equal to True
        • Then - Actions
          • Set tempGroup2 = (Units within 600.00 of tempPoint4 matching ((((Matching unit) is A structure) Equal to False) and ((Owner of (Matching unit)) Equal to tempPlayer1)))
          • Set tempUnit1 = (Random unit from tempGroup2)
        • Else - Actions
      • Unit Group - Pick every unit in tempGroup1 and do (Actions)
        • Loop - Actions
          • Set tempUnit4 = (Picked unit)
          • Unit - Change ownership of tempUnit4 to tempPlayer1 and Change color
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Unit-type of tempUnit4) Equal to City
                  • (Unit-type of tempUnit4) Equal to Port
            • Then - Actions
              • Set baseDefender[(Custom value of tempUnit4)] = tempUnit1
              • Unit - Set the custom value of tempUnit1 to (Custom value of tempUnit4)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of tempUnit4) Equal to COP (large)
            • Then - Actions
              • Set tempPoint3 = (Position of tempUnit4)
              • Unit - Move tempUnit1 instantly to tempPoint3
              • Custom script: call RemoveLocation( udg_tempPoint3 )
              • Custom script: set udg_tempPoint3 = null
            • Else - Actions
          • Custom script: set udg_tempUnit4 = null
      • Set cities[(Player number of tempPlayer1)] = (cities[(Player number of tempPlayer1)] + 1)
      • Set cities[(Player number of tempPlayer2)] = (cities[(Player number of tempPlayer2)] - 1)
      • Custom script: set udg_tempUnit1 = null
      • Custom script: set udg_tempUnit2 = null
      • Custom script: set udg_tempUnit3 = null
      • Custom script: call RemoveLocation( udg_tempPoint1 )
      • Custom script: set udg_tempPoint1 = null
      • Custom script: call RemoveLocation( udg_tempPoint2 )
      • Custom script: set udg_tempPoint2 = null
      • Custom script: call RemoveLocation( udg_tempPoint4 )
      • Custom script: set udg_tempPoint4 = null
      • Custom script: set udg_tempPlayer1 = null
      • Custom script: set udg_tempPlayer2 = null
      • Custom script: call DestroyGroup( udg_tempGroup1 )
      • Custom script: set udg_tempGroup1 = null
      • Custom script: call DestroyGroup( udg_tempGroup2 )
      • Custom script: set udg_tempGroup2 = null
posted trig 5 as requested.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
there is no difference when using the gui action for nulling units.
yes thats were u should null it.

trig 5 looks good now.
Only problem i have with it is that u change the custom value which is not a good idea. That limits u to never being able to use a unit indexer which is used in a lot of things. You should make all of ur triggers without setting custom value of units.
 
Level 6
Joined
Feb 10, 2011
Messages
188
there is no difference when using the gui action for nulling units.
yes thats were u should null it.

trig 5 looks good now.
Only problem i have with it is that u change the custom value which is not a good idea. That limits u to never being able to use a unit indexer which is used in a lot of things. You should make all of ur triggers without setting custom value of units.

alright, thank you sir. i will give an attempt to do this. so remember my bounty question from the other day? i messed up in my OP. i meant to say bounty should be equal to 1/4 of a units point value. and the units point value is the gold cost of a unit. (which ranges from 1-30) i just didn't want to bump that thread to fix my mistake, at least till this thread is lower on the list. i just remember reading it and u and another guy said u didn't get why i was dividing by 4. now u know why :p
 
Level 6
Joined
Feb 10, 2011
Messages
188
well the problem with that is that the gold u get from killing the unit will be 0 for units with point value 1 to 3
1 for units 4 to 7
2 for units 8 to 11
and so on.
The problem is in the math. it wont work the way u want it to.

hmm, i have seen it done in 2 games. I think it was done in Jass though. :/ i havent really looked at em yet.

Oh but ya actually, I was just testing my game. I did the same thing as before I did nothing at all and this time around 25 minutes it got laggy enough to notice. Any ideas why?
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
could be some other leaks in ur map.

Also u can easily do it by just using that units point value.
in most games they set the point value to the gold they want that unit to give not the gold that unit costs.
others use a simple math function basically add 4 to the point value then divide by 4. This will make a 0 number not possible.
Its all done by how u do ur math
 
Status
Not open for further replies.
Top