• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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

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