• 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.

Item drops

Status
Not open for further replies.
Level 3
Joined
Jan 4, 2010
Messages
42
I need a system/trigger that drops items in random regions on the map.

But it cant be too many items, just now and then. Heros can pick up the items and then more items will drop...

If you don't understand please tell. (But I will be off till later...)
 
Level 12
Joined
Aug 22, 2008
Messages
911
For one thing, random region is pretty hard to program, but a random point in a region is much easier.
  • Item Drop
    • Events
      • Time - Every WTF seconds of game time
    • Conditions
      • EnableItemDrop equal to True
    • Actions
      • Set point = (Random point in Region)
      • Set item = (Random level ? type ? item)
      • Item - Create 1 item at point
      • Custom script: call RemoveLocation(udg_point)
 
Level 4
Joined
Jan 9, 2010
Messages
89
As for the random region, I would have a trigger att map initialization that sets a Region array variable with all regions you want, each with a unique number. Then in you trigger You shoul have Random integer between x and y as the index.
 
Level 3
Joined
Jan 4, 2010
Messages
42
As for the random region, I would have a trigger att map initialization that sets a Region array variable with all regions you want, each with a unique number. Then in you trigger You shoul have Random integer between x and y as the index.

I have tried this myself already, but when I try it ingame items drop at all regions...

Here is the trigger:
  • Item Regions
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
      • ItemCount Less than or equal to 10.00
    • Actions
      • For each (Integer A) from 0 to 100, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer A) Less than or equal to 19
            • Then - Actions
              • Item - Create Health Gem at (Center of ItemRegion[(Integer A)])
              • Set ItemCount = (ItemCount + 1.00)
            • Else - Actions
I don't know but i think it is the loop that causes the effect.
 
Level 4
Joined
Jan 9, 2010
Messages
89
That is not what I meant. I was thinking of something more like this.

  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Region[1] = Region 002 <gen>
      • Set Region[2] = Region 000 <gen>
      • Set Region[3] = Region 001 <gen>
  • Untitled Trigger 001
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set Point = (Random point in Region[(Random integer number between 1 and 3)])
      • Item - Create Ring of Protection +5 at Point
      • Custom script: call RemoveLocation(udg_Point)
 
Level 3
Joined
Jan 4, 2010
Messages
42
Well thats an idea!
Will test that.

Edit: It works, though is it possible to add a "chance" that the item wont spawn (Just raise the 3 in "(Random integer number between 1 and 3)"??)

And I would also like to add more items that can drop, not just 1.
 
Level 4
Joined
Jan 9, 2010
Messages
89
If you wnat to have a chance, then yes. just raise the 3 as you said. If you want to create more items in different regions you could just add another variable, set it in the same way and then create an item with that variable.
 
Level 3
Joined
Jan 4, 2010
Messages
42
If you wnat to have a chance, then yes. just raise the 3 as you said. If you want to create more items in different regions you could just add another variable, set it in the same way and then create an item with that variable.


OK, but i found another way:
  • Item - Create (Random level 8 Powerup item-type) at ItemPoint
I just set the item level to 8.

But this doesn't work with custom items :cry:
Any idea why?
 
Level 4
Joined
Jan 9, 2010
Messages
89
Oh, I thought you meant that it should drop several items, not another type of item. Are you sure it does't work with custom items?
 
Level 3
Joined
Jan 4, 2010
Messages
42
For me yes, I have 3 custom items that shows up if you choose level 8 powerup items, so i believe that they are level 8. i tried with other items (not custom made) and that worked. But not with my own :cry:
 
Level 5
Joined
Nov 22, 2009
Messages
181
then go to the items tab in the object editor and set the level of the desired item to lvl 8. If you have already done that then you should create an item array and do pretty much the same thing as with the regions. Also if you want to spawn multiple types at the same time in the same region do the array thing then do a loop + random integer thing.
 
Level 3
Joined
Jan 4, 2010
Messages
42
then go to the items tab in the object editor and set the level of the desired item to lvl 8. If you have already done that then you should create an item array and do pretty much the same thing as with the regions. Also if you want to spawn multiple types at the same time in the same region do the array thing then do a loop + random integer thing.

Sweet! Thanks dude!
I'll give you and ED_Reborn +Rep
:thumbs_up:
 
Status
Not open for further replies.
Top