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

[General] Issue with stacking items and assigning an integer for all units of a type.

Status
Not open for further replies.
Level 4
Joined
Apr 4, 2013
Messages
60
In short, I need some GUI based scripts for how to determine all of a specific type of unit (e.g. Farm.) on a map, and then convert and assign to a variable.
In addition, I also require a system for stacking Items in stacks of up to 15.
Thank you in advance, this is a lifesaver for me.
 
For units of type I'm guessing u want to index units but not each individual unit. You want to index unit types best way I can think is Hashtable but I don't see how indexing unit types would be beneficial as there is a function pick all units on entire map matching unit type ur unit. For the item stack there should be some systems in the systems section
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • Untitled Trigger 103
    • Events
    • Conditions
    • Actions
      • Set i = 0
      • Set group = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Farm))
      • Unit Group - Pick every unit in group and do (Actions)
        • Loop - Actions
          • Set units[i] = (Picked unit)
          • Set i = (i + 1)
      • Custom script: call DestroyGroup(udg_group)
      • Custom script: set udg_group = null

http://www.hiveworkshop.com/forums/spells-569/easy-item-stack-n-split-v2-7-4-a-153287/
 
Status
Not open for further replies.
Top