• 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.

Killing several units in the game by commands

Status
Not open for further replies.
Level 3
Joined
Feb 25, 2013
Messages
16
Heya folks

I am making this map and I've made a repick system. Though, my I cannot find a function which allows me to kill all units owned by a player.

Is there anyone out there who can help me out, and create a trigger command, which kills all units owned by Player when the player types '-repick'.


Thanks on forehand
- Stormman67
 
Level 23
Joined
Oct 20, 2012
Messages
3,075
Is this what you meant?

  • Kill
    • Events
      • Player - Player 1 (Red) types a chat message containing -repick as An exact match
      • Player - Player 2 (Blue) types a chat message containing -repick as An exact match
      • Player - Player 3 (Teal) types a chat message containing -repick as An exact match
      • Player - Player 4 (Purple) types a chat message containing -repick as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -repick as An exact match
      • Player - Player 6 (Orange) types a chat message containing -repick as An exact match
      • Player - Player 7 (Green) types a chat message containing -repick as An exact match
      • Player - Player 8 (Pink) types a chat message containing -repick as An exact match
      • Player - Player 9 (Gray) types a chat message containing -repick as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -repick as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -repick as An exact match
      • Player - Player 12 (Brown) types a chat message containing -repick as An exact match
    • Conditions
    • Actions
      • Set UnitGroup_Variable = (Units owned by (Triggering player))
      • Unit Group - Pick every unit in UnitGroup_Variable and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • Custom script: call DestroyGroup(udg_UnitGroup_Variable)
EDIT:
Chaosy was faster..
 
Level 3
Joined
Feb 25, 2013
Messages
16
Is this what you meant?

  • Kill
    • Events
      • Player - Player 1 (Red) types a chat message containing -repick as An exact match
      • Player - Player 2 (Blue) types a chat message containing -repick as An exact match
      • Player - Player 3 (Teal) types a chat message containing -repick as An exact match
      • Player - Player 4 (Purple) types a chat message containing -repick as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -repick as An exact match
      • Player - Player 6 (Orange) types a chat message containing -repick as An exact match
      • Player - Player 7 (Green) types a chat message containing -repick as An exact match
      • Player - Player 8 (Pink) types a chat message containing -repick as An exact match
      • Player - Player 9 (Gray) types a chat message containing -repick as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -repick as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -repick as An exact match
      • Player - Player 12 (Brown) types a chat message containing -repick as An exact match
    • Conditions
    • Actions
      • Set UnitGroup_Variable = (Units owned by (Triggering player))
      • Unit Group - Pick every unit in UnitGroup_Variable and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • Custom script: call DestroyGroup(udg_UnitGroup_Variable)
EDIT:
Chaosy was faster..



I don't feel like doing JASS yet, as I'm still early in the Editing. But yeah, I never thought of killing 'Picked Unit'. I always tried with the 'Triggering Unit'. But thanks!
 
Level 3
Joined
Feb 25, 2013
Messages
16
The JASS is required to prevent memory leaks. Your really do not want to let leaks happen as it will end up degrading the map performance.

I believe you. Can you recommend any tutorials, sites etc. which offer guides for the JASS script?

And is it possible to have normal triggers and JASS in combination?
 
Status
Not open for further replies.
Top