- Joined
- May 20, 2009
- Messages
- 822
So, I'm in the process of making a system where you can input whatever variables you want and then give a unit line splash damage more like in StarCraft and StarCraft II then WarCraft IIIs very hard to understand and missnamed line damage.
My problem is, the first time it is used it doesn't work. But after that, it works completely fine. As in, the first time it does not deal damage to any units but the second time I use the unit's ability it works fine. Here are my triggers:
My problem is, the first time it is used it doesn't work. But after that, it works completely fine. As in, the first time it does not deal damage to any units but the second time I use the unit's ability it works fine. Here are my triggers:
-
Lurker Attack
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Ability being cast) Equal to Attack (Lurker)
-
-
Then - Actions
-
Game - Display to (All players) the text: UNIT INDEXED!
-
Set L_MaxIndex = (L_MaxIndex + 1)
-
Set L_Attacker[L_MaxIndex] = (Triggering unit)
-
Set L_SpineDelay[L_MaxIndex] = 0.20
-
Set L_AttackPoint[L_MaxIndex] = (Position of (Target unit of ability being cast))
-
Set L_SpineCount[L_MaxIndex] = 9
-
Set L_SpineDistance[L_MaxIndex] = 70.00
-
Set L_AoEOfSpine[L_MaxIndex] = 80.00
-
Set L_Damage[LA_Integer] = 30.00
-
Set L_FriendlyFire[L_MaxIndex] = False
-
Set L_TargetUnit[L_MaxIndex] = (Target unit of ability being cast)
-
-------- GLOBAL --------
-
Set LA_AttackTimer[L_MaxIndex] = 0.00
-
Trigger - Turn on Lurker Attack Clock <gen>
-
-
Else - Actions
-
-
-
-
Line Attack Clock
-
Events
-
Time - Every 0.01 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer LA_Integer) from 1 to L_MaxIndex, do (Actions)
-
Loop - Actions
-
Set LA_AttackTimer[LA_Integer] = (LA_AttackTimer[LA_Integer] + 0.01)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
LA_AttackTimer[LA_Integer] Equal to L_SpineDelay[LA_Integer]
-
-
Then - Actions
-
Game - Display to (All players) the text: TIMER END!
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
LA_SpineCounter[LA_Integer] Less than L_SpineCount[LA_Integer]
-
-
Then - Actions
-
Set LA_AttackTimer[LA_Integer] = 0.00
-
Set LA_SpineCounter[LA_Integer] = (LA_SpineCounter[LA_Integer] + 1)
-
Set LA_SpineDistance[LA_Integer] = (LA_SpineDistance[LA_Integer] + L_SpineDistance[LA_Integer])
-
Set L_SpineTempPoint[LA_Integer] = ((Position of L_Attacker[LA_Integer]) offset by LA_SpineDistance[LA_Integer] towards (Angle from (Position of L_Attacker[LA_Integer]) to L_AttackPoint[LA_Integer]) degrees)
-
Game - Display to (All players) the text: POINT GRABBED!
-
Unit Group - Pick every unit in (Units within L_AoEOfSpine[LA_Integer] of L_SpineTempPoint[LA_Integer]) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
L_FriendlyFire[LA_Integer] Equal to True
-
-
Then - Actions
-
Unit - Cause L_Attacker[LA_Integer] to damage (Picked unit), dealing L_Damage[LA_Integer] damage of attack type Normal and damage type Normal
-
Game - Display to (All players) the text: DAMAGE DEALT!
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
L_FriendlyFire[LA_Integer] Equal to False
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
((Picked unit) belongs to an enemy of (Owner of L_Attacker[LA_Integer])) Equal to True
-
(Picked unit) Equal to L_TargetUnit[LA_Integer]
-
-
-
-
Then - Actions
-
Unit - Cause L_Attacker[LA_Integer] to damage (Picked unit), dealing L_Damage[LA_Integer] damage of attack type Normal and damage type Normal
-
Game - Display to (All players) the text: DAMAGE DEALT!
-
-
Else - Actions
-
-
-
Else - Actions
-
-
-
-
-
-
Unit - Create 1 Lurker Attack Spine for (Owner of L_Attacker[LA_Integer]) at L_SpineTempPoint[LA_Integer] facing (Angle from L_AttackPoint[LA_Integer] to (Position of L_Attacker[LA_Integer])) degrees
-
Game - Display to (All players) the text: SPINE CREATED!
-
Custom script: call RemoveLocation (udg_L_SpineTempPoint[udg_LA_Integer])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
LA_SpineCounter[LA_Integer] Equal to L_SpineCount[LA_Integer]
-
-
Then - Actions
-
-------- LOCALS --------
-
Set LA_SpineCounter[LA_Integer] = 0
-
Set LA_SpineDistance[LA_Integer] = 0.00
-
-------- GLOBALS --------
-
Set L_Attacker[LA_Integer] = No unit
-
Set L_Attacker[LA_Integer] = L_Attacker[L_MaxIndex]
-
Set L_TargetUnit[LA_Integer] = No unit
-
Set L_TargetUnit[LA_Integer] = L_Attacker[L_MaxIndex]
-
Set L_SpineDelay[LA_Integer] = 0.00
-
Set L_SpineDelay[LA_Integer] = L_SpineDelay[L_MaxIndex]
-
Set L_AoEOfSpine[LA_Integer] = 0.00
-
Set L_AoEOfSpine[L_MaxIndex] = L_SpineDelay[L_MaxIndex]
-
Custom script: call RemoveLocation (udg_L_AttackPoint[udg_LA_Integer])
-
Set L_AttackPoint[LA_Integer] = L_AttackPoint[L_MaxIndex]
-
Set L_SpineCount[LA_Integer] = 0
-
Set L_SpineCount[LA_Integer] = LA_SpineCounter[L_MaxIndex]
-
Set L_SpineDistance[LA_Integer] = 0.00
-
Set L_SpineDistance[LA_Integer] = L_SpineDistance[L_MaxIndex]
-
Set L_Damage[LA_Integer] = 0.00
-
Set L_Damage[LA_Integer] = L_Damage[L_MaxIndex]
-
Set L_FriendlyFire[LA_Integer] = False
-
Set L_FriendlyFire[LA_Integer] = L_FriendlyFire[L_MaxIndex]
-
Set L_MaxIndex = (L_MaxIndex - 1)
-
Game - Display to (All players) the text: CLEAN UP FINISHED!
-
-
Else - Actions
-
-
-
Else - Actions
-
-
-
Else - Actions
-
-
-
-
-