• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Check for Item in Region?

Status
Not open for further replies.
Level 23
Joined
Oct 20, 2012
Messages
3,075
Hey Guys, I have a trigger that creates several items in some random regions in my map but my current trigger usually creates more than one item per region and It would be better if it would be one item per region.. The only thing I though about is to remove any item in the region that is similar to what is about to be created every loop.. but that won't work for me because I want to have an exact amount of these items in my map..

Item Spawn
Events
Time - Every 20.00 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Floor_Item_Aquired Greater than 0
Then - Actions
For each (Integer A) from 1 to Floor_Item_Aquired, do (Actions)
Loop - Actions
Item - Create Floor_Item_Types[(Random integer number between 1 and 5)] at (Center of Creep_Spawn_Points[(Random integer number between 1 and 31)])
Set Floor_Item_Aquired = 0
Else - Actions
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
you wanted it to loop from 1 to 0 ?

anyway, you're leaking points
(Center of Creep_Spawn_Points[(Random integer number between 1 and 31)])

  • Set tempPoint = (Center of Creep_Spawn_Points[(Random integer number between 1 and 31)])
  • Item - Create Item at tempPoint
  • Custom script : call RemoveLocation (udg_tempPoint)
 
Level 23
Joined
Oct 20, 2012
Messages
3,075
Oh, wait wait.. let me clarify some things because I forgot to say what the variables are.. Floor Item Acquired is an integer.. it is set to 10 on init then when it spawns it is set to zero, so every time a hero/unit acquires 1 of these items, floor item acquired is set to the number of acquired items.. so that the items in the map are a constant 10.. floor item types are the item types and creep spawn points are regions set at map init.. so I don't think this leaks
 
Status
Not open for further replies.
Top