• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Dummy collision detection?

Status
Not open for further replies.
Level 11
Joined
Jun 26, 2014
Messages
500
So lets say I have made a dummy which travels forward via triggers. In the way there is an enemy unit. I want to make it so that when my dummy collides/touches the enemy unit, the dummy dies and deals damage to the enemy unit just like a missile.

Basically I want to create a skill shot ability using a dummy(unit) for my missile. But how do I do it?
 
Last edited:
I'm guessing you know how to make the missile move. If you don't, then feel free to ask.

In your periodic trigger for the missile movement, pick all enemy units in range of the dummy with a really short range (e.g. 50. Use the Unit Group - Pick every... function for this). If there are any units in that group, destroy the dummy, deal damage, and end the spell.
 
Level 11
Joined
Jun 26, 2014
Messages
500
I'm guessing you know how to make the missile move. If you don't, then feel free to ask.

In your periodic trigger for the missile movement, pick all enemy units in range of the dummy with a really short range (e.g. 50. Use the Unit Group - Pick every... function for this). If there are any units in that group, destroy the dummy, deal damage, and end the spell.

So it should be something like:
every 0.03 seconds
set temp_pos - dummy position
unit group - pick every unit in 50 range of temp_pos
deal damage to picked unit? Is that right... am I doing something wrong?
 
Last edited:
Level 17
Joined
Dec 11, 2014
Messages
2,004
  • Example
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set Temp_Point = (Position of Dummy)
      • Set Temp_UG = (Units within 50.00 of Temp_Point)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Temp_UG) Greater than 0
        • Then - Actions
          • Unit - Cause Dummy to damage circular area after 0.00 seconds of radius 500.00 at Temp_Point, dealing 100.00 damage of attack type Spells and damage type Fire
          • Unit - Kill Dummy
          • Custom script: set udg_Dummy = null
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Temp_Point)
      • Custom script: call DestroyGroup(udg_Temp_UG)

However Dummy must be an array variable, which isn't Included here.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
-_- you guys really forget there is the caster who is at the location of the dummy when it is created???

Dont do the check for number of units.
Just loop through all units.
Then make an If/Then/Else inside that loop and check if picked unit is an enemy of the caster.
If so, then deal the damage and remove the dummy.
 
Status
Not open for further replies.
Top