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