• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

[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