• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] Any unit takes damage

Status
Not open for further replies.
Level 21
Joined
Aug 21, 2005
Messages
3,699
Registering events require 3 parameters:
1) The trigger you're adding the event to
2) In the case of Unit events: a unit
3) The actual event: in this case EVENT_UNIT_DAMAGE
The result should look like
TriggerRegisterUnitEvent(gg_trg_mytrigger, myunitvar, EVENT_UNIT_DAMAGE)
Thus, you'll need an event for each separate unit entity...
 
Level 6
Joined
Jun 30, 2006
Messages
230
Unfortunately, you cannot detect when ANY unit takes damage, it is unit specific. However, because of handle systems, you can use a call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_ATTACKED), then attach that unit to create another trigger and work from there.
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
its not any unit takes damage
its unit gets attacked
there is no AnyUnitTakesDamage in JASS by default

I have this
Requires this tool

U seem quite new
That tool can help you (shows functions and what they take)
and the system I linked has
TriggerRegisterDamageEvent(<trigger>)
 
Status
Not open for further replies.
Top