HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

detecting unit not under attack

03-04-2006, 08:24 PM#1
Linera
How can i detect if a unit is not under attack?
03-05-2006, 01:11 AM#2
Ant
I don't know of a simple way, but you can try to detect when a unit is not losing health.
03-05-2006, 03:22 AM#3
Linera
i don't know how to code it so it can detect when a unit is no longer under attack.
03-05-2006, 03:58 AM#4
shadow1500
A simple way:

Trigger:
Enter Exit Battle
Collapse Events
Unit - A Unit takes damage
Conditions
Collapse Actions
Unit - Set Custom value of (Triggering Unit) to (Custom Value of (Triggering Unit) + 1)
Wait 5.00 Seconds
Unit - Set Custom value of (Triggering Unit) to (Custom Value of (Triggering Unit) - 1)

when the unit's custom value is 0, the unit is not in battle
03-05-2006, 04:41 AM#5
Linera
its for a tagging system, unit comes under attack and unit attacked
= hostile, set custom value to player number.

once unit is no longer under attack set unit's custom value to 0