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

[General] Destroy only trees

Status
Not open for further replies.
Level 12
Joined
Apr 16, 2010
Messages
584
Hey everyone! I've got a question. Lets say i use this action to destroy trees:
  • Destructible - Pick every destructible within 1000 of Point and do (Destructible - Kill (Picked destructible))
But i only want to destroy trees, not bridges too, so what condition could i add to prevent the destruction of bridges? Yeah i can add a condition to check if destroy a Summer Tree Wall and other walls, but it's too long. So any ideas?
+rep for help!
 
Level 11
Joined
Jun 20, 2009
Messages
880
  • Trigger 1
  • Pick every destructible within 1000 of Point and do (Actions)
    • Loop
      • If Picked destructible == Summer Tree Wall
        • Destroy picked destructible
I can't use WE right now, so its not perfect :3
 
http://www.wc3c.net/showthread.php?t=103927
and add a custom script:
  • Custom script: if IsDestructableTree (GetEnumDestructable()) then
  • Destructible - Kill (Picked destructible)
  • Custom script: endif
D4RK_G4ND4LF also has a GUI solution for this (which is actually the same, in GUI):
  • Events
    • Map initialization
  • Conditions
  • Actions
    • -------- Initialize the dummy to check if a destructable is a tree --------
    • Set loc = (Point(0.00, 0.00))
    • Unit - Create 1 Peasant for Neutral Passive at loc facing 0.00 degrees
    • Unit - Hide (Last created unit)
    • Unit - Make (Last created unit) Invulnerable
    • Set harvester = (Last created unit)
    • Custom script: call RemoveLocation(udg_loc)
He creates a unit at the map initialization:
  • Destructible - Pick every destructible within 150.00 of loc and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current life of (Picked destructible)) Greater than 0.00
        • Then - Actions
          • Unit - Order harvester to Harvest (Picked destructible)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current order of harvester) Equal to (Order(harvest))
            • Then - Actions
              • Destructible - Kill (Picked destructible)
            • Else - Actions
              • Unit - Order harvester to Stop
      • Else - Actions
Example used: http://www.hiveworkshop.com/forums/spells-569/bane-web-v-0-01-a-155240/
 
Level 12
Joined
Apr 16, 2010
Messages
584
Wow you're quick!!! I'll see this one
Edit:
hmm if i got this right then: if you want to kill some destructible a dummy is created that start to harvest it, if it's harvestable then it's a tree, right? Nice idea! Genius! But nah i hate using dummies in spells. So i guess i'll just leave the poor tress where they are. Thanks again!
 
Status
Not open for further replies.
Top