• 🏆 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!

Killing several units in the game by commands

Status
Not open for further replies.
Level 2
Joined
Feb 25, 2013
Messages
7
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 2
Joined
Feb 25, 2013
Messages
7
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 2
Joined
Feb 25, 2013
Messages
7
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