• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

hit then only damage

Status
Not open for further replies.
Level 3
Joined
Mar 26, 2011
Messages
16
hey guys my name is jason :grin::grin::grin: soo.... i was telling that how to damage a target only.. only when he is hit by the spell example...... like the hellfire lazer how can i make that unit get damaged onlyyy when he gets hit by the custom spell or something i will give that persons name in the credits of my new map if that post is good urr::ogre_hurrhurr::ogre_hurrhurr::ogre_hurrhurr::ogre_hurrhurr::ogre_hurrhurr::eek:gre_hurr* not to those whose comments are not helpful :ogre_rage::ogre_rage::ogre_rage::ogre_rage::ogre_rage::ogre_rage::thumbs_down:
 
Last edited:
Level 28
Joined
Jan 26, 2007
Messages
4,789
How about YOU explain it nicely?

how to damage a target only.. only when he is hit by the spell example...... like the hellfire lazer how can i make that unit get damaged onlyyy when he gets hit by the custom spell or something
What can we derive from this?

1) You want to deal damage to a unit.
2) Hellfire laser? What the hell is that?
3) A custom spell uses triggers, so you'll have to damage the target with triggers.
4) That sentence is incomprehensible.

We can't help if we do not understand the problem.
You're talking gibberish and suddenly start saying something about a 'Hellfire laser', of which I'm pretty sure I'm not the only one who doesn't know it.
Take your time while writing, it's better that I need to read a lot than translate a single sentence of rubbish to understandable English.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Aha! That's better.

In GUI, it's something like this:

  • Actions
    • Set Loc1 = (Position of {Projectile})
    • Set Loc2 = (Position of {Target})
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Distance between Loc1 and Loc2) Less than or equal to {Projectile Speed}
      • Then - Actions
        • -------- Deal Damage --------
      • Else - Actions
        • -------- Move Projectile --------
    • Custom script: call RemoveLocation(udg_Loc1)
    • Custom script: call RemoveLocation(udg_Loc2)
Everything between {} is spell-specific (well, kind of...).
You just check the distance between the two units and if it's less than or equal to the projectile speed (if it's smaller, that means the next tick it will go PAST the target - we don't want that), we deal damage.
Rather self-explanatory.
 
Last edited:
Status
Not open for further replies.
Top