Please show me where's the leak ? I'm using the Handle Counter and the value increase so quick every 5s.
+My trigger add custom value to any unit,and show the text which display the difference between the life of unit now and 0,5s before.
+When a unit die->it's value come to 0.
+My trigger add custom value to any unit,and show the text which display the difference between the life of unit now and 0,5s before.
+When a unit die->it's value come to 0.
Trigger:
- First
- Events
- Map initialization
- Conditions
- Actions
- Set MaxCustomValue = 1
- Set TempGroup = (Units in (Playable map area) matching ((((Matching unit) is A structure) Equal to (==) False) and (((Matching unit) is alive) Equal to (==) True)))
- 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)) is Summoned) Equal to (==) False
- ((Picked unit) is A structure) Equal to (==) False
- Then - Actions
- Unit - Set the custom value of (Picked unit) to MaxCustomValue
- Set OldLife[(Custom value of (Picked unit))] = (Life of (Picked unit))
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Picked unit) is A Hero) Equal to (==) True
- Then - Actions
- Set OldExp[(Custom value of (Picked unit))] = (Hero experience of (Picked unit))
- Else - Actions
- If - Conditions
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Set MaxCustomValue = (MaxCustomValue + 1)
- Else - Actions
- If - Conditions
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Custom script: call DestroyGroup(udg_TempGroup)
- Events
Trigger:
- Any New
- Events
- Unit - A unit enters (Entire map)
- Conditions
- ((Unit-type of (Triggering unit)) is Summoned) Equal to (==) False
- (Custom value of (Triggering unit)) Equal to (==) 0
- ((Triggering unit) is A structure) Equal to (==) False
- Actions
- Do Multiple ActionsFor each (Integer A) from 1 to MaxCustomValue, do (Actions)
- Loop - Actions
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- OldLife[(Integer A)] Equal to (==) 0.00
- Then - Actions
- Unit - Set the custom value of (Triggering unit) to (Integer A)
- Set OldLife[(Custom value of (Triggering unit))] = (Life of (Triggering unit))
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Triggering unit) is A Hero) Equal to (==) True
- Then - Actions
- Set OldExp[(Custom value of (Triggering unit))] = (Hero experience of (Triggering unit))
- Else - Actions
- If - Conditions
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- If - Conditions
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Custom value of (Triggering unit)) Equal to (==) MaxCustomValue
- Then - Actions
- Set MaxCustomValue = (MaxCustomValue + 1)
- Else - Actions
- If - Conditions
- Do Multiple ActionsFor each (Integer A) from 1 to MaxCustomValue, do (Actions)
- Events
Trigger:
- Show the difference life and exp
- Events
- Time - Every 0.50 seconds of game time
- Conditions
- Actions
- Set TempGroup = (Units in (Playable map area) matching ((((Matching unit) is alive) Equal to (==) True) and (((Unit-type of (Matching unit)) is Summoned) Equal to (==) False)))
- Unit Group - Pick every unit in TempGroup and do (Actions)
- Loop - Actions
- Set NewLife[(Custom value of (Picked unit))] = (Life of (Picked unit))
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Picked unit) is A Hero) Equal to (==) True
- Then - Actions
- Set NewExp[(Custom value of (Picked unit))] = (Hero experience of (Picked unit))
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- NewExp[(Custom value of (Picked unit))] Less than (<) OldExp[(Custom value of (Picked unit))]
- Then - Actions
- Set TempLocation[1] = (Position of (Picked unit))
- Set TempLocation[2] = (TempLocation[1] offset by 50.00 towards 315.00 degrees)
- Set TempInt = (OldExp[(Custom value of (Picked unit))] - NewExp[(Custom value of (Picked unit))])
- Floating Text - Create floating text that reads ( - + (String(TempInt))) at TempLocation[2] with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 100.00%), and 0.00% transparency
- Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 45.00 degrees
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
- Custom script: call RemoveLocation(udg_TempLocation[1])
- Custom script: call RemoveLocation(udg_TempLocation[2])
- Else - Actions
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- NewExp[(Custom value of (Picked unit))] Greater than (>) OldExp[(Custom value of (Picked unit))]
- Then - Actions
- Set TempLocation[1] = (Position of (Picked unit))
- Set TempLocation[2] = (TempLocation[1] offset by 50.00 towards 315.00 degrees)
- Set TempInt = (NewExp[(Custom value of (Picked unit))] - OldExp[(Custom value of (Picked unit))])
- Floating Text - Create floating text that reads ( + + (String(TempInt))) at TempLocation[2] with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 100.00%), and 0.00% transparency
- Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 45.00 degrees
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
- Custom script: call RemoveLocation(udg_TempLocation[1])
- Custom script: call RemoveLocation(udg_TempLocation[2])
- Else - Actions
- If - Conditions
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Set NewExp[(Custom value of (Picked unit))] = (Hero experience of (Picked unit))
- Else - Actions
- If - Conditions
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- NewLife[(Custom value of (Picked unit))] Less than (<) OldLife[(Custom value of (Picked unit))]
- Then - Actions
- Set TempLocation[1] = (Position of (Picked unit))
- Set TempLocation[2] = (TempLocation[1] offset by 50.00 towards 315.00 degrees)
- Set TempInt = (Integer((OldLife[(Custom value of (Picked unit))] - NewLife[(Custom value of (Picked unit))])))
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (TempInt Greater than (>) 1) and (TempInt Less than (<) 49000)
- Then - Actions
- Floating Text - Create floating text that reads ( - + (String(TempInt))) at TempLocation[2] with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
- Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 45.00 degrees
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
- Else - Actions
- If - Conditions
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Custom script: call RemoveLocation(udg_TempLocation[1])
- Custom script: call RemoveLocation(udg_TempLocation[2])
- Else - Actions
- If - Conditions
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Set OldLife[(Custom value of (Picked unit))] = (Life of (Picked unit))
- Set OldExp[(Custom value of (Picked unit))] = (Hero experience of (Picked unit))
- Set NewLife[(Custom value of (Picked unit))] = (Life of (Picked unit))
- Loop - Actions
- Custom script: call DestroyGroup(udg_TempGroup)
- Events
Code:
Clear Value
Events
Unit - A unit Dies
Conditions
(Custom value of (Triggering unit)) Greater than (>) 0
((Triggering unit) is A Hero) Equal to (==) False
Actions
Set OldLife[(Custom value of (Triggering unit))] = 0.00