• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Damage unit from unit function?

Status
Not open for further replies.
You're probably looking for this function:

  • Environment - Execute Diamondback - Eviscerator (Beam) on Zergling [66.17, 80.21] from Hercules (Lander, Flying) [26.00, 13.50]
This will create an effect (in your case, a damaging effect; here: 'Diamondback - Eviscerator (Beam)) from a unit (the Hercules here) to a unit (the Zergling). There is, however, a small catch. The effects are made in the data-editor, so the damage done is a set amount of number.
This catch can be overridden by using the catalog functions, but I still need to take a look at those. :3
 
Okay, a basic quick tutorial:

1. create a damage effect called Damage.

Then, create an action definition roughly along the lines of this one:

  • DamageUnit
    • Options: Action
    • Return Type: (None)
    • Parameters
      • damage = 0 <Integer>
      • target = No Unit <Unit>
      • source = No Unit <Unit>
    • Grammar Text: Deal amount damage on target from source.
    • Hint Text: (None)
    • Custom Script Code
    • Local Variables
    • Actions
      • Catalog - Set value of Effects "Damage" "Amount" for player Any Player to (String(damage))
      • Environment - Execute Damage on target from source
This allows you to deal any amount of damage to a unit from any unit. :O
 
Status
Not open for further replies.
Back
Top