# Damaging Problem {damage units over time if they are in range}

Status
Not open for further replies.

#### GangSpear

Level 13
How can i damage a unit 1 time with every 0.03 second and it always near the dummy,won't be damaged again?
Set the Damage type or?
+REP

#### Kino

Level 24
Everytime your dummy inflicts damage, add the struck unit to a group.

Get a condition that ignores units in that said group from being damaged.

#### GangSpear

Level 13
Hmm,can you give me an example?

#### Bannar

Level 26
Try this:
• loop
• Events
• Time - Every 0.03 seconds of game time
• Conditions
• Actions
• Set tempp1 = (Position of yourunit1)
• Set tempp2 = (Position of yourunit2)
• If (All conditions are true) then do (Then actions) else do (Else actions)
• If - Conditions
• ((Distance between tempp1 and tempp2) Less than 500)
• Then - Actions
• Unit Group - Add yourunit2 to PreventGroup
• Else - Actions
• Unit Group - remove yourunit2 from PreventGroup
• If (All conditions are true) then do (Then actions) else do (Else actions)
• If - Conditions
• (yourunit2 is in PreventGroup) Equal to False
• Then - Actions
• Unit - Order Yourunit1 to damage (Picked unit) dealing DAMAGE damage of attack type Magic and damage type Normal
• Else - Actions
EDIT Editied trigger, since at first it wasn't excatly what you wanted.

#### Kino

Level 24
Like what?

Just add the damaged unit (picked unit etc.) to a Unit Group, Eg. Damaged_Group

Then just use a condition to ignore the units in Damaged_Group.

Lastly clear the group at the end of the ability or whenever you need to reset it.

#### GangSpear

Level 13
Sorry,i have 2 unit group,first unit group is picked unit of enemies,if i use 2 group,cause bug?
• Unit Group - Pick every unit in TS_Group and do (Actions)
• Loop - Actions
• Set TS_PickedUnit = (Picked unit)
• Set TS_PickedUnitPoint = (Position of TS_PickedUnit)
• Set TS_PickedUnitOffPoint = (TS_PickedUnitPoint offset by -30.00 towards (Facing of TS_PickedUnit) degrees)
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• ((Picked unit) is alive) Equal to True
• (TS_PickedUnit is in TS_Group) Not equal to True
• Then - Actions
• Unit Group - Add TS_PickedUnit to TS_Group2
• Unit - Move TS_PickedUnit instantly to TS_PickedUnitOffPoint, facing TS_Point2
• Unit - Cause TS_Dummy[TS_IndexLoop] to damage TS_PickedUnit, dealing 250.00 damage of attack type Spells and damage type Death
• Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
• Special Effect - Destroy (Last created special effect)
• Else - Actions
• Custom script: call RemoveLocation(udg_TS_PickedUnitPoint)
• Custom script: call RemoveLocation(udg_TS_PickedUnitOffPoint)
Just like tat

#### GangSpear

Level 13
Does the unit group will leaks?
EDIT: Doesn't work
• Unit Group - Pick every unit in TS_Group and do (Actions)
• Loop - Actions
• Set TS_Point4 = (Position of TS_Dummy[TS_IndexLoop])
• Set TS_PickedUnit = (Picked unit)
• Set TS_PickedUnitPoint = (Position of TS_PickedUnit)
• Set TS_PickedUnitOffPoint = (TS_PickedUnitPoint offset by -30.00 towards (Facing of TS_PickedUnit) degrees)
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• ((Picked unit) is alive) Equal to True
• Then - Actions
• Unit - Move TS_PickedUnit instantly to TS_PickedUnitOffPoint, facing TS_Point2
• Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
• Special Effect - Destroy (Last created special effect)
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• (Distance between TS_PickedUnitPoint and TS_Point4) Less than or equal to 200.00
• Then - Actions
• Unit Group - Add TS_PickedUnit to TS_Group2
• Else - Actions
• Unit Group - Remove TS_PickedUnit from TS_Group2
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• (TS_PickedUnit is in TS_Group2) Equal to False
• Then - Actions
• Unit - Cause TS_Dummy[TS_IndexLoop] to damage TS_PickedUnit, dealing 250.00 damage of attack type Spells and damage type Normal
• Else - Actions
• Else - Actions
• Custom script: call RemoveLocation(udg_TS_PickedUnitPoint)
• Custom script: call RemoveLocation(udg_TS_PickedUnitOffPoint)
• Custom script: call RemoveLocation(udg_TS_Point4)

#### Bannar

Level 26
Post map, sory i'm going out soon dont have time to explain everything.
No group wont leak since you are using it for looping - its being used.

Level 13

#### Bannar

Level 26
Your trigger leaks, and you got a lot of unneed actions. I used only half of variables you have created for making this spell work properly. Although I wasn't changing the purpose of spell I think you should change the knockback and target selection for more realistic effect and other miscellaneous stuff.
Better use expiration timers than exploding unit, trust me.

Here is your test map. I haven't removed non-used variables from variable editor, so you can see what I have done to replace them.

This indexing system is old, and inefficient - you should learn dynamic indexing/use hashtables/unit indexer. However, used that indexing to not make you confused with your own spell.

#### Attachments

• Tauren smash.w3x
21.8 KB · Views: 26
Status
Not open for further replies.

Replies
13
Views
533
Replies
5
Views
3K
Replies
2
Views
633
Replies
2
Views
3K
Replies
2
Views
845