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

[Spell] Destructible bug

Status
Not open for further replies.
Level 8
Joined
Nov 9, 2011
Messages
326
why isnt this working it wont even find the dying destructible dunno why.
  • Planks
    • Events
      • Destructible - A destructible within (Playable map area) dies
    • Conditions
      • (Destructible-type of (Dying destructible)) Equal to Summer Tree Wall (custom)
    • Actions
      • Set tempDestructible = (Dying destructible)
      • For each (Integer tempInt) from 1 to Tree_Counter, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • tempDestructible Equal to Tree[tempInt]
            • Then - Actions
              • Game - Display to (All players) the text: asdf
              • Set tempPoint = (Position of Tree[tempInt])
              • Item - Create Tome of Experience at tempPoint
              • Custom script: call RemoveLocation (udg_tempPoint)
            • Else - Actions
 
Level 8
Joined
Nov 9, 2011
Messages
326
The variable Tree (with arrays). Have you stored any destructable inside that variable? The problem might be there
Please show any related triggers.

Edit:
I think this thread should be moved to Triggers & Scripts.


  • Items Var
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Destructible - Pick every destructible in (Playable map area) 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>


this is what arrays all trees but even if they are arrayed it wont find when i use event - a destructible dies
 
Level 25
Joined
May 11, 2007
Messages
4,650
Well...
In the init trigger, you check (Destructible-type of (Picked destructible)) Equal to Summer Tree Wall

and in the second you check (Destructible-type of (Dying destructible)) Equal to Summer Tree Wall (custom)

that's two different tree types, so no wonder your "dying" trigger doesn't work. :)
 
Level 13
Joined
Mar 29, 2012
Messages
542
Also, are you intending to drop an item when a specific type of tree dies?
If so, you might don't need that 'if' block.
Just keep these
  • Game - Display to (All players) the text: asdf
  • Set tempPoint = (Position of Tree[tempInt])
  • Item - Create Tome of Experience at tempPoint
  • Custom script: call RemoveLocation (udg_tempPoint)
and delete the others.
 
Level 8
Joined
Nov 9, 2011
Messages
326
Also, are you intending to drop an item when a specific type of tree dies?
If so, you might don't need that 'if' block.
Just keep these
  • Game - Display to (All players) the text: asdf
  • Set tempPoint = (Position of Tree[tempInt])
  • Item - Create Tome of Experience at tempPoint
  • Custom script: call RemoveLocation (udg_tempPoint)
and delete the others.

new trigger man and thanks for help


  • Planks
    • Events
      • Destructible - A destructible within (Playable map area) dies
    • Conditions
      • (Destructible-type of (Dying destructible)) Equal to TreeType
    • Actions
      • Game - Display to (All players) the text: dead
      • Set tempPoint = (Position of (Dying destructible))
      • Item - Create DroppedItems_Plank at tempPoint
      • Set tempItem = (Last created item)
      • Item - Set charges remaining in tempItem to (Random integer number between 1 and 3)
      • Custom script: call RemoveLocation (udg_tempPoint)
      • Set tempItem = No item

and it works fine
 
Status
Not open for further replies.
Top