| 12-06-2002, 12:04 PM | #1 |
Hi! in my map i need to know the lifepoints of my hero everytime he gets hurt or healed. After-hurt lifepoints i can get, but not after healed :( for that "get hurt" thing there is an event it is: event: unit - takes damage for the hurt thing i use : event: unit - takes damage action: set a(variable) to life of unit action: display to (all players) the text: string(a) but there is no event for unit "get healed" or something is it possible to add such an event? i need it if this hero would use an healthpotion or gets healed by a priest, etc. plz help |
| 12-06-2002, 02:58 PM | #2 |
What makes this difficult is that a unit is always healing, by default. Events: Every 2 second Actions: action: set a(variable) to life of unit Events: Every 1 second Actions: set b = life of unit if( (a+5) < b){ Then unit has probably been healed by a potion, priest, or at a foutain of health, providing the unit does not already some insanely powerful regeneration as default. I think that should work, but, will try later tonight. } //5 is only a guess, which my logic is, is that a unit will not gain more then 5 health points back a second under regular circumstances. You will have to play around with this number... |
| 12-06-2002, 05:18 PM | #3 |
thank you, Aiursrage2k meanwhile i figuered it out my self. but thanks for your help, it works! |
