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

Destructable Drops

Status
Not open for further replies.
Level 6
Joined
Apr 12, 2009
Messages
156
Alright, so I'm being a bit lazy right now, and I just thought I would be the expedient map-maker and rely on the Hive's vast community for quick and efficient assistance instead of fondling my way around the magical and gay lands of GUI triggering.

This is my trigger:

  • Common Tree Spawn
    • Events
      • Destructible - A destructible within (Entire map) dies
    • Conditions
      • ((Triggering unit) has an item of type Iron Hatchet) Equal to True
      • (Destructible-type of (Dying destructible)) Equal to Fall Tree Wall Common
    • Actions
      • Set TempPoint1 = (Position of (Dying destructible))
      • If ((Random integer number between 1 and 2) Equal to 1) then do (Item - Create Common Wood at TempPoint1) else do (Do nothing)
      • Custom script: call RemoveLocation(udg_TempPoint1)
      • Wait (Random real number between 120.00 and 240.00) seconds
      • Destructible - Resurrect (Dying destructible) with (Max life of (Dying destructible)) life and Show birth animation
And I just don't know why it's not working.

Just to point it out, I do recall hearing something about a little bug in WarCraft where the game doesn't respond to the "destructible within (Entire map) dies" condition over the amount of 60 activations, which really sucks. Is that actually true??

Edit: Sorry! Forgot to mention exactly what the problem was. The problem is nothing ever drops when a tree is killed (with the proper item carried), and as far as I know, the entire trigger as a whole fails to activate as it's supposed to.
 
Last edited:
Just do 2 triggers
  • Events
    • Map initalization
  • conditions
  • actions
    • Destructable - Pick every destructable in (playable map area) Trigger - Add to DestructableDeath the event (Picked destructable (Dies))
  • Destructable death
    • Events
    • Conditions
    • Actions
      • Item - Create 1 Basic Wood at (Position of dying unit)
      • Wait (Random blah blah) seconds
      • Destructable - Revive Dying destructable with max life of dying destructable
 
Level 6
Joined
Apr 12, 2009
Messages
156
Alright, I think I might have found a solution, but you guys are gonna have to tell me what you think.

First-off:

  • Initialization
    • Events
    • Conditions
    • Actions
      • Destructible - Pick every destructible in (Playable map area) and do (Trigger - Add to Common Tree Spawn <gen> the event (Destructible - (Picked destructible) dies))
Then:

  • Common Tree Spawn
    • Events
    • Conditions
      • (Destructible-type of (Dying destructible)) Equal to Fall Tree Wall Common
    • Actions
      • Set TempPoint1 = (Position of (Dying destructible))
      • Region - Center Common Tree Drop Region <gen> on (Position of (Dying destructible))
      • Unit Group - Add all units of (Units in Common Tree Drop Region <gen> matching (((Picked unit) has an item of type Iron Hatchet) Equal to True)) to Harvesters
      • Trigger - Run Common Tree Drops <gen> (checking conditions)
      • Countdown Timer - Start TreeSpawn as a One-shot timer that will expire in (Random real number between 120.00 and 240.00) seconds
      • Destructible - Resurrect (Dying destructible) with (Max life of (Dying destructible)) life and Show birth animation
And finally:

  • Common Tree Drops
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (All units of Harvesters are in Common Tree Drop Region <gen>) Equal to True
        • Then - Actions
          • If ((Random integer number between 1 and 2) Equal to 1) then do (Item - Create Common Wood at TempPoint1) else do (Do nothing)
          • Custom script: call RemoveLocation(udg_TempPoint1)
        • Else - Actions
          • Custom script: call RemoveLocation(udg_TempPoint1)
Hmm?
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
Something like this?
  • DestructDies
    • Events
      • Destructible - A destructible within (Entire map) dies
    • Conditions
      • (Destructible-type of (Dying destructible)) Equal to Fall Tree Wall Common
    • Actions
      • Set RandInt = (Random integer number between 1 and 100)
      • Set Dest = (Dying destructible)
      • Set DestPoint = (Position of Dest)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RandInt Less than or equal to 25
        • Then - Actions
          • Item - Create Kelen's Dagger of Escape at DestPoint
        • Else - Actions
      • Custom script: call RemoveLocation (udg_DestPoint)
I haven't understood clearly what you want,if you want to also ressurect the tree just add 1 more line to the trigger which ressurects it.
 
Level 6
Joined
Apr 12, 2009
Messages
156
The root of the problem is that I need the tree only to drop wood if the killing Hero has a hatchet in their possession, because right now I'm having a good deal of trouble attaching the death of a destructible to a unit with a specific item in their inventory.

The triggers you have provided are fine, minus this problem and the missing regeneration which is covered.
 
Level 12
Joined
Apr 15, 2008
Messages
1,063
I guess the only way of killing a tree would be attacking it, right? (flamestriking while having the hatchet in inventory shouldn't work) So just detect when unit with Hatchet is issued order to attack destructible and when this destructible dies, check out if the ordered unit was close enough so it could be the unit.
 
Level 6
Joined
Apr 12, 2009
Messages
156
I think I might have another solution... I'll try it out.

But there is another thing I should mention: the only way I've found to enable the attacking of trees is through harvest, with no lumber capacity enabled. Is that the best way? Furthermore, does that constitute as attacking, or casting?

EDIT: So I created this trigger, which is a great deal more clean-cut then my previous one, and hopefully it will work. I assumed that harvest was not considered attacking but casting, but I could be wrong.

  • Initialization
    • Events
    • Conditions
    • Actions
      • Destructible - Pick every destructible in (Playable map area) and do (Trigger - Add to Common Tree Spawn <gen> the event (Destructible - (Picked destructible) dies))
  • Common Tree Harvest
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Hatchet
      • (Destructible-type of (Target destructible of ability being cast)) Equal to Fall Tree Wall Common
    • Actions
      • Set HarvestTree1 = (Target destructible of ability being cast)
      • Set TempPoint1 = (Position of (Target destructible of ability being cast))
  • Common Tree Spawn
    • Events
    • Conditions
      • (Dying destructible) Equal to HarvestTree1
    • Actions
      • If ((Random integer number between 1 and 2) Equal to 1) then do (Item - Create Common Wood at TempPoint1) else do (Do nothing)
      • Custom script: call RemoveLocation(udg_TempPoint1)
      • Countdown Timer - Start TreeSpawn as a One-shot timer that will expire in (Random real number between 120.00 and 240.00) seconds
      • Destructible - Resurrect (Dying destructible) with (Max life of (Dying destructible)) life and Show birth animation
So... feedback?
 
Last edited:
Level 12
Joined
Apr 15, 2008
Messages
1,063
Well since all workers have attack 2, that can target trees, I would assume that it is an attack. (If you really want to know, just create a trigger that detects order and displays its name, that would take about two minutes and you get exact results)

This would fail to work if there were two heroes harvesting at one moment, since you only have one variable.
 
Level 6
Joined
Apr 12, 2009
Messages
156
I am aware of this, but there are only three slots for players and only one hero for each, so it's not an issue to create two variables for each.

Attack two is already being used in my map for orbs modified into bows, crossbows, and firearms, but it did cross my mind.
 
Status
Not open for further replies.
Top