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!
Please teach me how to use them. I don't get the idea how to implement them. I need example though. Very blur where to find them please help me... THANK YOU ><
But it depends, are you familiar with vJass? If not, I recommend you use Bribe's Damage Engine instead, and read the documentation on how to implement it. You can also use Weep's, but his doesn't have the feature of damage modification yet. (I'm pretty sure he has a version that does, but I don't think he released it yet)
If you are familiar with vJass, then simply import UnitIndexer (don't forget to import the ability, you can use the non-lua version for simpler importing) as well as the Event trigger. Then import DamageEvent.
To use it, you basically use this function to register any damage:
JASS:
call DamageEvent.ANY.register( Filter( function MyFunctionName ) )
Whenever damage occurs, it will fire the function within the parentheses. You can replace "MyFunctionName" with whatever function you want to fire.
For example:
JASS:
function DamageEventFunction takes nothing returns boolean
// i don't remember if it is necessary to return boolean, i forgot
// i'm just doing it just in case
return false
endfunction
function InitTrig_DamageEventTrigger takes nothing returns nothing
call DamageEvent.ANY.register( Filter( function DamageEventFunction ) )
endfunction
Then you can access the members of the struct as the trigger data:
Source - Unit who deals the damage. Use: DamageEvent.source
Target - Unit who takes the damage. Use: DamageEvent.target
Amount - Amount of damage dealt. Use: DamageEvent.amount
There are two others, but those are just the user id's of the source/target.
For example, this would display the amount of damage dealt, and then it would kill both units.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.