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

Item Respawn

Status
Not open for further replies.
Level 3
Joined
Jul 17, 2012
Messages
26
I'm trying to make an inventory item respawn on the map here's what I have:

TRIGGER
Unit - Any Unit Picks Up Item (Inventory) - Medkit [45.55, 62.53]
CONDITION
General - Wait 600.0 Game Time seconds
ACTION
Unit - Create 1 Item (Inventory) - Medkit for player 0 at Medkit 1 facing (Map Center offset by (0.0, 0.0)) (No Options)

The problem is the Trigger. I want the medkit to respawn 10m after EVERY time it's picked up (I have 2 medkits in different locations).
I thought of just having it as a periodic event (every 10m of gametime have one spawn in each location), but I don't want them to pile up if they don't get used. Is there a condition that will prevent one from spawning if there is still one there?
 
Level 9
Joined
Dec 21, 2006
Messages
490
items are units and if you like to know if it has been used you can check with trigger (there is a condition on integers - number of units). if you like to know if medkit 1 or medkit 2 i would add a custom value on the medkit and compare it. best thing to respawn the item would be a timer which starts after the medkit is picked up and restarts if it is still there.
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
^ Hashtables? Are you sure you are posting in the correct game section?

Is there a condition that will prevent one from spawning if there is still one there?

Yes just use the If Then Else or simply the condition:

(Number of Living units in (Item - Medkit units in (Entire map) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) < 1

then create, Options (ignore placement requirements) - for just in case
 
Status
Not open for further replies.
Top