• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Damage detecting system

Status
Not open for further replies.
Level 12
Joined
Apr 27, 2008
Messages
1,228
It is possible in GUI as well, but it would leak(one event for every new unit).
For instance:
Trigger 1
Events:
A unit enters playable map area
Actions
Add event to trigger 2 ( Triggering unit takes damage )

Trigger 2
Events:
- n/a -
Actions:
Show message to player # blah ...
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
If it would be possible to command to 'remember' a number, you could make a trigger that would save the amount of life of a unit every 0.02 seconds, then you wait 0.01 second and checks if the amount of life is lower then the saved amount. At the end of the trigger, you remove the saved number to prevent a massive leak.
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
There is only a 'Unit Is Attacked' event. Nothing with damage.

And in addition to my previous post: Make a trigger that saves the amount of life every X seconds (save it by using a variable), and make another trigger with Event 'Unit's life becomes less than <VARIABLE>'. Then you can add conditions/actions to it.

The bad thing is that the event only works on a specific unit.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
There is only a 'Unit Is Attacked' event. Nothing with damage.
No, there's a Unit takes Damage event (EVENT_UNIT_DAMAGED in Jass).

It is just only available for "Specific unit events."

If it would be possible to command to 'remember' a number, you could make a trigger that would save the amount of life of a unit every 0.02 seconds, then you wait 0.01 second and checks if the amount of life is lower then the saved amount. At the end of the trigger, you remove the saved number to prevent a massive leak.
That's terribly inefficient, and reals don't leak.
 
Level 8
Joined
Jul 22, 2008
Messages
331
but what if you're making an RPG?
what can you do if you need to set damage for all units. i tried but I still
think that it can not be done in GUI... if it can tell me. it would be great...
 
Status
Not open for further replies.
Top