• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Removing items inside the map.

Status
Not open for further replies.
Level 3
Joined
Dec 19, 2016
Messages
16
i want to make a trigger that will remove the item in the map if you dont loot it for a period of time, like if the creep dropped an item then you have (for example) 20 seconds to loot it, or else the item will vanish.
 
Level 28
Joined
Feb 18, 2014
Messages
3,580
You will need to add that item via triggers and try something like this :

  • Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Set TempPoint = (Position of (Dying unit))
      • Item - Create Crown of Kings +5 at TempPoint
      • Wait 10.00 seconds
      • Item - Remove (Last created item)
      • Custom script: call RemoveLocation (udg_TempPoint)
 
Level 3
Joined
Dec 19, 2016
Messages
16
Thanks for the reply, its not working, i did not copy the whole trigger u shared cuz' i have here a trigger, a random item drop from creeps, and i want to remove the item if you not loot it. here... can i have some help here? what suppose to be a problem?
 

Attachments

  • lewl.jpg
    lewl.jpg
    65.7 KB · Views: 41

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
Triggering unit is equal to triggering unit is pointless
It is like asking "Is 1 = 1" remove it or change it.

Remove the "Do Nothing" just leave it empty instead.


The problem here is that waits are not as good as you want them to be.
Make a item variable and name it "droppedItem"
At the very top of the trigger add a custom script "local item udg_droppedItem"
Set the item to last created item before the wait
remove dropeedItem after the wait

Also this How to easily post triggers
 
Level 3
Joined
Dec 19, 2016
Messages
16
hi, chaosy, thanks for the reply, can i ask u big favor please xD ? can you edit my Screenshot posted above and help me which one i need to change/remove.. etc. cuz' its hard for me to understand your point, since im no expert on triggers.
droppeditem value is "point"?
"local item udg_droppedItem" gives me error.
thats why i need your help? xD
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
7701502c7b8b9291c3855cad5e7eab7f.png

  • Untitled Trigger 001
    • Events
      • Unit - A unit owned by Neutral Hostile Dies
    • Conditions
    • Actions
      • Custom script: local item udg_droppedItem
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random real number between 1.00 and 100.00) Less than or equal to 40.00
        • Then - Actions
          • Set drop_loc = (Position of (Triggering unit))
          • Item - Create Tome of Experience at drop_loc
          • Set droppedItem = (Last created item)
          • Custom script: call RemoveLocation(udg_drop_loc)
          • Wait 2.00 seconds
          • Item - Remove droppedItem
        • Else - Actions
 
Level 3
Joined
Dec 19, 2016
Messages
16
Thank you Chaosy, its now working, thank you for your help, i just replace "last created item" to "Random Item in Playable Map Area".

so that if there are more than 1 items
ThankYouForHelpingMe.jpg
dropped, it will randomly remove. i tested it and its working.
 
RandomItem doesn't make much sense, I believe. If a hero unit drops temporary a item, this item may be removed, too, and also all others that don't match the condition being the dropped item by dying unit after 20 seconds not being picked up.

Doesn't there need to be a check if item is picked up, or not?

What should happen if a unit picks up the item, and drops it again after 10 seconds?
 
In GUI I would probably do this approach with MUI Spells Using Artificial Waits. But you will firstly do hard for sure and have to read some other variable tutorials and so, too. Maybe this helps, too, to get some general understanding what MUI is.

It's big enough task to apply such proper and MUI way, and then you could ask more, like how to care for other cases if you're interested. : )
 
Status
Not open for further replies.
Top