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

Destructable destroying trigger

Status
Not open for further replies.
Level 5
Joined
Dec 12, 2006
Messages
128
ok so i have a trigger
  • Cutting down
    • Events
      • Player - Player 1 (Red) Presses the Down Arrow key
    • Conditions
    • Actions
      • Unit - Order Player to Stop
      • Unit - Make Player face ((Position of Player) offset by (0.00, -100.00)) over 1.00 seconds
      • Region - Center Tree <gen> on ((Position of Player) offset by (0.00, -100.00))
      • Destructible - Pick every destructible in Tree <gen> and do (Set Tree[Tree_count] = (Picked destructible))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Destructible - Kill Tree[Tree_count]
          • -------- Insert add wood to player --------
          • Set Tree_count = (Tree_count + 1)
        • Else - Actions
          • Do nothing
It works but doesn't seem to destroy the destructables if there are more then one in the regioin. How should i fix this.
This is about the size of my region
l- - -l
l _ _ l
l_ _ _l
 
Level 9
Joined
Jun 26, 2007
Messages
659
  • Destructible - Pick every destructible in Tree <gen> and do (Set Tree[Tree_count] = (Picked destructible))
so you make
Tree[Tree_count] = first tree;
Tree[Tree_count] = second tree;
Tree[Tree_count] = third tree;
...
Tree[Tree_count] = last tree;

then you remove Tree[Tree_count], so the last one

1) your array is useless
2) if you want to make several action in a loop, you've to use "Multiple Actions"
3) you've only 1 action (kill) so you can simply do:
  • Destructible - Pick every destructible in Tree <gen> and do (Kill (Picked destructible))
_
PS: don't assume that you're trigger explain what you want to do, especially if it doesn't work; explicitly say what you want it to do, it could be usefull.
 
Status
Not open for further replies.
Top