HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How to remove item after some time ?

04-03-2009, 09:43 PM#1
bboy-tiger-
When item is created i want to remove that item after 2 minutes.
Possible ? And it must work for multi items.
04-04-2009, 07:05 AM#2
0zyx0
Do you have the option to use vJASS?
04-04-2009, 07:37 AM#3
bboy-tiger-
Hm, i dunno JASS very well, but if this is the only way you know, explain how, i have friends who know jass if i'll need help, anyway i created it in GUI, but JASS would have less operations i think.
04-04-2009, 07:54 AM#4
0zyx0
This trigger abuses a bug, which will be very useful. It requires a global item variable named ToRemove.
Trigger:
Test
Events
Conditions
Collapse Actions
Custom script: local item udg_ToRemove
-------- Create the item here --------
Set ToRemove = Last created item
Wait 120.00 game-time seconds
Item - Remove (ToRemove)
Custom script: set udg_ToRemove = null
04-04-2009, 12:58 PM#5
bboy-tiger-
Quote:
Originally Posted by 0zyx0
This trigger abuses a bug, which will be very useful. It requires a global item variable named ToRemove.
Trigger:
Test
Events
Conditions
Collapse Actions
Custom script: local item udg_ToRemove
-------- Create the item here --------
Set ToRemove = Last created item
Wait 120.00 game-time seconds
Item - Remove (ToRemove)
Custom script: set udg_ToRemove = null


I think this wont work it 2nd item is spawned 10 second after 1st, only 2nd will be removed and 1st one skipped, right ?


1st item spawned
1 second
2 second
3s
4s

2nd item is spawned
1st item=5s / 2nd item=1s
1st item=6s / 2nd item=2s
1st item=7s / 2nd item=3s...
...1st item=10s(item removed / 2nd item=6s
...(item removed / 2nd item=10s(this item removed)
04-04-2009, 02:11 PM#6
akolyt0r
it should work. ... locals>globals.
04-05-2009, 01:01 AM#7
Ignitedstar
Really...? O_o

I'll take note of this. Thanks!
04-14-2009, 02:36 AM#8
bboy-tiger-
Tnx
04-14-2009, 03:27 AM#9
TriggerHappy
Use my TimedHandles script :P

http://www.wc3c.net/showthread.php?t=105456

And do this, call RemoveItemTimed(YourItem, 120).
04-14-2009, 02:06 PM#10
Anitarf
Quote:
Originally Posted by akolyt0r
it should work. ... locals>globals.
It works for only one local variable per trigger, though.
04-14-2009, 09:56 PM#11
Feroc1ty
Wouldn't that remove the item even if a person picks it up? Or is that what you want?