• 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.

a simple question

Status
Not open for further replies.
Level 12
Joined
Mar 24, 2011
Messages
1,082
If its a spell "Unit - A unit Starts the effect of an ability" should work just fine

But if you want it to work on basic atack or whenever a unit is damaged somehow you should use a damage detection system.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Just do the classic technique, trigger the ability from scratch, with Dummy Units being the projectile of the missile.
And when it is near enough, kill the dummy unit and damage the unit.

Although there is a simpler way, using Speed = Distance / Time method, BUT, this will only work if the target source is not moving at all, therefore you can have a constant time.
 
Level 9
Joined
Aug 7, 2009
Messages
380
Although there is a simpler way, using Speed = Distance / Time method, BUT, this will only work if the target source is not moving at all, therefore you can have a constant time.
That would be simpler but not "Simplest" :ogre_love:. Here i have one [the simplest]:
I'm going to base the example from the DotA spell: Impetus of Enchantess
Which just need an ability has a buff on impact [Here i call Impetus (from DotA). Auto cast would even better
And some trigger skills, combined with damage detection system


Upon receiving damage of a unit, check if it has a buff Impetus, then we'll do the damage job. For example you can have this:
  • UnitTakeDamage
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
    • Actions
      • -------- ---------------------- --------
      • Set TempUnit = GDD_DamagedUnit
      • Set TempUnit2 = GDD_DamageSource
      • Set TempReal = GDD_Damage
      • -------- Impetus --------
      • Set TempInt = (Level of Impetus for TempUnit2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempInt Greater than 0
          • (TempUnit has buff Impetus ) Equal to True
        • Then - Actions
          • Unit - Remove Impetus buff from TempUnit
          • Set TempLoc = (Position of TempUnit2)
          • Set TempLoc2 = (Position of TempUnit)
          • Set TempReal = ((Distance between TempLoc and TempLoc2) x (0.04 x (Real(TempInt))))
          • Unit - Cause TempUnit2 to damage TempUnit, dealing TempReal damage of attack type Chaos and damage type Universal
        • Else - Actions
      • -------- ---------------------- --------
There you go, an auto cast, cool distance-damage and impact checking is done. In case you didn't get it, I'll attach you a demo map, but this one won't use the Damage Detection System i gave so all variables about "GDD_" wouldn't useful anymore. Goodluck
View attachment [Demo]AutoCast.w3x
Caution: There're leaks inside. Destroy those TempLoc and TempLoc2 :p

Hope it's helpful to you as everyone else
P/S: Congratulate on Zephyr's 1st place defskull :p (forgot to)
 
Status
Not open for further replies.
Top