• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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,651
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
530
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