1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. The Melee Mapping Contest #4: 2v2 - Results are out! Step by to congratulate the winners!
    Dismiss Notice
  3. We're hosting the 15th Mini-Mapping Contest with YouTuber Abelhawk! The contestants are to create a custom map that uses the hidden content within Warcraft 3 or is inspired by any of the many secrets within the game.
    Dismiss Notice
  4. The 20th iteration of the Terraining Contest is upon us! Join and create exquisite Water Structures for it.
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice

Item Cleanup 1.3

Submitted by Bribe
This bundle is marked as approved. It works and satisfies the submission rules.
Use
Every map that uses tomes should have this trigger. As many of us know, tomes never get removed after used, they stay as tiny little icons in the game, well, indefinitely. This trigger removes those nasty tomes. All you have to do is copy & paste this one trigger into your map and it works automatically.

This serves the exact same purpose as Tirlititi's Item Cleanup, but that library is in vJass. However, this is a very necessary thing to have in a map so I have made it available for GUI users.

  • Item Cleanup
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ItemsToClean Greater than 0
        • Then - Actions
          • -------- Loop through all dead items and remove them --------
          • -------- This happens at the absolute soonest at 30 seconds of game time (if there were items to remove at the 15 second mark) --------
          • For each (Integer Loop) from 0 to (ItemsToClean - 1), do (Actions)
            • Loop - Actions
              • Item - Set life of CleanedItem[Loop] to 1.00
              • Item - Remove CleanedItem[Loop]
              • Set CleanedItem[Loop] = No item
          • Set ItemsToClean = 0
        • Else - Actions
      • -------- --------
      • -------- Pick up all dead items and flag them as ready to remove --------
      • -------- --------
      • Item - Pick every item in (Playable map area) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current life of (Picked item)) Equal to 0.00
            • Then - Actions
              • Set CleanedItem[ItemsToClean] = (Picked item)
              • Set ItemsToClean = (ItemsToClean + 1)
            • Else - Actions


Credits
Vexorian (for PowerupSentinel)
Tirlititi (for Item Cleanup)

Keywords:
Trilititi, Vexorian, Item, Cleanup, Powerup, Sentinel, tome, leak
Contents

Item Cleanup Testmap (Map)

Reviews
Moderator
Very useful for getting rid of used tomes for example.
  1. Maker, 25th Aug 2011, Item Cleanup 1.2

    Very useful for getting rid of used tomes for example.
     
  2. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,149
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    Good job Bribe =)



    I think a Bounty retrieval resource and a Trade Event would also be very useful.
     
  3. Cihparg

    Cihparg

    Joined:
    Jul 4, 2008
    Messages:
    958
    Resources:
    1
    Models:
    1
    Resources:
    1
    Ahem, the image does not seem to be correct.
     
  4. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,828
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Screenshot updated. Not sure how the Damage Screenshot got there ;)


    @Nestharus, I will keep that in mind, if someone asks for a GUI way to detect that I might be more interested, but I'm trying to build the ones that mean the most to me first.
     
  5. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,978
    Resources:
    17
    Spells:
    17
    Resources:
    17
    (Not even tested yet the map)

    Does this map cleans up "leaked" tomes once per interval second ?

    Then, what does this do ?

    • Removing Tomes Leak
      • Events
        • Unit - A unit Sells an item (from shop)
      • Conditions
        • *Any Tomes Type You Want*
      • Actions
        • Wait 0.00 seconds
        • Item - Remove (Sold Item)


    It is simple, yet works perfectly (and it is MUI)
    I don't know what does the trigger above is difference between the ones you made it.

    Just curious.
     
  6. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,828
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Not all tomes come from shops - many are already in the map or are dropped by creeps. You also can't use a "unit uses item" event because then it won't clean up items that were killed some other way.

    Waiting 0.00 seconds will not allow the tome's death animation to be displayed. You'd have to wait 1.5 seconds to complete it, but then the wait might be innaccurate and be less than 1.5 seconds. So you have to use a game-time wait (
    PolledWait
    ) which causes handle leaks and is generally an ugly thing to be avoided.

    In summary, this is the most leakless and functional approach.
     
  7. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,978
    Resources:
    17
    Spells:
    17
    Resources:
    17
    So there is no difference in functionality, only difference in efficiency, just as I suspected :D
    Thank you for clarifying this.

    Also, you can pretty much add more Event than "A unit sells item..." Event, LOL
    Acquires an item can work with "picking up tomes", is it ?
     
  8. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,828
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    There is a huge difference in functionality from what you said. Your script will cut off the item's death animation. If you change the wait to a game-time wait of 1.5 seconds you will then just create a leak for using that function at all.

    There is no event "any item dies" either. This is the only way to do it properly.
     
  9. maddeem

    maddeem

    Joined:
    Jan 1, 2011
    Messages:
    1,238
    Resources:
    5
    Maps:
    2
    Spells:
    3
    Resources:
    5
    You could just pick all items in map every so often n do a item life comparison... xD
     
  10. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,828
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    How is that different from what I'm doing here?
     
  11. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,008
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    Good Job Bribe :p
    I'm changing that BoundSentinel script so that you can disable the system whenever you want ;D
     
  12. maddeem

    maddeem

    Joined:
    Jan 1, 2011
    Messages:
    1,238
    Resources:
    5
    Maps:
    2
    Spells:
    3
    Resources:
    5
    Ehh you have custom script in there, don't really understand it. Lol (Fail)
     
  13. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,978
    Resources:
    17
    Spells:
    17
    Resources:
    17
    Wait, if Bribe is upload his own system who would certify his system to be approved or not ?
    Maker ?
     
  14. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,828
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Why do you need to understand it? It's just a simple program.

    If you have any concerns about something I can clarify it for you.

    Him or The_Reborn_Devil. Moderaters can not moderate their own stuff thankfully.
     
  15. xorkatoss

    xorkatoss

    Joined:
    Jul 12, 2010
    Messages:
    1,476
    Resources:
    6
    Models:
    5
    Maps:
    1
    Resources:
    6
    awesome cleanup system dude!! 5/5 :thumbs_up:
     
  16. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,978
    Resources:
    17
    Spells:
    17
    Resources:
    17
    Ohhh the irony, haha.
     
  17. Aeroblyctos

    Aeroblyctos

    Joined:
    Aug 14, 2006
    Messages:
    6,597
    Resources:
    24
    Models:
    1
    Packs:
    1
    Maps:
    22
    Resources:
    24
    Seems useful.

    Probably gonna use this. I'll post some feedback after testing.
     
  18. Aeroblyctos

    Aeroblyctos

    Joined:
    Aug 14, 2006
    Messages:
    6,597
    Resources:
    24
    Models:
    1
    Packs:
    1
    Maps:
    22
    Resources:
    24
    Okay back from testing. I improved the testing map of yours and tested a little. I made a trigger that checks every second how many items there are in the map. When I acquire or destroy an item the counter won't decrease.

    So, does your system really work?

    I'm probably gonna use this system but I want first your explanation.

    Map is attached to this post.
     

    Attached Files:

  19. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,008
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    The system works perfectly.
    It simply removes powerups so they don't leak :p