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

[Trigger] Pick every distructible (trees)

Status
Not open for further replies.
Level 8
Joined
Nov 9, 2011
Messages
326
why does the
  • Destructible - Pick every destructible in (Entire map) and do (Actions)
pick 2 times the tree? does it pick its dead version ?


here is a trigger demonstrating the 'bug'. i ve put 15 trees on my map and my debug says it has 30 ? which kinda screws my trigger where tree dies and creates an item only now it counts it twice thus 2 items.


  • Items Var
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Destructible - Pick every destructible in (Entire map) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Picked destructible)) Equal to Summer Tree Wall
              • ((Picked destructible) is alive) Equal to True
            • Then - Actions
              • Set Tree_Counter = (Tree_Counter + 1)
              • Set Tree_CreateItem[Tree_Counter] = 0
              • Game - Display to (All players) the text: (String(Tree_Counter))
              • Set Tree[Tree_Counter] = (Picked destructible)
            • Else - Actions
      • Trigger - Turn on Planks <gen>
      • Set treetempInt = 0



  • Planks
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer treetempInt) from 1 to Tree_Counter, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Tree[treetempInt] is alive) Equal to False
              • Tree_CreateItem[treetempInt] Equal to 0
            • Then - Actions
              • Set Tree_CreateItem[treetempInt] = 1
              • Game - Display to (All players) the text: asdf
              • Set tempPoint = (Position of Tree[treetempInt])
              • Item - Create Tome of Experience at tempPoint
              • Custom script: call RemoveLocation (udg_tempPoint)
            • Else - Actions
 
Status
Not open for further replies.
Top