Hello folks,
i am developing a map here on Hive and now i am at a point where i need help fixing my current spell i am working on. It leaks/laggs heavy and i would be pleased if someone could take a look and help me pointing out the obvious stuff that could be responsible for that. I tried myself some custom scripts to reduce leaks but it will not work somehow, i am obviously doing it wrong and need someone who can tell me how to do it properly. Help is greatly appreciated!
The spell in general picks every 0.25 seconds all nearby enemy units in range of a specific unit and adds them to a unit group, the picked units get damage and a lightning effect is created and afterwards destroyed. When a timer expires the specific unit is moved away and the spell ends.
Casting the ability:
I need some help fixing my leak/lagg problem with this spell. Thank you very much, i hope i can learn from it and fix my other spells too!
greetings
Ahne
i am developing a map here on Hive and now i am at a point where i need help fixing my current spell i am working on. It leaks/laggs heavy and i would be pleased if someone could take a look and help me pointing out the obvious stuff that could be responsible for that. I tried myself some custom scripts to reduce leaks but it will not work somehow, i am obviously doing it wrong and need someone who can tell me how to do it properly. Help is greatly appreciated!
The spell in general picks every 0.25 seconds all nearby enemy units in range of a specific unit and adds them to a unit group, the picked units get damage and a lightning effect is created and afterwards destroyed. When a timer expires the specific unit is moved away and the spell ends.
Casting the ability:
-
Ball Lightning
-
Events
-
Unit - A unit Begins casting an ability
-
-
Conditions
-
(Ability being cast) Equal to |cffFFC53ABall Lightning
-
-
Actions
-
Animation - Change Dummy CASTER combat Ball Lightning also effect 0111 <gen>'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
-
Unit - Change ownership of Dummy CASTER combat Ball Lightning also effect 0111 <gen> to (Owner of HeroPickedUnit[10]) and Retain color
-
Unit - Move Dummy CASTER combat Ball Lightning also effect 0111 <gen> instantly to (Position of HeroPickedUnit[10]), facing (Target point of ability being cast)
-
Wait 0.20 seconds
-
Unit - Order Dummy CASTER combat Ball Lightning also effect 0111 <gen> to Move To (Target point of ability being cast)
-
Countdown Timer - Start Timer_Ball_Lightning as a One-shot timer that will expire in 5.00 seconds
-
Unit Group - Remove all units from ball_unit_group_first
-
Unit Group - Remove all units from ball_lightning_unitgroup
-
Set ball_lightning_effect_counter = 0
-
Trigger - Turn on ball lightning periodic pick <gen>
-
-
-
[Trigger/]
-
-------
-
-------
-
Timer/ability ends when:
-
-------
-
-------
-
[Trigger]timer endss
-
Events
-
Time - Timer_Ball_Lightning expires
-
-
Conditions
-
Actions
-
Animation - Change Dummy CASTER combat Ball Lightning also effect 0111 <gen>'s vertex coloring to (100.00%, 100.00%, 100.00%) with 80.00% transparency
-
Wait 0.15 seconds
-
Animation - Change Dummy CASTER combat Ball Lightning also effect 0111 <gen>'s vertex coloring to (100.00%, 100.00%, 100.00%) with 60.00% transparency
-
Wait 0.15 seconds
-
Animation - Change Dummy CASTER combat Ball Lightning also effect 0111 <gen>'s vertex coloring to (100.00%, 100.00%, 100.00%) with 40.00% transparency
-
Wait 0.15 seconds
-
Animation - Change Dummy CASTER combat Ball Lightning also effect 0111 <gen>'s vertex coloring to (100.00%, 100.00%, 100.00%) with 20.00% transparency
-
Trigger - Turn off ball lightning periodic pick <gen>
-
Wait 0.15 seconds
-
Animation - Change Dummy CASTER combat Ball Lightning also effect 0111 <gen>'s vertex coloring to (100.00%, 100.00%, 100.00%) with 10.00% transparency
-
Wait 0.15 seconds
-
Unit - Move Dummy CASTER combat Ball Lightning also effect 0111 <gen> instantly to (Center of ball lightning resting place <gen>)
-
Unit Group - Remove all units from ball_lightning_unitgroup
-
For each (Integer ball_lightning_FOR) from 1 to ball_lightning_effect_counter, do (Actions)
-
Loop - Actions
-
Lightning - Destroy ball_lightning_effects[ball_lightning_FOR]
-
-
-
-
-
[Trigger/]
-
--------
-
--------
-
Periodic stuff done while ability timer is running:
-
--------
-
--------
-
[Trigger]ball lightning periodic pick
-
Events
-
Time - Every 0.25 seconds of game time
-
-
Conditions
-
Actions
-
Unit Group - Pick every unit in (Units within 250.00 of (Position of Dummy CASTER combat Ball Lightning also effect 0111 <gen>)) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is A structure) Equal to False
-
((Picked unit) is alive) Equal to True
-
((Picked unit) belongs to an enemy of (Owner of HeroPickedUnit[10])) Equal to True
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of |cffFFC53ABall Lightning for HeroPickedUnit[10]) Equal to 1
-
-
Then - Actions
-
Unit Group - Add (Picked unit) to ball_lightning_unitgroup
-
Unit - Cause HeroPickedUnit[10] to damage (Picked unit), dealing 15.00 damage of attack type Hero and damage type Normal
-
Floating Text - Create floating text that reads (15 + <Empty String>) above (Picked unit) with Z offset (Random real number between 0.00 and 20.00), using font size 10.00, color (100.00%, 0.00%, 0.00%), and 50.00% transparency
-
Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
-
Floating Text - Change (Last created floating text): Disable permanence
-
Floating Text - Change the fading age of (Last created floating text) to 0.50 seconds
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of |cffFFC53ABall Lightning for HeroPickedUnit[10]) Equal to 2
-
-
Then - Actions
-
Unit Group - Add (Picked unit) to ball_lightning_unitgroup
-
Unit - Cause HeroPickedUnit[10] to damage (Picked unit), dealing 20.00 damage of attack type Hero and damage type Normal
-
Floating Text - Create floating text that reads (20 + <Empty String>) above (Picked unit) with Z offset (Random real number between 0.00 and 20.00), using font size 10.00, color (100.00%, 0.00%, 0.00%), and 50.00% transparency
-
Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
-
Floating Text - Change (Last created floating text): Disable permanence
-
Floating Text - Change the fading age of (Last created floating text) to 0.50 seconds
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of |cffFFC53ABall Lightning for HeroPickedUnit[10]) Equal to 3
-
-
Then - Actions
-
Unit Group - Add (Picked unit) to ball_lightning_unitgroup
-
Unit - Cause HeroPickedUnit[10] to damage (Picked unit), dealing 25.00 damage of attack type Hero and damage type Normal
-
Floating Text - Create floating text that reads (25 + <Empty String>) above (Picked unit) with Z offset (Random real number between 0.00 and 20.00), using font size 10.00, color (100.00%, 0.00%, 0.00%), and 50.00% transparency
-
Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
-
Floating Text - Change (Last created floating text): Disable permanence
-
Floating Text - Change the fading age of (Last created floating text) to 0.50 seconds
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of |cffFFC53ABall Lightning for HeroPickedUnit[10]) Equal to 4
-
-
Then - Actions
-
Unit Group - Add (Picked unit) to ball_lightning_unitgroup
-
Unit - Cause HeroPickedUnit[10] to damage (Picked unit), dealing 30.00 damage of attack type Hero and damage type Normal
-
Floating Text - Create floating text that reads (25 + <Empty String>) above (Picked unit) with Z offset (Random real number between 0.00 and 20.00), using font size 10.00, color (100.00%, 0.00%, 0.00%), and 50.00% transparency
-
Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
-
Floating Text - Change (Last created floating text): Disable permanence
-
Floating Text - Change the fading age of (Last created floating text) to 0.50 seconds
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of |cffFFC53ABall Lightning for HeroPickedUnit[10]) Equal to 5
-
-
Then - Actions
-
Unit Group - Add (Picked unit) to ball_lightning_unitgroup
-
Unit - Cause HeroPickedUnit[10] to damage (Picked unit), dealing 35.00 damage of attack type Hero and damage type Normal
-
Floating Text - Create floating text that reads (35 + <Empty String>) above (Picked unit) with Z offset (Random real number between 0.00 and 20.00), using font size 10.00, color (100.00%, 0.00%, 0.00%), and 50.00% transparency
-
Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
-
Floating Text - Change (Last created floating text): Disable permanence
-
Floating Text - Change the fading age of (Last created floating text) to 0.50 seconds
-
-
Else - Actions
-
Do nothing
-
-
-
-
-
-
-
-
-
-
-
-
Else - Actions
-
Do nothing
-
-
-
-
-
Set ball_unit_group_first = (Last created unit group)
-
Custom script: call DestroyGroup(udg_ball_unit_group_first)
-
Unit Group - Pick every unit in ball_lightning_unitgroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is A structure) Equal to False
-
((Picked unit) is alive) Equal to True
-
((Picked unit) belongs to an enemy of (Owner of HeroPickedUnit[10])) Equal to True
-
-
Then - Actions
-
Set ball_lightning_effect_counter = (ball_lightning_effect_counter + 1)
-
Lightning - Create a Chain Lightning - Secondary lightning effect from source (Position of Dummy CASTER combat Ball Lightning also effect 0111 <gen>) to target (Position of (Picked unit))
-
Set ball_lightning_effects[(ball_lightning_effect_counter + 1)] = (Last created lightning effect)
-
Set tem_pos_bal_lightning_pickunit = (Position of (Picked unit))
-
Custom script: call RemoveLocation(udg_tem_pos_bal_lightning_pickunit)
-
Unit Group - Remove (Picked unit) from ball_lightning_unitgroup
-
-
Else - Actions
-
Do nothing
-
-
-
-
-
Set tempUnitGroup_ball_lightning = (Last created unit group)
-
Wait 0.15 seconds
-
For each (Integer ball_lightning_FOR) from 1 to ball_lightning_effect_counter, do (Actions)
-
Loop - Actions
-
Lightning - Destroy ball_lightning_effects[ball_lightning_FOR]
-
-
-
Custom script: call DestroyGroup(udg_tempUnitGroup_ball_lightning)
-
-
I need some help fixing my leak/lagg problem with this spell. Thank you very much, i hope i can learn from it and fix my other spells too!
greetings
Ahne
Last edited: