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

Trees are not dropping items

Status
Not open for further replies.
Level 1
Joined
Apr 16, 2009
Messages
4
Hello

I've been struggling to make a tree drop an item although I have several ways to make that happen I still can't make it work. I've been mapping in War3 for a short while now (I still consider myself a beginner) and never needed to ask for help as I've either just worked around the problem or I've sought out help in tutorials/rest of the forum here on Hiveworkshop, as there is a lot of great help to be found here, but this problem has taken too much of my time now and I really can't see how I'm supposed to make it work.

This is how my trigger looks like to make a destructible tree drop an item:

2IGm4os.png


This trigger works as intended in the lower part of the region but not in the upper part of the region. It is the exactly same region (Region 009 Copy) but yet it only works in the lower part of the region.

L7UH57k.jpg


(Don't mind the double drop in the picture)

I tried to set the trigger to 'Entire map' but that doesn't work at all. I've also tried to create a region that covers the entire map but that does not work either.

Hopefully you can help me or give me another solution to my problem. I just want trees to drop a specific item and I can't make that work.

Ask me for any information you need about my map, regions, triggers, etc. - I really want this issue solved. As I mentioned I am a beginner so it is probably something really simple I have overlooked or I could do it a much easier way.

Thanks!
 
Level 25
Joined
May 11, 2007
Messages
4,650
Starting with the silly questions first..
Are you sure the upper and the lower doodads are of the same type?

Otherwise it perhaps could be something with how many destructibles are limited to a group.
 
Level 1
Joined
Apr 16, 2009
Messages
4
Starting with the silly questions first..
Are you sure the upper and the lower doodads are of the same type?

I am certain that the doodads are of the same type - I picked 'Summer Tree Wall' to place the trees and I haven't changed it at any point. I edited the original Summer Tree Wall in the 'Destructibles' tab after placing the trees, though I don't suppose that would cause any issues.

Otherwise it perhaps could be something with how many destructibles are limited to a group.

I am not sure what this means but my map is very large and it contains a lot of 'Summoner Tree Wall's - If what you said is the issue how do I fix it?
 
Level 1
Joined
Apr 16, 2009
Messages
4
Well one simple way would be to select all summer trees and then hit enter -> items dropped? :p

Wow. I feel completely stupid now. I knew this was possible with units but I don't know why I never tried with doodads it's such an obvious thing to try.
Thank you very much - This seems to have completely fixed my issue. :cgrin:
 
Level 1
Joined
Apr 16, 2009
Messages
4
That solves it, but what if you want to grow new forests or trees during the game?

Then that won't work.

You are right about that and I may want to do that later so I suppose I have only found a temporary fix apparently.

AFAIK, registering events for destructables that uses a destructable group to add those events to each destructable is restricted to 64 destructables at a time...

so if you have more than 64 on that region, it might be the problem... coz that event might be running a destructable group during init...

That sounds like it could be the reason. I have considered if it is possible to make the trees become 'Units' instead of 'Destructibles' but I am still unsure if that would work. I am not using the standard way of 'chopping wood and then returning it to base' so I figure there wouldn't be any real downside of turning them into 'Units'.
 
Nah. Use an initialization trigger to cache all destructibles in the map:

  • Destructible - Pick every destructible in (Playable map area) and do (Actions)
    • Loop - Actions
      • Trigger - Add to Revive Destructibles <gen> the event (Destructible - (Picked destructible) dies)
    • Set Dest_Index = Dest_Index + 1
    • Set Dest_Type[Dest_Index] = Summer Tree Wall
    • Set Dest_Drop[Dest_Index] = Apple
Dest_Type is a destructible type, and Dest_Drop is an item-type.


  • Revive Destructibles
    • Events
    • Conditions
    • Actions
      • Set Destructible_WIndex = (Destructible_WIndex + 1)
      • Set Destructible_Destructed[Destructible_WIndex] = (Dying destructible)
      • Set Destructible_Point[Destructible_WIndex] = (Position of Destructible_Destructed[Destructible_WIndex])
      • -------- Create Item --------
      • For each (Integer X) from 1 to Dest_Index, do (Actions)
        • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Destructible-type of Destructible_Destructed[Destructible_WIndex]) Equal to Dest_Type[X]
          • Then - Actions
            • Item - Create Food_Item[X] at Destructible_Point[Destructible_WIndex]
          • Else - Actions
      • -------- ---------------------- --------
      • -------- ---------------------- --------
      • Wait 10.00 seconds
      • Set Destructible_RIndex = (Destructible_RIndex + 1)
      • Destructible - Resurrect Destructible_Destructed[Destructible_RIndex] with (Max life of Destructible_Destructed[Destructible_RIndex]) life and Show birth animation
        • Custom script: call RemoveLocation(udg_Destructible_Point[udg_Destructible_RIndex])
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Destructible_RIndex Equal to Destructible_WIndex
          • Then - Actions
            • Set Destructible_WIndex = 0
            • Set Destructible_RIndex = 0
          • Else - Actions


I used Magtheridon96's wait trick.
 
Last edited:
Level 2
Joined
Feb 1, 2014
Messages
19
wrathion : How to make categories of respawned destructibles ... i mean something like if i have Trees / Bushes / Plants etc.. How to make create item on every category
 
Status
Not open for further replies.
Top