[Solved] Destructible Dying Trigger Bug?

Level 5
Joined
Jun 24, 2024
Messages
59
Hi guys,

i wonder why this does not work, is the destructible trigger not functional? i don't even get the message when the event happens.
I have also tried playable boundaries and whole map but no luck.. Here are my triggers:

  • Itemdrops
    • Events
      • Destructible - A destructible within Arena <gen> dies
    • Conditions
      • (Destructible-type of (Dying destructible)) Equal to Lootbox
    • Actions
      • Game - Display to (All players) the text: It goes
      • Set VariableSet RandomItemIDRange = 0
      • Set VariableSet RandomNumberGen = 0
      • Set VariableSet SelectedItemType = Empty Vial
      • Set VariableSet SelectedItemID = 0
      • -------- --------
      • For each (Integer A) from 1 to RandomItemID, do (Actions)
        • Loop - Actions
          • Set VariableSet RandomItemIDRange = (RandomItemIDRange + RandomItemWeight[(Integer A)])
      • Set VariableSet RandomNumberGen = (Random integer number between 1 and RandomItemIDRange)
      • For each (Integer A) from 1 to RandomItemID, do (Actions)
        • Loop - Actions
          • Set VariableSet RandomNumberGen = (RandomNumberGen - RandomItemWeight[(Integer A)])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RandomNumberGen Less than 0
            • Then - Actions
              • Set VariableSet SelectedItemType = RandomItemType[(Integer A)]
              • Item - Create SelectedItemType at (Position of (Dying destructible))
              • Custom script: set bj_forLoopAIndex = bj_forLoopAIndexEnd
            • Else - Actions
Edit: I also tested without the condition and only the Event + Send Message to player, but nothing
 
Level 5
Joined
Jun 24, 2024
Messages
59
The thing is, they all get spawned in with another trigger. There is no initial Destructibles on the map.
Can i maybe go around the Event? there is only 2 of those, a Destructibles dies in Area X or a specific Destructibles dies...

I just noticed that a simple trigger of "Unit dies-> create Destructible at Unit location" does not work either. Maybe all Destructible triggers are defect?
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
The thing is, they all get spawned in with another trigger. There is no initial Destructibles on the map.
Can i maybe go around the Event? there is only 2 of those, a Destructibles dies in Area X or a specific Destructibles dies...

I just noticed that a simple trigger of "Unit dies-> create Destructible at Unit location" does not work either. Maybe all Destructible triggers are defect?
If they spawn in with another trigger then it's even easier. Register them at that time.
  • Actions
    • Destructible - Create a Summer Tree Wall at (Center of (Playable map area)) facing (Random angle) with scale 1.00 and variation 0
    • Trigger - Add to Itemdrops <gen> the event (Destructible - (Last created destructible) dies)
  • Itemdrops
    • Events
    • Conditions
    • Actions
      • Game - Display to (All players) the text: It goes
      • Set VariableSet RandomItemIDRange = 0
      • Set VariableSet RandomNumberGen = 0
      • Set VariableSet SelectedItemType = Empty Vial
      • Set VariableSet SelectedItemID = 0
      • -------- --------
      • For each (Integer A) from 1 to RandomItemID, do (Actions)
        • Loop - Actions
          • Set VariableSet RandomItemIDRange = (RandomItemIDRange + RandomItemWeight[(Integer A)])
      • Set VariableSet RandomNumberGen = (Random integer number between 1 and RandomItemIDRange)
      • For each (Integer A) from 1 to RandomItemID, do (Actions)
        • Loop - Actions
          • Set VariableSet RandomNumberGen = (RandomNumberGen - RandomItemWeight[(Integer A)])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RandomNumberGen Less than 0
            • Then - Actions
              • Set VariableSet SelectedItemType = RandomItemType[(Integer A)]
              • Item - Create SelectedItemType at (Position of (Dying destructible))
              • Custom script: set bj_forLoopAIndex = bj_forLoopAIndexEnd
            • Else - Actions
 
Level 5
Joined
Jun 24, 2024
Messages
59
Amazing, this works so well... I wonder where i took a wrong turn.. A Trigger without a event or condition is a new one for me :D

Thx Uncle!

Edit: can i ask you a unrelated new question here? It's about aggro (Mobs from P9 wander to P2 (who is attacking creeps from p9 quite a bit away) and Igore me (while attacking them) and sometimes switch back aggro to me which results in them being indecisive and switching aggro too often)
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
Custom script: set bj_forLoopAIndex = bj_forLoopAIndexEnd
There's a simpler shortcut. The exitwhen keyword takes a boolean value after it. If the boolean is true the loop immediately exits and proceeds (but won't set the incremented variable to the final possible value if that matters to you).

exitwhen true is the loop version of a raw return.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Amazing, this works so well... I wonder where i took a wrong turn.. A Trigger without a event or condition is a new one for me :D

Thx Uncle!

Edit: can i ask you a unrelated new question here? It's about aggro (Mobs from P9 wander to P2 (who is attacking creeps from p9 quite a bit away) and Igore me (while attacking them) and sometimes switch back aggro to me which results in them being indecisive and switching aggro too often)
No problem. I don't know much about AI scripts/behavior in general, but I do know that:
1) AI Guard Position can control how units move around (units return to their "posts"). Doesn't sound like the issue here, though.
2) Certain Armor types can dictate AI decisions, like Fortified armor is more likely to get ignored.
3) Manually issued Orders like "Attack that unit" SHOULD override their AI but likely need to be re-applied again and again.
 
Last edited:
Top