- Joined
- May 11, 2012
- Messages
- 2,108
How to?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
You can use my Lightning system + my Lightning utils...
If you can't, well, you just need a periodic trigger that decreases the lightning's alpha value...
or use the one linked by master above, it's in GUI...
doing periodic from scratch might actually end up like you doing what defskull's GUI Lightning system already does...
also, it's better to just use them as they're already proven to be working good... +you just might suddenly realize that you actually needed the other capabilities of a certain system...
anyway, ultimately it's your call...
Storm Shield Loop

Events


Time - Every 0.05 seconds of game time

Conditions

Actions


Set StormShield_TrigUnitPoint = (Position of StormShield_TrigUnit)


Set StormShield_UnitGroup = (Units within 350.00 of StormShield_TrigUnitPoint)


Unit Group - Pick every unit in StormShield_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 dead) Not equal to True






((Picked unit) belongs to an enemy of (Owner of StormShield_TrigUnit)) Equal to True





Then - Actions






Set StormShield_EnemyUnit = (Picked unit)






Set StormShield_EnemyUnitPoint = (Position of StormShield_EnemyUnit)






Set LH_DurationSet = 0.10






Set LH_LightningNameSet = CLSB






Set LH_UnitSourceSet = StormShield_TrigUnit






Set LH_UnitTargetSet = StormShield_EnemyUnit






Trigger - Run LH Unit2Unit <gen> (ignoring conditions)






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








(Level of Storm Shield for StormShield_TrigUnit) Equal to 1







Then - Actions








Unit - Cause StormShield_TrigUnit to damage StormShield_EnemyUnit, dealing 650.00 damage of attack type Spells and damage type Normal







Else - Actions








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










(Level of Storm Shield for StormShield_TrigUnit) Equal to 2









Then - Actions










Unit - Cause StormShield_TrigUnit to damage StormShield_EnemyUnit, dealing 1550.00 damage of attack type Spells and damage type Normal









Else - Actions






Custom script: call RemoveLocation(udg_StormShield_EnemyUnitPoint)





Else - Actions


Custom script: call RemoveLocation(udg_StormShield_TrigUnitPoint)


Custom script: call DestroyGroup(udg_StormShield_UnitGroup)
((Picked unit) is dead) Not equal to True
Instead of checking if unit is dead, check "is alive"
At this point you should try (Picked Unit) is dead equal to False)) or maybe try using And - conditions in the if-conditions.
Maybe you should add a stop trigger in the Else actions that stops the spell when Number of Units in Group == null/dead.
Hope this helps =)
I've had this problem before... try using Almia's debug log to find the problem or maybe try to remove the condition that's causing the problem and see if it still works.
Or maybe you should also try putting the (Picked Unit) is dead) condition in the main condition part of the trigger below the Event- Every 0.05 seconds...
Set TempUnit = SomeUnit
Set TempBool = false
Custom script: if GetUnitTypeId(udg_TempUnit) != 0 and not IsUnitType(udg_TempUnit, UNIT_TYPE_DEAD) then
Custom script: set udg_TempBool = true
Custom script: endif