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

Damage unit from unit function?

Status
Not open for further replies.
Level 1
Joined
Feb 24, 2010
Messages
62
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
 
Level 11
Joined
Aug 1, 2009
Messages
963
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.
Top