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

[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