• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Catalog] Level+Slot+Group+Version Filter

Level 31
Joined
Jul 10, 2007
Messages
6,306
It certainly does.

If you have 12 heroes that all use the same group of items, like potions, you can add that group to 1 group, like misc items, and then add that group to each hero

hero.add(miscitems)
hero2.add(miscitems)

etc ; )

edit
ofc groups don't only just have to be heroes... you can group up anything you like : ). Also, adding additional slots is super easy too ;p.

JASS:
    private struct SlotFilter2 extends array
        private static Table array slotId
        private static integer slotCount = 0
        method operator [] takes integer slot returns integer
            if (0 == slotId[this]) then
                set slotId[this] = Table.create()
            endif
            if (not slotId[this].has(slot)) then
                set slotCount = slotCount + 1
                set slotId[this][slot] = slotCount
            endif
            return slotId[this][slot]
        endmethod
    endstruct
    private struct SlotFilter extends array
        private static Table array slotId
        private static integer slotCount = 0
        method operator [] takes integer slot returns SlotFilter2
            if (0 == slotId[this]) then
                set slotId[this] = Table.create()
            endif
            if (not slotId[this].has(slot)) then
                set slotCount = slotCount + 1
                set slotId[this][slot] = slotCount
            endif
            return slotId[this][slot]
        endmethod
    endstruct

Boom, 2 slots now ;D.
 
Top