Whenever a hero unit is created they are placed into the unit group HeroesOnField.
So that I can use the event: "Unit - (Unit 1 from HeroesOnField) dies" to do actions at hero death.
The problem is that it fires no matter what unit dies.
Any unit in the entire map regardless of being in the group.
Any help would be appreciated.
(also i do not know what the index number "1" changes in this event)
Add a condition to your trigger. ((triggering unit is in unit group) = True
The "1" index refers to the unit that is considered the first unit added to the unit group. "2" would then be the second unit added to the group. If you then remove the unit at index "1" from that unit group, the unit at index "2" would move up the list and be considered "1".
I would suggest just going with ANY UNIT dies rather than unit from unit group. Then just use conditions to define which unit you are specifically looking for.
Also, remember to remove the dying unit from the unit group so that your triggers don't believe that its still there afterward (just as a precaution).
You can't use anything dynamic in an event; it must be static else you have to create your own event via script (which i still believe trips for all units anyways but just has the condition in the event)
The index from the unit group picks which unit in reference to the order that it was added to the group.
Event Help - Unit from Unit Group Dies
Whenever a hero unit is created they are placed into the unit group HeroesOnField.
So that I can use the event: "Unit - (Unit 1 from HeroesOnField) dies" to do actions at hero death.
The problem is that it fires no matter what unit dies.
Any unit in the entire map regardless of being in the group.
Any help would be appreciated.
(also i do not know what the index number "1" changes in this event)
Add a condition to your trigger. ((triggering unit is in unit group) = True The "1" index refers to the unit that is considered the first unit added to the unit group. "2" would then be the second unit added to the group. If you then remove the unit at index "1" from that unit group, the unit at index "2" would move up the list and be considered "1".
I would suggest just going with ANY UNIT dies rather than unit from unit group. Then just use conditions to define which unit you are specifically looking for.
Also, remember to remove the dying unit from the unit group so that your triggers don't believe that its still there afterward (just as a precaution).
@JosinJJ: Go
You can't use anything dynamic in an event; it must be static else you have to create your own event via script (which i still believe trips for all units anyways but just has the condition in the event)
The index from the unit group picks which unit in reference to the order that it was added to the group.
well darn...
i was hoping to use the unit group to avoid triggering the even for every single death...
thx for the heads up