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

Question about "Pick all units"

Status
Not open for further replies.
Level 9
Joined
Mar 10, 2005
Messages
326
I have a slight problem with the function, Pick all units. It only picks some. How would I make "pick all units" actually pick all for example, 300 units instead of the first 12? For example, in my map, if a player leaves, I have the function pick all units and explode all picked units, but there are still a lot of units left.

Also, I have a market place unit that is supposed to show the income (with gold text popping up) every 10 seconds. However, I need a way for all the markets to show income instead of just the first few.

Thanks
 
Level 9
Joined
Apr 28, 2009
Messages
538
Actually, you are right about the "Pick all".
I have a trigger just like yours (A pelyer leaves - Pick all and explode) and it's not working right.

Maybe it's a bug.
 
Don't add limitations on the picking. Do this:
  • Trigger
  • Events
    • Player - Player 1 (Red) leaves the game
    • Player - Player 2 (Blue) leaves the game
    • Player - Player 3 (Teal) leaves the game
    • ...
  • Conditions
  • Actions
    • Set Temp_Group = (Units owned by (Triggering Player))
    • Unit Group - Pick every unit in (Temp_Group) and do (Actions)
      • Loop - Actions
        • Unit - Kill (Picked unit)
    • Custom script: call DestroyGroup (udg_Temp_Group)
 
Level 9
Joined
Apr 28, 2009
Messages
538
Don't add limitations on the picking. Do this:
  • Trigger
  • Events
    • Player - Player 1 (Red) leaves the game
    • Player - Player 2 (Blue) leaves the game
    • Player - Player 3 (Teal) leaves the game
    • ...
  • Conditions
  • Actions
    • Set Temp_Group = (Units owned by (Triggering Player))
    • Unit Group - Pick every unit in (Temp_Group) and do (Actions)
      • Loop - Actions
        • Unit - Kill (Picked unit)
    • Custom script: call DestroyGroup (udg_Temp_Group)


Yeah, I've tried that too....still not working.
 
Level 7
Joined
Mar 2, 2008
Messages
180
Just a thought:

  • Player Leaves
  • Events:
  • What ever triggers the killing
  • Conditions:
  • Actions:
  • Set UnitsOwned = number of units owned by (player)
  • Set Count = 0
  • Trigger - Run KillThemAll (checking conditions)
  • KillThemAll
  • Events:
  • Conditions:
  • if Count <= UnitsOwned
  • Actions:
  • Unit - Kill random unit owned by (player)
  • set Count = Count + 1
  • Trigger - Run (this trigger), checking conditions
That's the basic concept. I'm sure someone will execute it in some better way, though.
 
Status
Not open for further replies.
Top