• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

All Units Dead (Really Dead, with no revives)

Status
Not open for further replies.
Level 8
Joined
Feb 17, 2007
Messages
368
  • ((All units of Hero_Selected_Unit_Group are dead) Equal to True) and ((Hero_Selected_Unit_Group is empty) Equal to False)
I have an event that checks every 0.30 secs to see if this condition is true, but the problem is I want it to check if all units in my unit group who die are really DEAD, and have no revives/anks left. What should I add/change to this condition to achieve that?
 
Level 11
Joined
Sep 12, 2008
Messages
657
probably
*and unit has item of type ank equal to false*
condiiton.. i really dont wanna bother open the editor atm..
so i guess thats the best you can do..
btw, what you mean by "revives"?
if its your custom script,
cant do much.
 
Level 5
Joined
Jan 4, 2007
Messages
103
This?:

  • Set Integer1 = 0
  • Set Group1 = (Units in (Playable map area) matching (((Owner of (Matching unit)) Equal to (Your Player)) and (((Matching unit) is alive) Equal to True)))
  • Unit Group - Pick every unit in Group1 and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) has an item of type Ankh of Reincarnation) Equal to True
        • Then - Actions
          • Set Integer1 = 1
        • Else - Actions
          • Do nothing
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ((Group1 is empty) Equal to True) and (Integer1 Equal to 0)
    • Then - Actions
      • Your Actions
    • Else - Actions
      • Do nothing
  • Custom script: call DestroyGroup (udg_Group1)
Hope it helps:)
 
Last edited:
Level 11
Joined
Sep 12, 2008
Messages
657
im not so sure about empty part.
and also, it should be integer1 = 1, then 0 at end.
since if it keeps increasing by 1, it doesnt matter.
it just re-checks when he dies =]

edit: gah.. why 0.3 seconds?
just do a check if a unit dies, remove him from the group..
if a unit dies, also make the ankh item check. if its true, dont remove him, if its false, remove him..
then after that, do the check:
unit group X is empty equals to true,
if it returns true, do your actions.
 
Level 5
Joined
Jan 4, 2007
Messages
103
im not so sure about empty part.
and also, it should be integer1 = 1, then 0 at end.
since if it keeps increasing by 1, it doesnt matter.
it just re-checks when he dies =]

edit: gah.. why 0.3 seconds?
just do a check if a unit dies, remove him from the group..
if a unit dies, also make the ankh item check. if its true, dont remove him, if its false, remove him..
then after that, do the check:
unit group X is empty equals to true,
if it returns true, do your actions.

Yeah, right forgot to put set Integer1 = 0 when the units don't have ankh, editing first post.:) thx:)

Also, if the empty unit group doesn't work (think it should), put:

  • ((Number of units in Group1) Equal to 0) and (Integer1 Equal to 0)
 
Status
Not open for further replies.
Top