• 🏆 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!

UnitDamageUnit function missing ?

Status
Not open for further replies.
Level 2
Joined
Apr 30, 2010
Messages
14
Don't tell me that there is no equivalent for the function UnitDamageTarget...

The only possibilty I currently see is modifying a unit's damage and adding a weapon, but that would be incredibly stupid if there was no such function. How could I dynamically deal damage to other units? I can't create effects for every possibilty.

I searched all Unit action functions. The overall editor-search-function doesn't seem to work.

And for all those german people that are desperatly searching the " timer " variable: It is called "Zeitschalter" ... stupid translations. :D
 
Level 2
Joined
Aug 2, 2010
Messages
17
Create a damage effect in the data editor and use catalog funcs to change the damage amount and the create effect funcs to apply the effect to units that you want to damage.
 
Level 2
Joined
Apr 30, 2010
Messages
14
Wow that's a powerful function. Thanks I didn't know it existed. +rep

But I'm confused about the player-parameter part. Could it be unsafe to set it for one player only and then deal damage with this effect? Do I need to use the preset "c_playerAny" or do I need to loop through every player and set it?

And: Am I right that there is no hasing function for objects like units? No GetHandleId ? :(
How do you make your good old MUI spells? How do you index the arrays/record-structs/data tables)? I don't want to rely on the data editor only.
 
Level 2
Joined
Aug 2, 2010
Messages
17
You just need to change the damage value for the player that's dealing the damage. Catalog funcs that set fields basically do what upgrades do; there's no danger in only one player having an ugprade, so there's no danger here either.

Unfortunately, there's no hashing function for units. Hopefully blizz will add one in a later patch, but that may not happen.

However, one way to do MUI is to take advantage of unit custom values. You can store fixed values (and there are multiple indices, so more than one system can use custom values), so you can either directly store numerical data or store the index of some global array or something where you have that unit's data.
 
Status
Not open for further replies.
Top