• 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] Remove Tree stump after death animation

Level 7
Joined
Feb 22, 2009
Messages
260
I tried multiple ways from detecting destructible hit point to matching condition of destructible to be tree (dead) but they didn't work.

What I need to do:

_ Tree plays death animation + sound
_ Tree stump disappear


Is there any solution?
 
I think it should work if you simply:
  1. Detect when a tree dies
  2. Start a one-shot timer for the death animation duration, and then remove the tree
Unfortunately, we don't have access to the animation data in our code, so you'll have to configure it manually. In the sample map below, I have it configured in JASS like so:
JASS:
    globals
        private constant real DEFAULT_DEATH_ANIMATION_TIME = 1.5
        private hashtable dataTable = null
    endglobals

    private function ConfigureAnimationTimes takes nothing returns nothing
        call SaveReal(dataTable, 'ATtr', 0, DEFAULT_DEATH_ANIMATION_TIME) // Ashenvale Tree Wall
        call SaveReal(dataTable, 'ATtc', 0, DEFAULT_DEATH_ANIMATION_TIME) // Ashenvale Canopy Tree 
        call SaveReal(dataTable, 'BTtw', 0, DEFAULT_DEATH_ANIMATION_TIME) // Barrens Tree Wall
        call SaveReal(dataTable, 'BTtc', 0, DEFAULT_DEATH_ANIMATION_TIME) // Barrens Canopy Tree
        call SaveReal(dataTable, 'KTtw', 0, DEFAULT_DEATH_ANIMATION_TIME) // Black Citadel Tree Wall
        call SaveReal(dataTable, 'YTft', 0, DEFAULT_DEATH_ANIMATION_TIME) // Cityscape Fall Tree Wall
        call SaveReal(dataTable, 'YTst', 0, DEFAULT_DEATH_ANIMATION_TIME) // Cityscape Snowy Tree Wall
        call SaveReal(dataTable, 'YTct', 0, DEFAULT_DEATH_ANIMATION_TIME) // Cityscape Summer Tree Wall
        call SaveReal(dataTable, 'YTwt', 0, DEFAULT_DEATH_ANIMATION_TIME) // Cityscape Winter Tree Wall
        call SaveReal(dataTable, 'Ytsc', 0, DEFAULT_DEATH_ANIMATION_TIME) // Scorched Tree Wall
        call SaveReal(dataTable, 'Yts1', 0, DEFAULT_DEATH_ANIMATION_TIME) // Silvermoon Tree
        call SaveReal(dataTable, 'JTct', 0, DEFAULT_DEATH_ANIMATION_TIME) // Cityscape Ruined Tree Wall
        call SaveReal(dataTable, 'JTtw', 0, DEFAULT_DEATH_ANIMATION_TIME) // Dalaran Ruins Tree Wall
        call SaveReal(dataTable, 'DTsh', 0, DEFAULT_DEATH_ANIMATION_TIME) // Dungeon Tree Wall
        call SaveReal(dataTable, 'CTtr', 0, DEFAULT_DEATH_ANIMATION_TIME) // Felwood Tree Wall
        call SaveReal(dataTable, 'CTtc', 0, DEFAULT_DEATH_ANIMATION_TIME) // Felwood Canopy Tree
        call SaveReal(dataTable, 'ITtw', 0, DEFAULT_DEATH_ANIMATION_TIME) // Icecrown Tree Wall
        call SaveReal(dataTable, 'ITtc', 0, DEFAULT_DEATH_ANIMATION_TIME) // Icecrown Canopy Tree
        call SaveReal(dataTable, 'NTtc', 0, DEFAULT_DEATH_ANIMATION_TIME) // Northrend Canopy Tree
        call SaveReal(dataTable, 'FTtw', 0, DEFAULT_DEATH_ANIMATION_TIME) // Fall Tree Wall
        call SaveReal(dataTable, 'LTlt', 0, DEFAULT_DEATH_ANIMATION_TIME) // Summer Tree Wall
        call SaveReal(dataTable, 'WTst', 0, DEFAULT_DEATH_ANIMATION_TIME) // Snowy Tree Wall
        call SaveReal(dataTable, 'WTtw', 0, DEFAULT_DEATH_ANIMATION_TIME) // Winter Tree Wall
        call SaveReal(dataTable, 'NTiw', 0, DEFAULT_DEATH_ANIMATION_TIME) // Northrend Icy Tree Wall
        call SaveReal(dataTable, 'NTtw', 0, DEFAULT_DEATH_ANIMATION_TIME) // Northrend Tree Wall
        call SaveReal(dataTable, 'OTtw', 0, DEFAULT_DEATH_ANIMATION_TIME) // Outland Tree Wall
        call SaveReal(dataTable, 'ZTtw', 0, DEFAULT_DEATH_ANIMATION_TIME) // Ruins Tree Wall
        call SaveReal(dataTable, 'ZTtc', 0, DEFAULT_DEATH_ANIMATION_TIME) // Ruins Canopy Tree
        call SaveReal(dataTable, 'GTsh', 0, DEFAULT_DEATH_ANIMATION_TIME) // Underground Tree Wall
        call SaveReal(dataTable, 'VTlt', 0, DEFAULT_DEATH_ANIMATION_TIME) // Village Tree Wall
    endfunction

And then I have some code to detect when a destructable dies, and then some logic that removes the stump if it is configured in the section above^ (see the trigger "StumpRemover"). This code works for any pre-placed destructables (it can be modified to work with dynamically spawned ones too, but I didn't add that).

You can tweak the DEFAULT_DEATH_ANIMATION_TIME value (e.g. below 1.5) to whatever best fits the look you're going for. Or if you have a custom tree, you can add it to that list and specify any animation duration you'd like. If you want to modify the map, make sure in the Trigger Editor that you go to JassHelper > Enable vJASS.

This is possible in GUI too but it might just be a bit of effort writing it out.
 

Attachments

  • DestructableDeathSample.w3m
    17.7 KB · Views: 2

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,871
Here's a little system I made for detecting when ANY destructible dies. Unsure if it leaks or has other issues but the demo map seems to work great.

It also includes an example of Removing a dead Tree after 1.5 seconds (see OnEvent Remove Trees).

If you use this in your own map then you'll need to create two 1024x1024 Regions like the ones I use in the Demo map. One Region goes in the top left corner of the map and the other goes in the bottom right corner of the map. The Regions must remain within the playable map bounds. If you're confused, just look at how I did it in the demo map and recreate exactly that.
 

Attachments

  • Any Destructible Dies 1.w3m
    21.9 KB · Views: 3
Last edited:
Here's a little system I made for detecting when ANY destructible dies. Unsure if it leaks or has other issues but the demo map seems to work great.
I initially was planning on doing something similar to what you did, but the funny thing with the "Destructable within region dies" event is that it ultimately just ends up enumerating the destructables in the region and then manually adding a "Destructable dies" event for each of them. And the 64 destructable limit is just an arbitrary one that they put in, haha. :grin:

Lua:
-- ===========================================================================
function RegisterDestDeathInRegionEnum()
    bj_destInRegionDiesCount = bj_destInRegionDiesCount + 1
    if (bj_destInRegionDiesCount <= bj_MAX_DEST_IN_REGION_EVENTS) then -- max limit enforced here
        TriggerRegisterDeathEvent(bj_destInRegionDiesTrig, GetEnumDestructable())
    end
end
-- ===========================================================================
---@param trig trigger
---@param r rect
function TriggerRegisterDestDeathInRegionEvent(trig, r)
    bj_destInRegionDiesTrig = trig
    bj_destInRegionDiesCount = 0
    EnumDestructablesInRect(r, nil, RegisterDestDeathInRegionEnum)
end

But it actually works fine even if there are more than 64 destructables. It may have been a performance limit back in the day, not really sure. So it is probably better to just "Pick every destructable in region..." and then register the "Destructable dies" event for each of them manually!
 
Level 7
Joined
Feb 22, 2009
Messages
260
I think it should work if you simply:
  1. Detect when a tree dies
  2. Start a one-shot timer for the death animation duration, and then remove the tree
Unfortunately, we don't have access to the animation data in our code, so you'll have to configure it manually. In the sample map below, I have it configured in JASS like so:
JASS:
    globals
        private constant real DEFAULT_DEATH_ANIMATION_TIME = 1.5
        private hashtable dataTable = null
    endglobals

    private function ConfigureAnimationTimes takes nothing returns nothing
        call SaveReal(dataTable, 'ATtr', 0, DEFAULT_DEATH_ANIMATION_TIME) // Ashenvale Tree Wall
        call SaveReal(dataTable, 'ATtc', 0, DEFAULT_DEATH_ANIMATION_TIME) // Ashenvale Canopy Tree
        call SaveReal(dataTable, 'BTtw', 0, DEFAULT_DEATH_ANIMATION_TIME) // Barrens Tree Wall
        call SaveReal(dataTable, 'BTtc', 0, DEFAULT_DEATH_ANIMATION_TIME) // Barrens Canopy Tree
        call SaveReal(dataTable, 'KTtw', 0, DEFAULT_DEATH_ANIMATION_TIME) // Black Citadel Tree Wall
        call SaveReal(dataTable, 'YTft', 0, DEFAULT_DEATH_ANIMATION_TIME) // Cityscape Fall Tree Wall
        call SaveReal(dataTable, 'YTst', 0, DEFAULT_DEATH_ANIMATION_TIME) // Cityscape Snowy Tree Wall
        call SaveReal(dataTable, 'YTct', 0, DEFAULT_DEATH_ANIMATION_TIME) // Cityscape Summer Tree Wall
        call SaveReal(dataTable, 'YTwt', 0, DEFAULT_DEATH_ANIMATION_TIME) // Cityscape Winter Tree Wall
        call SaveReal(dataTable, 'Ytsc', 0, DEFAULT_DEATH_ANIMATION_TIME) // Scorched Tree Wall
        call SaveReal(dataTable, 'Yts1', 0, DEFAULT_DEATH_ANIMATION_TIME) // Silvermoon Tree
        call SaveReal(dataTable, 'JTct', 0, DEFAULT_DEATH_ANIMATION_TIME) // Cityscape Ruined Tree Wall
        call SaveReal(dataTable, 'JTtw', 0, DEFAULT_DEATH_ANIMATION_TIME) // Dalaran Ruins Tree Wall
        call SaveReal(dataTable, 'DTsh', 0, DEFAULT_DEATH_ANIMATION_TIME) // Dungeon Tree Wall
        call SaveReal(dataTable, 'CTtr', 0, DEFAULT_DEATH_ANIMATION_TIME) // Felwood Tree Wall
        call SaveReal(dataTable, 'CTtc', 0, DEFAULT_DEATH_ANIMATION_TIME) // Felwood Canopy Tree
        call SaveReal(dataTable, 'ITtw', 0, DEFAULT_DEATH_ANIMATION_TIME) // Icecrown Tree Wall
        call SaveReal(dataTable, 'ITtc', 0, DEFAULT_DEATH_ANIMATION_TIME) // Icecrown Canopy Tree
        call SaveReal(dataTable, 'NTtc', 0, DEFAULT_DEATH_ANIMATION_TIME) // Northrend Canopy Tree
        call SaveReal(dataTable, 'FTtw', 0, DEFAULT_DEATH_ANIMATION_TIME) // Fall Tree Wall
        call SaveReal(dataTable, 'LTlt', 0, DEFAULT_DEATH_ANIMATION_TIME) // Summer Tree Wall
        call SaveReal(dataTable, 'WTst', 0, DEFAULT_DEATH_ANIMATION_TIME) // Snowy Tree Wall
        call SaveReal(dataTable, 'WTtw', 0, DEFAULT_DEATH_ANIMATION_TIME) // Winter Tree Wall
        call SaveReal(dataTable, 'NTiw', 0, DEFAULT_DEATH_ANIMATION_TIME) // Northrend Icy Tree Wall
        call SaveReal(dataTable, 'NTtw', 0, DEFAULT_DEATH_ANIMATION_TIME) // Northrend Tree Wall
        call SaveReal(dataTable, 'OTtw', 0, DEFAULT_DEATH_ANIMATION_TIME) // Outland Tree Wall
        call SaveReal(dataTable, 'ZTtw', 0, DEFAULT_DEATH_ANIMATION_TIME) // Ruins Tree Wall
        call SaveReal(dataTable, 'ZTtc', 0, DEFAULT_DEATH_ANIMATION_TIME) // Ruins Canopy Tree
        call SaveReal(dataTable, 'GTsh', 0, DEFAULT_DEATH_ANIMATION_TIME) // Underground Tree Wall
        call SaveReal(dataTable, 'VTlt', 0, DEFAULT_DEATH_ANIMATION_TIME) // Village Tree Wall
    endfunction

And then I have some code to detect when a destructable dies, and then some logic that removes the stump if it is configured in the section above^ (see the trigger "StumpRemover"). This code works for any pre-placed destructables (it can be modified to work with dynamically spawned ones too, but I didn't add that).

You can tweak the DEFAULT_DEATH_ANIMATION_TIME value (e.g. below 1.5) to whatever best fits the look you're going for. Or if you have a custom tree, you can add it to that list and specify any animation duration you'd like. If you want to modify the map, make sure in the Trigger Editor that you go to JassHelper > Enable vJASS.

This is possible in GUI too but it might just be a bit of effort writing it out.

Here's a little system I made for detecting when ANY destructible dies. Unsure if it leaks or has other issues but the demo map seems to work great.

It also includes an example of Removing a dead Tree after 1.5 seconds (see OnEvent Remove Trees).

If you use this in your own map then you'll need to create two 1024x1024 Regions like the ones I use in the Demo map. One Region goes in the top left corner of the map and the other goes in the bottom right corner of the map. The Regions must remain within the playable map bounds. If you're confused, just look at how I did it in the demo map and recreate exactly that.


So both of these examples require war 3 latest patch?

I don't think my 1.30.04 patch will be able to use this.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,871
So both of these examples require war 3 latest patch?

I don't think my 1.30.04 patch will be able to use this.
No, they should work on any patch.

Here's my setup, although like Purge said this may be overkill and you could probably simplify it. I'm just being safe here because I recall running into issues trying to do this before:
  • AnyDD Setup
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set VariableSet AnyDD_Point[0] = (Center of TopLeftCorner1024x1024 <gen>)
      • Set VariableSet AnyDD_Point[1] = (Center of BotRightCorner1024x1024 <gen>)
      • Set VariableSet AnyDD_X = (X of AnyDD_Point[0])
      • Set VariableSet AnyDD_Y = (Y of AnyDD_Point[0])
      • Set VariableSet AnyDD_Last_Row = False
      • Set VariableSet AnyDD_Break = False
      • -------- --------
      • For each (Integer A) from 1 to 1000, do (Actions)
        • Loop - Actions
          • Set VariableSet AnyDD_Point[2] = (Point(AnyDD_X, AnyDD_Y))
          • Set VariableSet AnyDD_Region = (Region centered at AnyDD_Point[2] with size (1024.00, 1024.00))
          • -------- --------
          • -------- Register up to 64 Destructibles within the new Region: --------
          • Trigger - Add to AnyDD Event <gen> the event (Destructible - A destructible within AnyDD_Region dies)
          • -------- --------
          • -------- Clean up rect memory leak (regions are technically rects in GUI): --------
          • Custom script: call RemoveRect( udg_AnyDD_Region )
          • -------- --------
          • -------- Break out of loop after the last registered region: --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • AnyDD_Break Equal to True
            • Then - Actions
              • Custom script: call RemoveLocation( udg_AnyDD_Point[2] )
              • Skip remaining actions
            • Else - Actions
          • -------- --------
          • -------- Move the center of our region to the right so it can test new destructibles on the next loop cycle: --------
          • Set VariableSet AnyDD_X = (AnyDD_X + 1024.00)
          • -------- --------
          • -------- Drop down a row and check if we're finished: --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • AnyDD_Last_Row Equal to False
              • (AnyDD_X + 1.00) Greater than or equal to (X of AnyDD_Point[1])
            • Then - Actions
              • Set VariableSet AnyDD_X = (X of AnyDD_Point[0])
              • Set VariableSet AnyDD_Y = (AnyDD_Y - 1024.00)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (AnyDD_Y - 1.00) Less than or equal to (Y of AnyDD_Point[1])
                • Then - Actions
                  • Set VariableSet AnyDD_Last_Row = True
                • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • AnyDD_Last_Row Equal to True
                  • (AnyDD_X + 1.00) Greater than or equal to (X of AnyDD_Point[1])
                • Then - Actions
                  • Set VariableSet AnyDD_Break = True
                • Else - Actions
          • -------- --------
          • Custom script: call RemoveLocation( udg_AnyDD_Point[2] )
      • -------- --------
      • Custom script: call RemoveLocation( udg_AnyDD_Point[0] )
      • Custom script: call RemoveLocation( udg_AnyDD_Point[1] )
  • AnyDD Event
    • Events
    • Conditions
      • ((Dying destructible) is invulnerable) Equal to False
    • Actions
      • -------- Note: --------
      • -------- The Invulnerability stuff is used to prevent the Event from running multiple times on the same Destructible. --------
      • -------- Keep in mind that toggling the Invulnerability status may cause unforeseen consequences. --------
      • -------- --------
      • Set VariableSet AnyDD_Destructible = (Dying destructible)
      • Destructible - Make AnyDD_Destructible Invulnerable
      • Set VariableSet AnyDD_Event = 0.00
      • Set VariableSet AnyDD_Event = 1.00
      • Set VariableSet AnyDD_Event = 0.00
1743430792379.png

1743430856125.png


^ Once all of the above is setup, you would use this system to Remove the Tree stump like so:
  • OnEvent Remove Trees
    • Events
      • Game - AnyDD_Event becomes Equal to 1.00
    • Conditions
      • (Destructible-type of AnyDD_Destructible) Equal to Summer Tree Wall
    • Actions
      • -------- Note: --------
      • -------- This Event runs whenever a Destructible dies. Use the variable AnyDD_Destructible to interact with the dead Destructible! --------
      • -------- --------
      • Custom script: local destructable d = udg_AnyDD_Destructible
      • Wait 1.50 game-time seconds
      • Custom script: set udg_AnyDD_Destructible = d
      • Custom script: set d = null
      • Destructible - Remove AnyDD_Destructible
This Event runs whenever a Destructible dies. Change the Condition to match your Tree-Type, you can use OR to check multiple types.

Imagine that the Event says Destructible - A destructible dies and that the AnyDD_Destructible variable is the (Dying destructible) Event Response.
 
Last edited:
Level 7
Joined
Feb 22, 2009
Messages
260
No, they should work on any patch.

Here's my setup, although like Purge said this may be overkill and you could probably simplify it. I'm just being safe here because I recall running into issues trying to do this before:
  • AnyDD Setup
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set VariableSet AnyDD_Point[0] = (Center of TopLeftCorner1024x1024 <gen>)
      • Set VariableSet AnyDD_Point[1] = (Center of BotRightCorner1024x1024 <gen>)
      • Set VariableSet AnyDD_X = (X of AnyDD_Point[0])
      • Set VariableSet AnyDD_Y = (Y of AnyDD_Point[0])
      • Set VariableSet AnyDD_Last_Row = False
      • Set VariableSet AnyDD_Break = False
      • -------- --------
      • For each (Integer A) from 1 to 1000, do (Actions)
        • Loop - Actions
          • Set VariableSet AnyDD_Point[2] = (Point(AnyDD_X, AnyDD_Y))
          • Set VariableSet AnyDD_Region = (Region centered at AnyDD_Point[2] with size (1024.00, 1024.00))
          • -------- --------
          • -------- Register up to 64 Destructibles within the new Region: --------
          • Trigger - Add to AnyDD Event <gen> the event (Destructible - A destructible within AnyDD_Region dies)
          • -------- --------
          • -------- Clean up rect memory leak (regions are technically rects in GUI): --------
          • Custom script: call RemoveRect( udg_AnyDD_Region )
          • -------- --------
          • -------- Break out of loop after the last registered region: --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • AnyDD_Break Equal to True
            • Then - Actions
              • Custom script: call RemoveLocation( udg_AnyDD_Point[2] )
              • Skip remaining actions
            • Else - Actions
          • -------- --------
          • -------- Move the center of our region to the right so it can test new destructibles on the next loop cycle: --------
          • Set VariableSet AnyDD_X = (AnyDD_X + 1024.00)
          • -------- --------
          • -------- Drop down a row and check if we're finished: --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • AnyDD_Last_Row Equal to False
              • (AnyDD_X + 1.00) Greater than or equal to (X of AnyDD_Point[1])
            • Then - Actions
              • Set VariableSet AnyDD_X = (X of AnyDD_Point[0])
              • Set VariableSet AnyDD_Y = (AnyDD_Y - 1024.00)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (AnyDD_Y - 1.00) Less than or equal to (Y of AnyDD_Point[1])
                • Then - Actions
                  • Set VariableSet AnyDD_Last_Row = True
                • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • AnyDD_Last_Row Equal to True
                  • (AnyDD_X + 1.00) Greater than or equal to (X of AnyDD_Point[1])
                • Then - Actions
                  • Set VariableSet AnyDD_Break = True
                • Else - Actions
          • -------- --------
          • Custom script: call RemoveLocation( udg_AnyDD_Point[2] )
      • -------- --------
      • Custom script: call RemoveLocation( udg_AnyDD_Point[0] )
      • Custom script: call RemoveLocation( udg_AnyDD_Point[1] )
  • AnyDD Event
    • Events
    • Conditions
      • ((Dying destructible) is invulnerable) Equal to False
    • Actions
      • -------- Note: --------
      • -------- The Invulnerability stuff is used to prevent the Event from running multiple times on the same Destructible. --------
      • -------- Keep in mind that toggling the Invulnerability status may cause unforeseen consequences. --------
      • -------- --------
      • Set VariableSet AnyDD_Destructible = (Dying destructible)
      • Destructible - Make AnyDD_Destructible Invulnerable
      • Set VariableSet AnyDD_Event = 0.00
      • Set VariableSet AnyDD_Event = 1.00
      • Set VariableSet AnyDD_Event = 0.00
View attachment 519937
View attachment 519938

^ Once all of the above is setup, you would use this system to Remove the Tree stump like so:
  • OnEvent Remove Trees
    • Events
      • Game - AnyDD_Event becomes Equal to 1.00
    • Conditions
      • (Destructible-type of AnyDD_Destructible) Equal to Summer Tree Wall
    • Actions
      • -------- Note: --------
      • -------- This Event runs whenever a Destructible dies. Use the variable AnyDD_Destructible to interact with the dead Destructible! --------
      • -------- --------
      • Custom script: local destructable d = udg_AnyDD_Destructible
      • Wait 1.50 game-time seconds
      • Custom script: set udg_AnyDD_Destructible = d
      • Custom script: set d = null
      • Destructible - Remove AnyDD_Destructible
This Event runs whenever a Destructible dies. Change the Condition to match your Tree-Type, you can use OR to check multiple types.

Imagine that the Event says Destructible - A destructible dies and that the AnyDD_Destructible variable is the (Dying destructible) Event Response.


I noticed that it has an issue.


Lumber harvesting workers will stop harvesting if the last hit that completely fills their carrying load coincides with the last hit that kills the tree.

It happened the most obvious with goblin shredder. He killed the tree and filled his carrying load with his 20th hit. He returned the lumber but would stop harvesting completely.

It occurred similarly to peasants too.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,871
It's because the Destructible is made Invulnerable. I noted how you can modify that behavior if it caused "unforeseen consequences".

Here's a less lazy approach, I use a Hashtable to track the state so that we don't have to mess with any weird functions:
  • AnyDD Setup
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set VariableSet AnyDD_Cleanup_Hash = (Last created hashtable)
      • ... Everything else remains the same
  • AnyDD Event
    • Events
    • Conditions
      • (Load 0 of (Key (Dying destructible).) from AnyDD_Cleanup_Hash.) Equal to False
    • Actions
      • -------- Note: --------
      • -------- The Condition + Hashtable stuff is meant to avoid running the trigger again in case a Destructible was registered 2+ times. --------
      • -------- --------
      • -------- Clean up the Hashtable every 50 deaths: --------
      • Set VariableSet AnyDD_Cleanup_Counter = (AnyDD_Cleanup_Counter + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AnyDD_Cleanup_Counter Equal to 50
        • Then - Actions
          • Set VariableSet AnyDD_Cleanup_Counter = 0
          • Hashtable - Clear AnyDD_Cleanup_Hash
        • Else - Actions
      • -------- --------
      • -------- Prevent this destructible from running the trigger again: --------
      • Hashtable - Save True as 0 of (Key (Dying destructible).) in AnyDD_Cleanup_Hash.
      • -------- --------
      • Set VariableSet AnyDD_Destructible = (Dying destructible)
      • Set VariableSet AnyDD_Event = 0.00
      • Set VariableSet AnyDD_Event = 1.00
      • Set VariableSet AnyDD_Event = 0.00
 

Attachments

  • Any Destructible Dies 2.w3m
    22.8 KB · Views: 2
Last edited:
Top