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

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