• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Does this leak?

Status
Not open for further replies.
Level 4
Joined
Aug 3, 2011
Messages
222
My map always has some nasty heavy fps lag when it play like 10 minute.

Here is all the looping triggers in my mini map.
  • Shoot Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Shoot
    • Actions
      • Set Point[1] = (Position of (Triggering unit))
      • Set Point[3] = (Target point of ability being cast)
      • Set Point[2] = (Point[1] offset by 50.00 towards (Angle from Point[1] to Point[3]) degrees)
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at Point[2] facing (Angle from Point[1] to Point[3]) degrees
      • Unit - Set the custom value of (Last created unit) to 5
      • Custom script: call RemoveLocation(udg_Point[1])
      • Custom script: call RemoveLocation(udg_Point[2])
      • Custom script: call RemoveLocation(udg_Point[3])
      • Unit Group - Add (Last created unit) to Dummy_Group
      • Trigger - Turn on Shoot Loop <gen>
      • Set zzLoc1 = (Position of (Last created unit))
      • Set zzLoc2 = (Position of (Triggering unit))
      • Set zzReal = (Angle from zzLoc1 to zzLoc2)
      • Set zzReal2 = 15.00
      • Set zzUnit = (Triggering unit)
      • Set zzInteger2 = 15
      • Custom script: call RemoveLocation(udg_zzLoc1)
      • Custom script: call RemoveLocation(udg_zzLoc2)
      • Trigger - Run KnockBackAdd <gen> (checking conditions)
  • Shoot Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Dummy_Group and do (Actions)
        • Loop - Actions
          • Set Point[3] = (Position of (Picked unit))
          • Set Point[4] = (Point[3] offset by 30.00 towards (Facing of (Picked unit)) degrees)
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Terrain pathing at Point[4] of type Walkability is off) Equal to (==) False
              • Then - Actions
                • Unit - Move (Picked unit) instantly to Point[4]
              • Else - Actions
                • Unit Group - Remove (Picked unit) from Dummy_Group
                • Unit - Remove (Picked unit) from the game
                • Special Effect - Create a special effect at Point[4] using Abilities\Spells\Items\StaffOfPurification\PurificationCaster.mdl
                • Special Effect - Destroy (Last created special effect)
                • Cinematic - Ping minimap for (All allies of (Owner of TempUnit)) at Point[4] for 3.00 seconds
          • Custom script: call RemoveLocation(udg_Point[3])
          • Set TempUnit = (Picked unit)
          • Set TempGroup = (Units within 90.00 of Point[4] matching ((((Matching unit) is alive) Equal to (==) True) and ((Unit-type of (Matching unit)) Not equal to (!=) Dummy)))
          • Unit Group - Pick every unit in TempGroup and do (Actions)
            • Loop - Actions
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in TempGroup) Greater than (>) 0
                • Then - Actions
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Picked unit)) Equal to (==) Marine
                      • (TempUnit belongs to an enemy of (Owner of (Picked unit))) Equal to (==) True
                    • Then - Actions
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (TempUnit belongs to an enemy of (Owner of (Picked unit))) Equal to (==) True
                        • Then - Actions
                          • Unit - Cause TempUnit to damage (Picked unit), dealing 9999.00 damage of attack type Normal and damage type Normal
                          • Unit - Make (Picked unit) face Point[4] over 0.00 seconds
                          • Set zzLoc1 = (Position of TempUnit)
                          • Set zzLoc2 = (Position of (Picked unit))
                          • Set zzReal = (Angle from zzLoc1 to zzLoc2)
                          • Set zzReal2 = 20.00
                          • Set zzUnit = (Picked unit)
                          • Set zzInteger2 = 10
                          • Custom script: call RemoveLocation(udg_zzLoc1)
                          • Custom script: call RemoveLocation(udg_zzLoc2)
                          • Trigger - Run KnockBackAdd <gen> (checking conditions)
                          • Unit Group - Remove TempUnit from Dummy_Group
                          • Unit - Remove TempUnit from the game
                          • Special Effect - Create a special effect at Point[4] using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Cinematic - Ping minimap for (All allies of (Owner of TempUnit)) at Point[4] for 3.00 seconds
                        • Else - Actions
                          • Unit - Make (Picked unit) face Point[4] over 0.00 seconds
                          • Set zzLoc1 = (Position of TempUnit)
                          • Set zzLoc2 = (Position of (Picked unit))
                          • Set zzReal = (Angle from zzLoc1 to zzLoc2)
                          • Set zzReal2 = 20.00
                          • Set zzUnit = (Picked unit)
                          • Set zzInteger2 = 20
                          • Custom script: call RemoveLocation(udg_zzLoc1)
                          • Custom script: call RemoveLocation(udg_zzLoc2)
                          • Trigger - Run KnockBackAdd <gen> (checking conditions)
                          • Unit Group - Remove TempUnit from Dummy_Group
                          • Unit - Remove TempUnit from the game
                          • Special Effect - Create a special effect at Point[4] using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Cinematic - Ping minimap for (All allies of (Owner of TempUnit)) at Point[4] for 3.00 seconds
                    • Else - Actions
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Picked unit)) Equal to (==) Dummy
                        • Then - Actions
                          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Custom value of TempUnit) Greater than (>) 1
                            • Then - Actions
                              • Unit - Make TempUnit face ((Facing of TempUnit) - 160.00) over 0.00 seconds
                            • Else - Actions
                              • Unit Group - Remove TempUnit from Dummy_Group
                              • Unit - Remove TempUnit from the game
                              • Special Effect - Create a special effect at Point[4] using Objects\Spawnmodels\Human\FragmentationShards\FragBoomSpawn.mdl
                              • Special Effect - Destroy (Last created special effect)
                          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Custom value of (Picked unit)) Greater than (>) 1
                            • Then - Actions
                              • Unit - Make (Picked unit) face ((Facing of (Picked unit)) + 160.00) over 0.00 seconds
                            • Else - Actions
                              • Unit Group - Remove (Picked unit) from Dummy_Group
                              • Unit - Remove (Picked unit) from the game
                              • Set Point[5] = (Position of (Picked unit))
                              • Special Effect - Create a special effect at Point[5] using Objects\Spawnmodels\Human\FragmentationShards\FragBoomSpawn.mdl
                              • Custom script: call RemoveLocation(udg_Point[5])
                              • Special Effect - Destroy (Last created special effect)
                        • Else - Actions
                          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Unit-type of (Picked unit)) Equal to (==) Crate
                            • Then - Actions
                              • Set Tempinteger2 = (Random integer number between 1 and 3)
                                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                  • If - Conditions
                                    • Tempinteger2 Equal to (==) 1
                                  • Then - Actions
                                    • Unit - Make TempUnit face ((Facing of TempUnit) + 360.00) over 0.00 seconds
                                  • Else - Actions
                                    • Unit Group - Remove TempUnit from Dummy_Group
                                    • Unit - Remove TempUnit from the game
                                    • Special Effect - Create a special effect at Point[4] using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
                                    • Special Effect - Destroy (Last created special effect)
                            • Else - Actions
                              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Unit-type of (Picked unit)) Equal to (==) Cliff
                                • Then - Actions
                                  • Unit Group - Remove TempUnit from Dummy_Group
                                  • Unit - Remove TempUnit from the game
                                  • Special Effect - Create a special effect at Point[4] using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
                                  • Special Effect - Destroy (Last created special effect)
                                  • Cinematic - Ping minimap for (All allies of (Owner of TempUnit)) at Point[4] for 3.00 seconds
                                • Else - Actions
                • Else - Actions
          • Unit Group - Destroy unit group TempGroup
          • Custom script: call RemoveLocation(udg_Point[4])
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Number of units in Dummy_Group) Less than (<) 1
          • Then - Actions
            • Trigger - Turn off (This trigger)
          • Else - Actions
  • Combat Rush
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Combat Rush
    • Actions
      • Unit Group - Add (Triggering unit) to Rushing_Group
      • Set Rushing_Range[(Player number of (Owner of (Triggering unit)))] = 0.00
      • Set Rushing_Angle[(Player number of (Owner of (Triggering unit)))] = (Facing of (Triggering unit))
      • Trigger - Turn on Combat Rushing <gen>
  • Combat Rushing
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Rushing_Group and do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to (==) True
            • Then - Actions
              • Set Point[8] = (Position of (Picked unit))
              • Set Point[9] = (Point[8] offset by 40.00 towards Rushing_Angle[(Player number of (Owner of (Picked unit)))] degrees)
              • Set TempGroup = (Units within 100.00 of Point[9] matching ((((Matching unit) Not equal to (!=) (Picked unit)) and (((Matching unit) is alive) Equal to (==) True)) and ((Unit-type of (Matching unit)) Not equal to (!=) Dummy)))
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • Multiple ConditionsOr - Any (Conditions) are true
                      • Conditions
                        • (Terrain pathing at Point[9] of type Walkability is off) Equal to (==) True
                        • (Number of units in TempGroup) Greater than (>) 0
                  • Then - Actions
                    • Special Effect - Create a special effect at Point[8] using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
                    • Special Effect - Destroy (Last created special effect)
                    • Unit Group - Remove (Picked unit) from Rushing_Group
                    • Set zzLoc1 = Point[9]
                    • Set zzLoc2 = Point[8]
                    • Set zzReal = (Angle from zzLoc1 to zzLoc2)
                    • Set zzReal2 = 25.00
                    • Set zzUnit = (Picked unit)
                    • Set zzInteger2 = 30
                    • Custom script: call RemoveLocation(udg_zzLoc1)
                    • Custom script: call RemoveLocation(udg_zzLoc2)
                    • Trigger - Run KnockBackAdd <gen> (checking conditions)
                    • Set TempUnit3 = (Picked unit)
                    • Unit Group - Pick every unit in TempGroup and do (Actions)
                      • Loop - Actions
                        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • (Unit-type of (Picked unit)) Equal to (==) Marine
                          • Then - Actions
                            • Set zzReal = (Facing of TempUnit3)
                            • Set zzReal2 = 25.00
                            • Set zzUnit = (Picked unit)
                            • Set zzInteger2 = 30
                            • Trigger - Run KnockBackAdd <gen> (checking conditions)
                          • Else - Actions
                  • Else - Actions
                    • Set zzUnit = (Picked unit)
                    • Set zzReal = 100.00
                    • Custom script: set udg_zzX = GetUnitX(udg_zzUnit)
                    • Custom script: set udg_zzY = GetUnitY(udg_zzUnit)
                    • Set zzX = (zzX + ((Cos(Rushing_Angle[(Player number of (Owner of (Picked unit)))])) x zzReal))
                    • Set zzY = (zzY + ((Sin(Rushing_Angle[(Player number of (Owner of (Picked unit)))])) x zzReal))
                    • Custom script: if not IsTerrainPathable(udg_zzX, udg_zzY, PATHING_TYPE_WALKABILITY) then
                    • Custom script: call SetUnitX(udg_zzUnit,udg_zzX)
                    • Custom script: call SetUnitY(udg_zzUnit,udg_zzY)
                    • Custom script: endif
                    • Set Rushing_Range[(Player number of (Owner of (Picked unit)))] = (Rushing_Range[(Player number of (Owner of (Picked unit)))] + 25.00)
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Rushing_Range[(Player number of (Owner of (Picked unit)))] Greater than or equal to (>=) 200.00
                        • Then - Actions
                          • Unit Group - Remove (Picked unit) from Rushing_Group
                        • Else - Actions
                          • Special Effect - Create a special effect at Point[8] using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
                          • Special Effect - Destroy (Last created special effect)
              • Unit Group - Destroy unit group TempGroup
              • Custom script: call RemoveLocation(udg_Point[8])
              • Custom script: call RemoveLocation(udg_Point[9])
            • Else - Actions
              • Unit Group - Remove (Picked unit) from Rushing_Group
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Number of units in Rushing_Group) Less than (<) 1
          • Then - Actions
            • Trigger - Turn off (This trigger)
          • Else - Actions
  • KnockBackAdd
    • Events
    • Conditions
    • Actions
      • Set zzBoolean = False
        • Do Multiple ActionsFor each (Integer A) from 1 to knockCount, do (Actions)
          • Loop - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • knockZi[(Integer A)] Equal to (==) False
                • zzBoolean Equal to (==) False
              • Then - Actions
                • Set zzBoolean = True
                • Set zzInteger = (Integer A)
              • Else - Actions
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • zzBoolean Equal to (==) False
          • Then - Actions
            • Set knockCount = (knockCount + 1)
            • Set zzInteger = knockCount
          • Else - Actions
      • -------- - --------
      • Set knockAngle[zzInteger] = zzReal
      • Set knockPower[zzInteger] = zzReal2
      • Set knockUnit[zzInteger] = zzUnit
      • Set knockTodo[zzInteger] = zzInteger2
      • Set knockShould[zzInteger] = zzInteger2
      • Set knockZi[zzInteger] = True
      • Trigger - Turn on KnockBackMain <gen>
  • KnockBackMain
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to knockCount, do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • knockZi[(Integer A)] Equal to (==) True
            • Then - Actions
              • Set zzUnit = knockUnit[(Integer A)]
              • Set zzReal = ((Real(knockTodo[(Integer A)])) / (Real(knockShould[(Integer A)])))
              • Set zzReal = ((zzReal x zzReal) x knockPower[(Integer A)])
              • Custom script: set udg_zzX = GetUnitX(udg_zzUnit)
              • Custom script: set udg_zzY = GetUnitY(udg_zzUnit)
              • Set zzX = (zzX + ((Cos(knockAngle[(Integer A)])) x zzReal))
              • Set zzY = (zzY + ((Sin(knockAngle[(Integer A)])) x zzReal))
              • Custom script: if not IsTerrainPathable(udg_zzX, udg_zzY, PATHING_TYPE_WALKABILITY) then
              • Custom script: call SetUnitX(udg_zzUnit,udg_zzX)
              • Custom script: call SetUnitY(udg_zzUnit,udg_zzY)
              • Custom script: endif
              • Set knockTodo[(Integer A)] = (knockTodo[(Integer A)] - 1)
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • knockTodo[(Integer A)] Less than or equal to (<=) 0
                  • Then - Actions
                    • Set knockZi[(Integer A)] = False
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Integer A) Equal to (==) knockCount
                        • Then - Actions
                          • Set knockCount = (knockCount - 1)
                        • Else - Actions
                  • Else - Actions
            • Else - Actions
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Integer A) Equal to (==) knockCount
                • Then - Actions
                  • Set knockCount = (knockCount - 1)
                  • If (knockCount Equal to (==) 0) then do (Trigger - Turn off (This trigger)) else do (Do nothing)
                • Else - Actions
 
Level 4
Joined
Aug 3, 2011
Messages
222
Last edited by a moderator:
for ur group loop. i would store picked unit into a temp variable and use the temp variable it will speed things up and be more efficient.

normally anything u use twice store in a variable. the variable is more efficient in this case. Also it is easier to edit one thing rather than 2 +

You should get rid of Integer A it is less efficient than using ur own variable and is more likely to hit op-limit than ur own variable.
 

this is simple try it out.

use an integer A loop from 1 to 9999 and display the number on screen

then use a tempInteger from 1 to 9999 and display it on screen

the integer A loop always hits op-limit first and at a big difference.
i believe the difference was about 500 to 750 numbers.
so it is less efficient and has a higher chance of hitting op-limit.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
it may actually be because the Display...ToPlayer/Force is very heavy operation

Look at this:


  • Untitled Trigger 001
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 999999, do (Actions)
        • Loop - Actions
  • Untitled Trigger 001 Copy
    • Events
      • Time - Elapsed game time is 0.50 seconds
    • Conditions
    • Actions
      • For each (Integer int) from 1 to 999999, do (Actions)
        • Loop - Actions
  • Untitled Trigger 002
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Custom script: call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, I2S(bj_forLoopAIndex))
      • Custom script: call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, I2S(udg_int))


prints the same number for both values
 
it may actually be because the Display...ToPlayer/Force is very heavy operation

Look at this:


  • Untitled Trigger 001
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 999999, do (Actions)
        • Loop - Actions
  • Untitled Trigger 001 Copy
    • Events
      • Time - Elapsed game time is 0.50 seconds
    • Conditions
    • Actions
      • For each (Integer int) from 1 to 999999, do (Actions)
        • Loop - Actions
  • Untitled Trigger 002
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Custom script: call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, I2S(bj_forLoopAIndex))
      • Custom script: call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, I2S(udg_int))


prints the same number for both values

it prints the same that way because they dont have enough operations to hit the op-limit. If u add the same operations to both of them then the one that hits op limit first is the one thats less efficient.

but when u add operations into the loop integer A always hits op-limit first. Thats what u should go by since every loop has something in it.

i just tried adding a create unit to each the integer A was still lower than the temp Int one by 38. although it doesnt seem like a lot it still hits op limit faster.
integer A did 1910. tempInt did 1948
i then added an array just to store the last created units life and the difference was even greater. integer A did 1648 units. tempInt did 1704
 
test it like this.

  • Integer A
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 9999, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
          • Set tempReal[(Integer A)] = (Life of (Last created unit))
          • Game - Display to (All players) the text: (String((Integer A)))
  • your integer
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • For each (Integer tempInt) from 1 to 9999, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
          • Set tempReal[tempInt] = (Life of (Last created unit))
          • Game - Display to (All players) the text: (String(tempInt))
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
erm...wont that print only integer A or your variable? because when first action is ran, you crash the thread

also remove the print message and print it afterwards, you will never print anything in loop 10k times like that anyways
 
erm...wont that print only integer A or your variable? because when first action is ran, you crash the thread

also remove the print message and print it afterwards, you will never print anything in loop 10k times like that anyways

i turn one off then test then restart and test with the other. that way nothing else is affecting the outcome.

u print all numbers up till when it crashes so that way is fine as im trying to make it crash the thread.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
but that is not really good, the IO is veeery expensive, btw code:


  • Untitled Trigger 001 Copy
    • Events
      • Time - Elapsed game time is 0.50 seconds
    • Conditions
    • Actions
      • For each (Integer int) from 1 to 999999, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
          • Set tr[(Integer A)] = (Life of (Last created unit))
  • Untitled Trigger 001
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 999999, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
          • Set tr[(Integer A)] = (Life of (Last created unit))


2055 for both loops, so no Integer A is the same thread crash limit as your variable

anyways this is going a bit Off topic
 
this is wrong in the first trigger
  • Set tr[(Integer A)] = (Life of (Last created unit))
no idea how ur getting same number its not possible lol. ive had plenty of ppl test this also tested on all of my pcs and still same numbers. it might be that ur displaying the same values. try it exactly my way and see what happens.

edit: tried it ur way i get 2055 for integer A and 2098 for temp Integer
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
ow well, the tr[(Integer A)] = ... really made a difference, changed that to (int) and did 2055 vs 2098, so at the end you were right, I would say its because it generates > bj_loopIndexEnd vs > 999999 (global variable read vs static value)

Nevertheless, if you are doing 2000 with CreateUnit iterations there is something wrong

anyways, this went totally off topic I think
 
ow well, the tr[(Integer A)] = ... really made a difference, changed that to (int) and did 2055 vs 2098, so at the end you were right, I would say its because it generates > bj_loopIndexEnd vs > 999999 (global variable read vs static value)

Nevertheless, if you are doing 2000 with CreateUnit iterations there is something wrong

anyways, this went totally off topic I think

yea it definitely went off topic a bit lol. but i wasnt saying it for 2k createunit iterations. i was just using that as a fast easy example. think about when looping through spell instances. it needs to be efficient as possible otherwise it may hit op-limit. this can also happen with a good amount of other indexing systems. looping through destructables and some other things. i go for efficiency thats y i pointed it out.
 
Level 4
Joined
Aug 3, 2011
Messages
222
for ur group loop. i would store picked unit into a temp variable and use the temp variable it will speed things up and be more efficient.

normally anything u use twice store in a variable. the variable is more efficient in this case. Also it is easier to edit one thing rather than 2 +

You should get rid of Integer A it is less efficient than using ur own variable and is more likely to hit op-limit than ur own variable.

ok , will improve it, since i can't found any leak other than that unit group :3

btw, i learnt something again, doesn't care that off topic :3
 
Status
Not open for further replies.
Top