HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

A quick way of doing this?

03-17-2007, 09:58 PM#1
AtOmIc_PeAnUt
Hi all.

I would just like to no if there is a quick and simple way to pick up a change in a unit's health or mana without have a gazillion events covering every possibility of attacks, items used and so on. I need it to be like a generic unit event and to cover any change at all, not like the 'a units life becomes less than 50' tiggers.

Cheers.
03-17-2007, 10:46 PM#2
oNdizZ
and why cant you just use the 'a units life becomes not equal to current life of the unit' ?
this would prolly be the best way.
03-17-2007, 10:50 PM#3
Mezzer
That just makes no sense in digital terms. If you want to detect damage, just use the appropriate event. Otherwise, I don't see a way of doing this other than periodically checking the units health and comparing it to a previous value.
03-17-2007, 11:03 PM#4
AtOmIc_PeAnUt
Yes but that would involve frequently setting a variable so there was a 'current life' to compare to, and then checking it every second or something ridiculously laggy to make everything syncronise nicely. Oh well, thnx anyway but I guess I will have to go with many, many events lol. :/
03-17-2007, 11:10 PM#5
Pyrogasm
You could use the units' custom values to store their life from the last check.

It does store only integer values, but that could be useful because by converting a real to an integer, little tiny changes like health regen wouldn't be so easily detected.
03-18-2007, 12:56 AM#6
FatalError
Quote:
Originally Posted by oNdizZ
and why cant you just use the 'a units life becomes not equal to current life of the unit' ?
this would prolly be the best way.
When is a unit's life not equal to the units life? O_o
03-18-2007, 07:07 PM#7
Dil999
When jesus says so.