• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

removing all units a player controls

Status
Not open for further replies.
Level 6
Joined
Sep 24, 2015
Messages
174
how could i make this trigger pls 2 hours i'm tryin

if a specific unit dies then remove all the unit from the game of the owner of the specific unit and create another unit for him and make him change alliance.

if the player leaves the game then remove all the units he owned from the game.

tried many hours...successless
 
Level 6
Joined
Sep 24, 2015
Messages
174
so trigger would look like that?

  • 002
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Builder
    • Actions
      • Set TempGroup1 = (Units owned by (Owner of (Dying unit)))
      • Unit Group - Pick every unit in TempGroup1 and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • Player - Make (Owner of (Dying unit)) treat (Random player from (All allies of (Owner of (Dying unit)))) as an Ennemi
      • Unit - Create 1 Vampire Minion for (Owner of (Dying unit)) at (Position of (Dying unit)) facing Orientation Buildings with default degrees
 
Level 25
Joined
May 11, 2007
Messages
4,651
Yes except you only select one random player, you need to do a playergroup variable
playerGroup = Enemies of player (owner of (dying unit))
Pick everybody in playerGroup
make picked player treat owner of dying unit as an enemy
make owner of dying unit treat picked player as an enemy

Both the picked player and the dying player needs to treat each other as enemies or only one player will be an enemy for the other.
 
Level 6
Joined
Sep 24, 2015
Messages
174
@Chaosy well, player is still in game and he still continues to play but for the other side ...you see?

trigger would be like this then?

  • Becoming minion
    • Events
      • Unit- A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Builder
    • Actions
      • Set HumanGroup1 = (All enemies of (Owner of (Dying unit)))
      • Set TempGroup1 = (Units owned by (Owner of (Dying unit)))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in TempGroup1 and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • Player Group - Pick every player in HumanGroup and do (Actions)
        • Loop - Actions
          • Player - Make (Picked player) treat (Owner of (Dying unit)) as an Ennemi
          • Player - Make (Owner of (Dying unit)) treat (Picked player) as an Ennemi
      • Unit - Create 1 Vampire Minion for (Owner of (Dying unit)) at (Position of (Dying unit)) facing Orientation building with default degrees
 
Last edited:
Level 6
Joined
Sep 24, 2015
Messages
174
i'm sorry dude, my knowledge is really really low about coding :/ y i will test it tomorrow.

Thank you for the reply :)

btw, by cleaning you mean a custom script for remove the location?
 
Status
Not open for further replies.
Top