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

Adding random items to units

Status
Not open for further replies.
Level 4
Joined
Feb 28, 2009
Messages
73
In my map, i have many of the same unit placed around the map. What i need to know how to do is:
-Select all the units, and give 1, 2, 3, or 4 items to each unit.
-Item 1 being a dead item saying, "This area has Zombies"
-Item 2 saying, "This area has Gold"
And so on for the 4 items.
The unit would be able to receive all of these items, 3 of them, 2, 1, or 0 of them.
Then i would make a trigger saying:
If (unit) has (item) then set variable_integer_zombies to (random number 1-10)
And use that trigger for all 4 items.

Any help would be awesome. Thanks!
 

Rub

Rub

Level 2
Joined
Feb 25, 2011
Messages
12
A way to do what I think this is, is attached below.
 

Attachments

  • Clawdruid ItemMapForYou.w3x
    18.9 KB · Views: 49

Rub

Rub

Level 2
Joined
Feb 25, 2011
Messages
12
Create a region variable array and a integer variable and make the point variable a array and classify each region to part of the array then use the integer variable as a counter so you don't have to create it over and over.
 
Status
Not open for further replies.
Top