• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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