• 🏆 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!

[General] Item Removal System

Status
Not open for further replies.
Level 23
Joined
Apr 16, 2012
Messages
4,041
JASS:
library CleanItems initializer onInit
    globals
        private constant real TIMEOUT = 1800
        //time for the system to clean up every TIMEOUT seconds from the map start
    endglobals

    private function enum takes nothing returns nothing
        call RemoveItem(GetEnumItem())
    endfunction

    private function cleanItems takes nothing returns boolean
        call EnumItemsInRect(GetWorldBounds(), null, function enum)
        return false
    endfunction

    private function onInit takes nothing returns nothing
        local trigger t = CreateTrigger()
        call TriggerRegisterTimerEvent(t, TIMEOUT, true)
        call TriggerAddCondition(t, Condition(function cleanItems))
        set  t = null
    endfunction
endlibrary
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
If you apply something like this and if the map has item drops on the ground, it might sometimes remove the loot dropped by a mob.

You could run a timer everytime an item is dropped and save the item as a variable. Then simply use a periodic trigger which loops through all timers and checks if any has ended and then remove the item if so.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
Hey I have looked on google and all over this site but in curse of time ORPG they have an item removal system that every 30 minutes it cleans the map of all items how could I add that to my map without millions of actions in a few triggers?

i guess its a bad idea if u want do this way because then same time will be removed the fresh droped item and the 29min old item
 
Level 7
Joined
Aug 15, 2012
Messages
318
i guess its a bad idea if u want do this way because then same time will be removed the fresh droped item and the 29min old item

I realize it could be an inconvenience but I could add a timer so that people know when the items will be removed so they dont kill the boss that drops good items till timer is down or they dont drop items they need
 
Status
Not open for further replies.
Top