• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Trigger action for this. (destroying all of a players' units on <unit> death)

Status
Not open for further replies.
Level 10
Joined
Jul 22, 2008
Messages
363
In my map there is a main builder unit and if he dies then all of your units die.
Although I don't have the trigger in front of me it goes something like this.
Event: A Unit Dies
Condition: Unit Type Equal to Razormane Artisan
Action: Ive looked under the units section and I cannot find a trigger that destroys all of the buildings and units owned by the player after this unit dies.
Help is appreciated.:thumbs_up:
 
Level 4
Joined
Nov 9, 2008
Messages
112
Pick every unit owned by (owner of "dying" unit)
-If
-picked unit equal to building(structure or something:grin:)
-Act
-Kill picked unit
 
Level 4
Joined
Mar 12, 2008
Messages
89
  • Actions
  • Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit))) and do (Actions)
    • Loop - Actions
      • Unit - Kill (Picked unit)
 
Level 10
Joined
Jul 22, 2008
Messages
363
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to Razormane Artisan
  • Actions
    • Unit Group - Pick every unit in (Units in (Playable map area) owned by (Owner of (Triggering unit))) and do (Unit Group - Remove all units of (Units owned by (Owner of (Triggering unit))) from (Units in (Playable map area)))
WHy isn't this trigger working? The unit died that I wanted but then the other units that I owned didn't go away. Without this kind of trigger my map is on standstill. Help please
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
Use this:

  • Yay
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit))) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
U better give me a cookie for all of this work. xD
 
Level 10
Joined
Jul 22, 2008
Messages
363
I just ran out of cookies but I have something better..... thanks I will try this trigger out.
Problem with the trigger
  • Untitled Trigger 006
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Razormane Artisan
    • Actions
      • Custom script: Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit))) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
Please tell me what I did wrong.
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
Don´t forget to clean leaks!

  • Custom script: set bj_wantDestroyGroup = true

I dont think that its a good thing to teach leaks to who doesnt even know about unit groups
that may cause confusion
he'll learn things like that later
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
I dont think that its a good thing to teach leaks to who doesnt even know about unit groups
that may cause confusion
he'll learn things like that later

Meh, in my opinion he should be aware what leaks are, and learn how to clean them from the start. It's so piss annoying to fix a whole map of leaks later on.

:( Im not a complete idiot when it comes to World Editor I just forget where things are! :) and I already put the script in so if there were any leaks there gone now.

True that, I have the same thing all the time.
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
err I didnt say that you are idiot
Well when I was knowing same as you are
I wouldnt want to get in complicated things, that would confuse me much
I just... bah whatever
 
Status
Not open for further replies.
Top