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

Unit Takes Damage

Status
Not open for further replies.
Level 4
Joined
Mar 6, 2008
Messages
72
Is there any way that I can get this event in the Generic Unit event instead of Specific Unit event?
 
Level 18
Joined
Mar 13, 2009
Messages
1,411
I kinda have the feeling that he will need it for more events as just being attacked HaniBon...

I have heard people talk about damage detection systems, but I never used those so I don't know D:
 
Level 11
Joined
May 16, 2007
Messages
288
No, that's not the problem, the problem is that with the "A unit is attacked" event, the event is registered when the unit starts the attack animation, not when it deals damage, so it makes it possible to animation cancel (spamming stop) to make it trigger way more times than it should.
 
Level 9
Joined
Apr 25, 2009
Messages
468
Could this work?
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Trigger - Add to Your Trigger <gen> the event (Unit - (Picked unit) Takes damage)
Edit: And YES I know it needs more actions, but basicly, that would work right?
 
Level 4
Joined
Apr 18, 2009
Messages
127
Then use a condition.
  • (Integer((Life of (Attacked Unit)))) Equal to SOMETHING
Eventually set the SOMETHING to a "random number between 0 and
(Max Life of (Attacked Unit))"

Edit: Darkyvm replied before I finished this post
 
Level 9
Joined
Apr 25, 2009
Messages
468
Then use a condition.
  • (Integer((Life of (Attacked Unit)))) Equal to SOMETHING
Eventually set the SOMETHING to a "random number between 0 and
(Max Life of (Attacked Unit))"

Mate, that wont work... he needs an Action not an Condition...
 
Level 11
Joined
May 16, 2007
Messages
288
Could this work?
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Trigger - Add to Your Trigger <gen> the event (Unit - (Picked unit) Takes damage)
Edit: And YES I know it needs more actions, but basicly, that would work right?

I think it should work, but you also have to remember to add the event for units that are created after map initialization.

But if you understand some JASS, I suggest using this system by Rising_Dusk, it's much easier and also free of bugs.
http://www.wc3c.net/showthread.php?t=100618
 
Level 4
Joined
Mar 6, 2008
Messages
72
Whew... thank you all VERY much for your replies.

No, that's not the problem, the problem is that with the "A unit is attacked" event, the event is registered when the unit starts the attack animation, not when it deals damage, so it makes it possible to animation cancel (spamming stop) to make it trigger way more times than it should.

This. The unit can cancel the animation and the trigger would trigger[verb] and the animation can be cancelled. I also want the trigger to detect how much damage a unit takes.

+rep.
 
Level 11
Joined
May 16, 2007
Messages
288
The system I linked before can register how much damage the unit took, it just has 2 problems:

- The system is in JASS, so if you don't know it you may have some problems using it.

- If you don't want the system to register damage from spells, then all spell damage in your map has to be done through the system's damage function or it'll be registered as if it was an attack.

The map that comes with it has some examples that should help you understand how the system works and how to use it.
 
Status
Not open for further replies.
Top