• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[Trigger] *Killing all seleced workers trigger*

Status
Not open for further replies.
Level 5
Joined
Jan 26, 2008
Messages
118
Okay what I really need is a trigger which can kill all my selected workers when one of them cast the spell *suicide*. But the problem is when I'm trying it, it kills all of my selected unit not just my workers:slp:
this is so far the best solution i have found
  • suicide
    • Events
      • Unit - A unit owned by Player 1 (Red) Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Suicide (Neutral Hostile)
    • Actions
      • Wait 1.00 seconds
      • Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) of type Worker) and do (Unit - Explode (Picked unit))
but do you have any ideas how to make a
*kill all selected workers (and only workers) when one of them cast suicide spell*?
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Picked unit)) Equal to Footman
        • Then - Actions
          • Unit - Kill (Picked unit)
        • Else - Actions
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
Well when you group units selected
it groups the last synced selection
so if you change your selection then type this
it may kill someone else

Simply it updates the selections for server to know
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Just add it like this

  • Custom script: set bj_wantDestroyGroup = true
  • Custom script: call SyncSelections()
  • Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Picked unit)) Equal to Footman
        • Then - Actions
          • Unit - Kill (Picked unit)
        • Else - Actions
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Nice signature by the way its actually true

Thanks, and I know its true, thats why I put it there ^^
I just thought about how the more you get expirienced with the World Editor the more you need to fix all kind of leaks and stuff you would never know other wise, but when you think about it, its true about everything in life :xxd: (or maybe I should be sad ?...)
 
Level 5
Joined
Jan 26, 2008
Messages
118
Ok I think it fixed that problem. But unfortunately another problem has appeared :( It has probably the same roots. The problem is sometimes when you select something it automatically de-select it. It haven't happened with any of my units just some random guy thought.
any idea about whats wrong?
 
Status
Not open for further replies.
Top