- Joined
- May 16, 2020
- Messages
- 660
Hi all,
I'm trying to create a projectile which deals damage 1x to enemies it passes through.
The basic idea is:
1) Unit Group: Pick every enemy within 100 of the projectile
2) IF: Picked unit is not in Group A (= my group of already damaged units)
3) THEN: Add Picked unit to Group A and cause damage etc...
This trigger does not work however, the enemies always get hit 2x. Attached an image of the trigger.
How can I fix this?
Activator:
Trigger which doesn't work correctly:
***
BTW: This guys had the same problem, but I don't understand how he solved it:
Unit Group - Add Unit
I'm trying to create a projectile which deals damage 1x to enemies it passes through.
The basic idea is:
1) Unit Group: Pick every enemy within 100 of the projectile
2) IF: Picked unit is not in Group A (= my group of already damaged units)
3) THEN: Add Picked unit to Group A and cause damage etc...
This trigger does not work however, the enemies always get hit 2x. Attached an image of the trigger.
How can I fix this?
Activator:
-
Deadly Throw
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Deadly Throw
-
Actions
- Set VariableSet DT_Counts = (DT_Counts + 1)
- Set VariableSet DT_CountMaxSize = 8191
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- DT_Counts Greater than DT_CountMaxSize
-
Then - Actions
- Set VariableSet DT_Counts = 1
- Else - Actions
-
If - Conditions
- Set VariableSet DT_Caster[DT_Counts] = (Casting unit)
- Set VariableSet DT_CasterLoc = (Position of DT_Caster[DT_Counts])
- Set VariableSet DT_TargetPoint = (Target point of ability being cast)
- Set VariableSet DT_Angle = (Angle from DT_CasterLoc to DT_TargetPoint)
- Unit - Create 1 Deadly Throw Projectile for (Owner of DT_Caster[DT_Counts]) at DT_CasterLoc facing DT_Angle degrees
- Unit - Set the custom value of (Last created unit) to DT_Counts
- Unit Group - Add (Last created unit) to DT_StartGroup
- Set VariableSet DT_Distance[DT_Counts] = 1100.00
- Set VariableSet DT_DistanceTravel[DT_Counts] = 0.00
- Set VariableSet DT_StunDuration[DT_Counts] = 1
- Set VariableSet DT_DistanceCount[DT_Counts] = 0.00
- Trigger - Turn on Deadly Throw Projectile <gen>
- Custom script: call RemoveLocation (udg_DT_CasterLoc)
- Custom script: call RemoveLocation (udg_DT_TargetPoint)
-
Events
Trigger which doesn't work correctly:
-
Deadly Throw Projectile
-
Events
- Time - Every 0.03 seconds of game time
- Conditions
-
Actions
-
Unit Group - Pick every unit in DT_StartGroup and do (Actions)
-
Loop - Actions
- Set VariableSet DT_CusValue = (Custom value of (Picked unit))
- Set VariableSet DT_DummyLoc = (Position of (Picked unit))
- Set VariableSet DT_Movement = (DT_DummyLoc offset by 50.00 towards (Facing of (Picked unit)) degrees.)
- Unit - Move (Picked unit) instantly to DT_Movement
- Set VariableSet DT_DistanceTravel[DT_CusValue] = (DT_DistanceTravel[DT_CusValue] + 45.00)
- Set VariableSet DT_DistanceCount[DT_CusValue] = (DT_DistanceCount[DT_CusValue] + 45.00)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- DT_DistanceCount[DT_CusValue] Greater than or equal to 100.00
-
Then - Actions
- Set VariableSet DT_StunDuration[DT_CusValue] = (DT_StunDuration[DT_CusValue] + 1)
- Set VariableSet DT_DistanceCount[DT_CusValue] = 0.00
- Else - Actions
-
If - Conditions
- Destructible - Pick every destructible within 100.00 of DT_Movement and do (Destructible - Kill (Picked destructible))
- Set VariableSet DT_UnitGroup = (Units within 75.00 of DT_Movement.)
-
Unit Group - Pick every unit in DT_UnitGroup and do (Actions)
-
Loop - Actions
- Set VariableSet DT_TempUnit = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (DT_TempUnit is A structure) Equal to False
- (DT_TempUnit is alive) Equal to True
- (DT_TempUnit belongs to an enemy of (Owner of DT_Caster[DT_CusValue]).) Equal to True
- (DT_TempUnit has buff Slow (Deadly Throw)) Equal to False
- (DT_TempUnit is in DT_Damaged.) Equal to False
-
Then - Actions
- Unit Group - Add (Picked unit) to DT_Damaged
- Unit - Cause DT_Caster[DT_CusValue] to damage (Picked unit), dealing 25.00 damage of attack type Hero and damage type Normal
- Unit - Create 1 Universal Dummy for (Owner of DT_Caster[DT_CusValue]) at DT_Movement facing Default building facing degrees
- Set VariableSet DT_Dummy = (Last created unit)
- Unit - Add Deadly Throw Slow to DT_Dummy
- Unit - Order DT_Dummy to Human Sorceress - Slow (Picked unit)
- Unit - Add a 1.00 second Generic expiration timer to DT_Dummy
- Else - Actions
-
If - Conditions
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
- DT_DistanceTravel[DT_CusValue] Greater than or equal to DT_Distance[DT_CusValue]
-
Conditions
-
Or - Any (Conditions) are true
-
Then - Actions
- Unit - Kill (Picked unit)
- Unit Group - Remove (Picked unit) from DT_StartGroup.
- Else - Actions
-
If - Conditions
- Custom script: call RemoveLocation (udg_DT_DummyLoc)
- Custom script: call RemoveLocation (udg_DT_Movement)
- Custom script: call DestroyGroup (udg_DT_UnitGroup)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in DT_StartGroup) Equal to 0
-
Then - Actions
- Unit - Remove Combos 1 from DT_Caster[DT_CusValue]
- Unit - Remove Combos 2 from DT_Caster[DT_CusValue]
- Unit - Remove Combos 3 from DT_Caster[DT_CusValue]
- Unit - Remove Combos 4 from DT_Caster[DT_CusValue]
- Unit - Remove Combos 5 from DT_Caster[DT_CusValue]
- Custom script: call DestroyGroup(udg_DT_Damaged)
- Set VariableSet ComboPointCounter = 0
- Trigger - Turn off (This trigger)
- Else - Actions
-
If - Conditions
-
Unit Group - Pick every unit in DT_StartGroup and do (Actions)
-
Events
***
BTW: This guys had the same problem, but I don't understand how he solved it:
Unit Group - Add Unit
Attachments
Last edited: