• 🏆 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] Delay Problems (With Summoning?)

Status
Not open for further replies.
Level 7
Joined
Apr 27, 2008
Messages
94
I am working on a map that has a hybrid game play of hero wars/dota and hero line wars. However, there are huge delay problems with the games. I believe that it has to do with the summoning trigger(s). Yes, I admit that they are pretty big for a trigger that is going off all of the time, but they get the job done. The summoning trigger does three main things, first it causes your bought unit to summon in your summoning region, second it causes a scaling smaller portion of your summons to summon as enemy units in the enemy summon, and lastly it tells noobs what to do once they summon for their first time.

If someone could tell me what exactly is causing the delay (not lag, for i would think that too many executions would cause lag), and explain a solution I would be extremely grateful...

You can play the map and see the problem for yourself (Hero Line Armageddon 1.1.2 - The Hive Workshop - A Warcraft III Modding Site) for this might help put it into context.
The delay usually happens with more than 8ish players.

Here are the scripts below:
  • Summoning
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Summoning Shrine [Red]
          • (Unit-type of (Triggering unit)) Equal to Summoning Shrine [Red]
          • (Unit-type of (Triggering unit)) Equal to Summoning Shrine [Blue]
          • (Unit-type of (Triggering unit)) Equal to Summoning Shrine [Blue]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_Lane[(Player number of (Owner of (Triggering unit)))] Not equal to 0
        • Then - Actions
          • Set Integer_Income[(Player number of (Owner of (Sold unit)))] = (Integer_Income[(Player number of (Owner of (Triggering unit)))] + (Point-value of (Sold unit)))
          • Set Integer = (Random integer number between 1 and 7)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer Equal to 1
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Sold unit)) Equal to Militia
                • Then - Actions
                  • Set UnitType = Archer
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Sold unit)) Equal to Ghoul
                    • Then - Actions
                      • Set UnitType = Rifleman
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Sold unit)) Equal to Footman
                        • Then - Actions
                          • Set UnitType = Headhunter
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Unit-type of (Sold unit)) Equal to Grunt
                            • Then - Actions
                              • Set UnitType = Crypt Fiend
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Unit-type of (Sold unit)) Equal to Shaman
                                • Then - Actions
                                  • Set UnitType = Witch Doctor
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Unit-type of (Sold unit)) Equal to Huntress
                                    • Then - Actions
                                      • Set UnitType = Banshee
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Unit-type of (Sold unit)) Equal to Druid of the Claw
                                        • Then - Actions
                                          • Set UnitType = Dryad
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • (Unit-type of (Sold unit)) Equal to Spell Breaker
                                            • Then - Actions
                                              • Set UnitType = Gargoyle
                                            • Else - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • (Unit-type of (Sold unit)) Equal to Raider
                                                • Then - Actions
                                                  • Set UnitType = Wyvern
                                                • Else - Actions
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • Or - Any (Conditions) are true
                                                        • Conditions
                                                          • (Unit-type of (Sold unit)) Equal to Knight
                                                          • (Unit-type of (Sold unit)) Equal to Knight [Q]
                                                    • Then - Actions
                                                      • Set UnitType = Gryphon Rider
                                                    • Else - Actions
                                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                        • If - Conditions
                                                          • Or - Any (Conditions) are true
                                                            • Conditions
                                                              • (Unit-type of (Sold unit)) Equal to Tauren
                                                              • (Unit-type of (Sold unit)) Equal to Tauren [W]
                                                        • Then - Actions
                                                          • Set UnitType = Chimaera
                                                        • Else - Actions
                                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                            • If - Conditions
                                                              • Or - Any (Conditions) are true
                                                                • Conditions
                                                                  • (Unit-type of (Sold unit)) Equal to Abomination
                                                                  • (Unit-type of (Sold unit)) Equal to Abomination [E]
                                                            • Then - Actions
                                                              • Set UnitType = Frost Wyrm
                                                            • Else - Actions
                                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                • If - Conditions
                                                                  • (Unit-type of (Sold unit)) Equal to Mountain Giant
                                                                • Then - Actions
                                                                  • Set UnitType = Mountain Giant
                                                                • Else - Actions
                                                                  • Do nothing
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Sold unit)) Equal to Murloc
                • Then - Actions
                  • Set UnitType = Arachnathid
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Sold unit)) Equal to Bandit
                    • Then - Actions
                      • Set UnitType = Brigand
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Sold unit)) Equal to Gnoll
                        • Then - Actions
                          • Set UnitType = Gnoll Poacher
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Unit-type of (Sold unit)) Equal to Kobald
                            • Then - Actions
                              • Set UnitType = Kobald Geomancer
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Unit-type of (Sold unit)) Equal to Forest Troll
                                • Then - Actions
                                  • Set UnitType = Forest Troll High Priest
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Unit-type of (Sold unit)) Equal to Centaur
                                    • Then - Actions
                                      • Set UnitType = Centaur Archer
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Unit-type of (Sold unit)) Equal to Draenei
                                        • Then - Actions
                                          • Set UnitType = Succubus
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • (Unit-type of (Sold unit)) Equal to Furbolg
                                            • Then - Actions
                                              • Set UnitType = Lightning Lizard
                                            • Else - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • (Unit-type of (Sold unit)) Equal to Sea Giant
                                                • Then - Actions
                                                  • Set UnitType = Ancient Hydra
                                                • Else - Actions
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • Or - Any (Conditions) are true
                                                        • Conditions
                                                          • (Unit-type of (Sold unit)) Equal to Battle Golem
                                                          • (Unit-type of (Sold unit)) Equal to Battle Golem [Q]
                                                    • Then - Actions
                                                      • Set UnitType = Infernal Juggernaut
                                                    • Else - Actions
                                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                        • If - Conditions
                                                          • Or - Any (Conditions) are true
                                                            • Conditions
                                                              • (Unit-type of (Sold unit)) Equal to Ogre
                                                              • (Unit-type of (Sold unit)) Equal to Ogre [W]
                                                        • Then - Actions
                                                          • Set UnitType = Harpy
                                                        • Else - Actions
                                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                            • If - Conditions
                                                              • Or - Any (Conditions) are true
                                                                • Conditions
                                                                  • (Unit-type of (Sold unit)) Equal to Magnataur
                                                                  • (Unit-type of (Sold unit)) Equal to Magnataur [E]
                                                            • Then - Actions
                                                              • Set UnitType = Blue Dragon
                                                            • Else - Actions
                                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                • If - Conditions
                                                                  • (Unit-type of (Sold unit)) Equal to Sasquatch
                                                                • Then - Actions
                                                                  • Set UnitType = Sasquatch
                                                                • Else - Actions
                                                                  • Do nothing
            • Else - Actions
              • Set UnitType = (Unit-type of (Sold unit))
          • Unit - Remove (Sold unit) from the game
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Triggering unit)) is in PlayerGroup_TeamOne) Equal to True
            • Then - Actions
              • Unit - Create 1 UnitType for Neutral Victim at (Random point in Region_Summon[(Player number of (Owner of (Triggering unit)))]) facing Default building facing degrees
              • Unit - Order (Last created unit) to Attack-Move To (Random point in Region_Send[(Player number of (Owner of (Triggering unit)))])
              • Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
              • Unit - Set the custom value of (Last created unit) to (Player number of (Owner of (Triggering unit)))
              • Player - Add 1 to (Owner of (Triggering unit)) Food used
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • And - All (Conditions) are true
                        • Conditions
                          • (Region 000 <gen> contains (Last created unit)) Equal to True
                          • Integer_TeamOneMass[1] Greater than 0
                      • And - All (Conditions) are true
                        • Conditions
                          • (Region 001 <gen> contains (Last created unit)) Equal to True
                          • Integer_TeamOneMass[2] Greater than 0
                      • And - All (Conditions) are true
                        • Conditions
                          • (Region 006 <gen> contains (Last created unit)) Equal to True
                          • Integer_TeamOneMass[3] Greater than 0
                • Then - Actions
                  • Set Integer = (Random integer number between 1 and 2)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Integer Equal to 1
                    • Then - Actions
                      • Unit - Create 1 UnitType for Neutral Victim at (Random point in Region_Summon[(Player number of (Owner of (Triggering unit)))]) facing Default building facing degrees
                      • Unit - Order (Last created unit) to Attack-Move To (Random point in Region_Send[(Player number of (Owner of (Triggering unit)))])
                      • Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
                      • Unit - Set the custom value of (Last created unit) to (Player number of (Owner of (Triggering unit)))
                      • Player - Add 1 to (Owner of (Triggering unit)) Food used
                    • Else - Actions
                      • Do nothing
                • Else - Actions
                  • Do nothing
            • Else - Actions
              • Unit - Create 1 UnitType for Neutral Extra at (Random point in Region_Summon[(Player number of (Owner of (Triggering unit)))]) facing Default building facing degrees
              • Unit - Order (Last created unit) to Attack-Move To (Random point in Region_Send[(Player number of (Owner of (Triggering unit)))])
              • Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
              • Unit - Set the custom value of (Last created unit) to (Player number of (Owner of (Triggering unit)))
              • Player - Add 1 to (Owner of (Triggering unit)) Food used
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • And - All (Conditions) are true
                        • Conditions
                          • (Region 000 <gen> contains (Last created unit)) Equal to True
                          • Integer_TeamTwoMass[1] Greater than 0
                      • And - All (Conditions) are true
                        • Conditions
                          • (Region 001 <gen> contains (Last created unit)) Equal to True
                          • Integer_TeamTwoMass[2] Greater than 0
                      • And - All (Conditions) are true
                        • Conditions
                          • (Region 006 <gen> contains (Last created unit)) Equal to True
                          • Integer_TeamTwoMass[3] Greater than 0
                • Then - Actions
                  • Set Integer = (Random integer number between 1 and 2)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Integer Equal to 1
                    • Then - Actions
                      • Unit - Create 1 UnitType for Neutral Extra at (Random point in Region_Summon[(Player number of (Owner of (Triggering unit)))]) facing Default building facing degrees
                      • Unit - Order (Last created unit) to Attack-Move To (Random point in Region_Send[(Player number of (Owner of (Triggering unit)))])
                      • Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
                      • Unit - Set the custom value of (Last created unit) to (Player number of (Owner of (Triggering unit)))
                      • Player - Add 1 to (Owner of (Triggering unit)) Food used
                    • Else - Actions
                      • Do nothing
                • Else - Actions
                  • Do nothing
        • Else - Actions
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cff00ff00Please en...
          • Unit - Remove (Sold unit) from the game
          • Player - Add ((Point-value of (Sold unit)) x 5) to (Owner of (Triggering unit)) Current gold
          • Camera - Pan camera for (Owner of (Triggering unit)) to (Center of Region 010 <gen>) over 0.00 seconds
  • Advanced Summoning
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • Integer_Rounds Less than or equal to 15
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Summoning Shrine [Red]
          • (Unit-type of (Triggering unit)) Equal to Summoning Shrine [Blue]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_Noob[(Player number of (Owner of (Triggering unit)))] Equal to 0
        • Then - Actions
          • Set Integer_Noob[(Player number of (Owner of (Triggering unit)))] = 1
          • Unit Group - Pick every unit in (Random 1 units from (Units owned by (Owner of (Triggering unit)) matching (((Matching unit) is A Hero) Equal to True))) and do (Actions)
            • Loop - Actions
              • Camera - Pan camera for (Owner of (Picked unit)) to (Center of Region_Summon[(Player number of (Owner of (Triggering unit)))]) over 0.00 seconds
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cff00ff00Good job,...
              • Cinematic - Ping minimap for (Player group((Owner of (Triggering unit)))) at (Center of Region_Send[(Player number of (Owner of (Triggering unit)))]) for 5.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)
          • Wait 1.00 game-time seconds
          • Unit Group - Pick every unit in (Random 1 units from (Units owned by (Owner of (Triggering unit)) matching (((Matching unit) is A Hero) Equal to True))) and do (Actions)
            • Loop - Actions
              • Unit - Order (Picked unit) to Attack-Move To (Center of Region_Send[(Player number of (Owner of (Triggering unit)))])
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cff00ff00Push your...
              • Camera - Pan camera for (Owner of (Triggering unit)) to (Center of Region_Send[(Player number of (Owner of (Triggering unit)))]) over 3.00 seconds
          • Wait 5.00 game-time seconds
          • Unit Group - Pick every unit in (Random 1 units from (Units owned by (Owner of (Triggering unit)) matching (((Matching unit) is A Hero) Equal to True))) and do (Actions)
            • Loop - Actions
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cff00ff00Good luck
              • Camera - Pan camera for (Owner of (Triggering unit)) to (Position of (Picked unit)) over 0.00 seconds
              • Selection - Select (Picked unit) for (Owner of (Triggering unit))
        • Else - Actions
          • Do nothing
      • Set Integer = (Random integer number between 1 and Integer_Rounds)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer Equal to 1
          • Integer_Lane[(Player number of (Owner of (Triggering unit)))] Not equal to 0
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Triggering unit)) is in PlayerGroup_TeamOne) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Sold unit)) Equal to Militia
                • Then - Actions
                  • Set UnitType = Murloc
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Sold unit)) Equal to Ghoul
                    • Then - Actions
                      • Set UnitType = Bandit
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Sold unit)) Equal to Footman
                        • Then - Actions
                          • Set UnitType = Gnoll
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Unit-type of (Sold unit)) Equal to Grunt
                            • Then - Actions
                              • Set UnitType = Kobald
                            • Else - Actions
                              • Do nothing
              • Set Integer = (Random integer number between 1 and 7)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Integer Equal to 1
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Sold unit)) Equal to Murloc
                    • Then - Actions
                      • Set UnitType = Arachnathid
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Sold unit)) Equal to Bandit
                        • Then - Actions
                          • Set UnitType = Brigand
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Unit-type of (Sold unit)) Equal to Gnoll
                            • Then - Actions
                              • Set UnitType = Gnoll Poacher
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Unit-type of (Sold unit)) Equal to Kobald
                                • Then - Actions
                                  • Set UnitType = Kobald Geomancer
                                • Else - Actions
                                  • Do nothing
                • Else - Actions
                  • Do nothing
              • Unit - Create 1 UnitType for Neutral Extra at (Random point in Region_Send[(Player number of (Owner of (Triggering unit)))]) facing Default building facing degrees
              • Unit - Order (Last created unit) to Attack-Move To (Random point in Region_Summon[(Player number of (Owner of (Triggering unit)))])
              • Unit - Change color of (Last created unit) to Black
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Sold unit)) Equal to Murloc
                • Then - Actions
                  • Set UnitType = Militia
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Sold unit)) Equal to Bandit
                    • Then - Actions
                      • Set UnitType = Ghoul
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Sold unit)) Equal to Gnoll
                        • Then - Actions
                          • Set UnitType = Footman
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Unit-type of (Sold unit)) Equal to Kobald
                            • Then - Actions
                              • Set UnitType = Grunt
                            • Else - Actions
                              • Do nothing
              • Set Integer = (Random integer number between 1 and 7)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Integer Equal to 1
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • UnitType Equal to Militia
                    • Then - Actions
                      • Set UnitType = Archer
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • UnitType Equal to Ghoul
                        • Then - Actions
                          • Set UnitType = Rifleman
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • UnitType Equal to Footman
                            • Then - Actions
                              • Set UnitType = Headhunter
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • UnitType Equal to Grunt
                                • Then - Actions
                                  • Set UnitType = Crypt Fiend
                                • Else - Actions
                                  • Do nothing
                • Else - Actions
                  • Do nothing
              • Unit - Create 1 UnitType for Neutral Victim at (Random point in Region_Send[(Player number of (Owner of (Triggering unit)))]) facing Default building facing degrees
              • Unit - Order (Last created unit) to Attack-Move To (Random point in Region_Summon[(Player number of (Owner of (Triggering unit)))])
              • Unit - Change color of (Last created unit) to Black
        • Else - Actions
          • Do nothing
Note: They used to be one trigger, making it two didn't do anything really.

Is it just the sheer size of the triggers with all of the if/then/else functions? If so, please float an idea on how i would do a similar thing without this.
 
Level 5
Joined
Oct 3, 2008
Messages
104
lol, largest bloody GUI trigger i have ever seen, and that means something is wrong..

the if then else conditions should be put side by side, otherwise the game runs through every single if then else during each run of the trigger, which is inefficient. since u have so many units to use in the if then else triggers, another solutiopn would be to categorize the units into different races (e.g. demon, creep, undead) stuff like that, and set ascending unit levels in each category for each unit. this way, you can detect a unit according to its race and level, instead of making if tehn else for every single unit type. the resulting unit can then be calculated using the race and unit level (u may not even need to categorise into races here, but if u have units of equal ability and level then this will be necessary). the resulting unit types will have to be stored in a unit type array, and ordered according to their level. by calculating the level of the sold unit, u can easily pick the right unit from the array by calculating the array index that results from the sold unit's level.

BUT the major problem is all the point leaks in your trigger. every time you refer to a point location, and use it without putting it in a variable, it will create a memory leak, as the data is stored in ur computer until the map is closed. this causes massive lag. i bet you that you lag more every time the trigger is run, and if u run that trigger frequently im guessing that ur map will crash without running the trigger to even 100 times. the memory leaks accumulate and make the map unplayable. u must use call udg_removelocation_(point) [actually i dont remember the memory leak removal custom script off by heart, but it can be found easily by searching how to remove memory leaks]

so in brief, once you use a point reference in your trigger, it must be set as a variable before u use it, and then u must remove the data stored in that variable using this custom script. i suggest reading a tutorial on how to clean memory leaks. i was going to list every single part of your trigger that was leaking, but after abit of scrolling down i couldnt really be bothered counting LOL there is too many, ur trigger is too massive. once u get used to cleaning memory leaks it will be a piece of cake, and it isnt that hard, dont need any jass knowledge, just gotta add a couple of extra lines every time u use a point reference (stuff like, order unit to move to random point in region)
 
Status
Not open for further replies.
Top