Remove destructible

Asdfblah1

New Member
Reaction score
10
Solved! - http://www.thehelper.net/forums/showthread.php?t=121893
Sorry for not searching first...The link above solved my problem (needed a wait)

For some reason when I try to remove a dying destructible, my map crashes.

Here are the two triggers.
Trigger:
  • Destructible - Pick every destructible in (Playable map area) and do (Actions)
    • Loop - Actions
      • Trigger - Add to Destructible Dies <gen> the event (Destructible - (Picked destructible) dies)

Trigger:
  • Destructible Dies
    • Events
    • Conditions
    • Actions
      • Destructible - Remove (Dying destructible)

Is there a correct way to achieve this?
 

shadowmapper

New Member
Reaction score
0
There seems to be some kind of delay (Wait) required between the event of the Destructible Dying and the Remove Destructible action. I'm messing around with this at the moment, and after setting a 2 second wait into the trigger, I no longer crashed. I then tested with a 0.10 second wait time, and again the destructible was successfully removed. This seems to me a bizarre logically error, but I'm still pretty green in the logic of JASS...

For example, this trigger will run with no problems.

Basic Function
Trigger:
  • Remove Destructible
    • Events
      • Player - Player 1 (Red) types a chat message containing -remove destructible as An exact match
    • Conditions
    • Actions
      • Destructible - Remove SPECIFIC DESTRUCTIBLE 5550


However, when the event references the destructible removed in the action, the trigger will cause WC3:TFT to end process immediately, without error message returning to the desktop/prompt. I.e...

Fatal Event Trigger
Trigger:
  • Remove Destructible
    • Events
      • Destructible - SPECIFIC DESTRUCTIBLE 5550 <gen> dies
    • Conditions
    • Actions
      • Destructible - Remove (Dying destructible)


Adding a Wait will prevent the crash, however I suspect if the wait is too short an older system might still crash...

Remove Dying Destructible (Working)
Trigger:
  • Remove Destructible
    • Events
      • Destructible - SPECIFIC DESTRUCTIBLE 5550 <gen> dies
    • Conditions
    • Actions
      • Wait 0.10 seconds
      • Destructible - Remove (Dying destructible)


I used the specific Destructible in the the action command, and the event response of 'dying destructible' and both worked fine. I assume using a destructible set in a variable for the event produce the same results, but have not tested it yet.

Inserting a Wait of between 0.10 and 1 second will probably not be very noticeable and seems a good fix, the only downside being that Waits produce memory leaks, although again, I don't exactly understand the impact of these memory leaks, basically I think the rule is the more the merrier, so a single or few 0.10 second waits will probably be insignificant, but if a whole forest of dying destructibles is being removed, for example, there might be issues.

I'm still searching for more information on this issue and a JASS script to accomplish the above triggers, but hopefully this post is of some help.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top