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

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