Hey dear community
I just made a system and really need help by removing the lagg.
Info to the system:
The system allows a player to use a Moon Well of his team to heal himself per second over a certain amount of time just by right clicking on the Moon Well.
After right-clicking a Moon Well the system will check (period timer) if the ordered unit reached a certain distance between his current position and the unit of issued order. If so, you will get 2 buffs: 1. a buff that heals you over time per second and 2. a debuff that disallows you to benefit from the heal buff again (it's similiar to the Heroes of the Storm Moon Well System).
Well here is the problem now:
If i use it with one Hero there is no lagg. (i even set the debuff duration to 0 to spam right-cklicking the Moon Well and there was still no lagg)
But as soon as a second hero is right clicking a Moon Well, it causes a little lagg until one of the heal buffs runs out.
If you have any suggestions to remove the lagg or to improve the code please let me know.
Thank you in advance!
I just made a system and really need help by removing the lagg.
Info to the system:
The system allows a player to use a Moon Well of his team to heal himself per second over a certain amount of time just by right clicking on the Moon Well.
After right-clicking a Moon Well the system will check (period timer) if the ordered unit reached a certain distance between his current position and the unit of issued order. If so, you will get 2 buffs: 1. a buff that heals you over time per second and 2. a debuff that disallows you to benefit from the heal buff again (it's similiar to the Heroes of the Storm Moon Well System).
Well here is the problem now:
If i use it with one Hero there is no lagg. (i even set the debuff duration to 0 to spam right-cklicking the Moon Well and there was still no lagg)
But as soon as a second hero is right clicking a Moon Well, it causes a little lagg until one of the heal buffs runs out.
-
Mondbrunnen Event
-
Events
-
Unit - A unit Is issued an order targeting an object
-
-
Bedingungen
-
(Unit-type of (Target unit of issued order)) Gleich Mondbrunnen
-
((Ordered unit) has buff Sated ) Gleich False
-
((Owner of (Ordered unit)) is in HeRi_PlayersAllianz) Gleich True
-
-
Aktionen
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Bedingungen
-
HeRi_Mondbrunnen_Index Kleiner als 98
-
-
'THEN'-Aktionen
-
Set HeRi_Mondbrunnen_Index = (HeRi_Mondbrunnen_Index + 1)
-
-
'ELSE'-Aktionen
-
Set HeRi_Mondbrunnen_Index = 1
-
-
-
Set HeRi_Mondbrunnen = (Target unit of issued order)
-
Set HeRi_MondbrunnenHealedUnit[HeRi_Mondbrunnen_Index] = (Ordered unit)
-
Einheit - Set the custom value of (Ordered unit) to HeRi_Mondbrunnen_Index
-
Set HeRi_MondbrunnenPoint = (Position of (Target unit of issued order))
-
Set HeRi_MondbrunnenPoint2 = (Position of HeRi_MondbrunnenHealedUnit[HeRi_Mondbrunnen_Index])
-
Einheitengruppe - Add (Ordered unit) to HeRi_MondbrunnenHealGrp
-
Trigger - Turn on Mondbrunnen Check <gen>
-
Custom script: call RemoveLocation (udg_HeRi_MondbrunnenPoint)
-
Custom script: call RemoveLocation (udg_HeRi_MondbrunnenPoint2)
-
-
-
Mondbrunnen Check
-
Event
-
Zeit - Every 0.03 seconds of game time
-
-
Bedingungen
-
Aktionen
-
Einheitengruppe - Pick every unit in HeRi_MondbrunnenHealGrp and do (Actions)
-
Schleifen - Aktionen
-
Set HeRi_MondbrunnenCV = (Custom value of (Picked unit))
-
Set HeRi_MondbrunnenHealedUnit[HeRi_MondbrunnenCV] = (Picked unit)
-
Set HeRi_MondbrunnenPoint = (Position of HeRi_Mondbrunnen)
-
Set HeRi_MondbrunnenPoint2 = (Position of (Picked unit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Bedingungen
-
(Distance between HeRi_MondbrunnenPoint and HeRi_MondbrunnenPoint2) Kleiner als 500.00
-
-
'THEN'-Aktionen
-
Einheit - Order HeRi_MondbrunnenHealedUnit[HeRi_MondbrunnenCV] to Stop
-
Einheit - Add Replenish Life and Mana (Dummy) to HeRi_Mondbrunnen
-
Einheit - Add Replenish Life and Mana (Debuff) to HeRi_Mondbrunnen
-
Einheit - Order HeRi_Mondbrunnen to Human-Priest - 'Inner Fire' HeRi_MondbrunnenHealedUnit[HeRi_MondbrunnenCV]
-
Einheit - Order HeRi_Mondbrunnen to Nightelf-Warden - 'Shadow Strike' HeRi_MondbrunnenHealedUnit[HeRi_MondbrunnenCV]
-
Einheitengruppe - Remove HeRi_MondbrunnenHealedUnit[HeRi_MondbrunnenCV] from HeRi_MondbrunnenHealGrp
-
Trigger - Turn on Mondbrunnen Heal Loop <gen>
-
Custom script: call RemoveLocation (udg_HeRi_MondbrunnenPoint)
-
Custom script: call RemoveLocation (udg_HeRi_MondbrunnenPoint2)
-
Custom script: call DestroyGroup (udg_HeRi_MondbrunnenHealGrp)
-
Custom script: set udg_HeRi_MondbrunnenHealGrp = CreateGroup ()
-
Trigger - Turn off (This trigger)
-
-
'ELSE'-Aktionen
-
-
-
-
-
-
Mondbrunnen Heal
-
Events
-
Zeit - Every 1.00 seconds of game time
-
-
Bedingungen
-
Aktionen
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Bedingungen
-
(HeRi_MondbrunnenHealedUnit[HeRi_MondbrunnenCV] has buff Replenish Life and Mana (Dummy) ) Gleich True
-
-
'THEN'-Aktionen
-
Set HeRi_MondbrunnenPoint3 = (Position of HeRi_MondbrunnenHealedUnit[HeRi_MondbrunnenCV])
-
Set HeRi_MondbrunnenHeal[HeRi_MondbrunnenCV] = ((Life of HeRi_MondbrunnenHealedUnit[HeRi_MondbrunnenCV]) + (10.00 + (10.00 x (Real((Level of HeRi_MondbrunnenHealedUnit[HeRi_MondbrunnenCV]))))))
-
Einheit - Set life of HeRi_MondbrunnenHealedUnit[HeRi_MondbrunnenCV] to HeRi_MondbrunnenHeal[HeRi_MondbrunnenCV]
-
Schwebender Text - Create floating text that reads (+ + (String((Integer((10.00 + (10.00 x (Real((Level of HeRi_MondbrunnenHealedUnit[HeRi_MondbrunnenCV])))))))))) at HeRi_MondbrunnenPoint3 with Z offset 0.00, using font size 9.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
-
Schwebender Text - Change (Last created floating text): Deaktivieren permanence
-
Schwebender Text - Set the velocity of (Last created floating text) to 40.00 towards 90.00 degrees
-
Schwebender Text - Change the fading age of (Last created floating text) to 1.00 seconds
-
Schwebender Text - Change the lifespan of (Last created floating text) to 2.00 seconds
-
Custom script: call RemoveLocation (udg_HeRi_MondbrunnenPoint3)
-
-
'ELSE'-Aktionen
-
Trigger - Turn off Mondbrunnen Heal Loop <gen>
-
-
-
-
Thank you in advance!
Last edited: