• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[General] Destroy only trees

Status
Not open for further replies.
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!
 
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: https://www.hiveworkshop.com/forums/spells-569/bane-web-v-0-01-a-155240/
 
Status
Not open for further replies.
Back
Top