• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Actions will not run

Status
Not open for further replies.
Level 37
Joined
Jul 22, 2015
Messages
3,485
It has been an extremely long time since I made a thread here, so I am pretty desperate xD

  • Unit Group - Pick every unit in InfectedGroup and do (Actions)
    • Loop - Actions
      • Set TempUnit = (Picked unit)
      • -------- checking if TempUnit died during infection --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (TempUnit is dead) Equal to True
        • Then - Actions
          • Trigger - Run Death <gen> (ignoring conditions)
        • Else - Actions
          • -------- TempUnit is still alive; do nothing --------

The Death trigger is supposed to run if a unit in InfectedGroup dies. However, debug messages reveal that the trigger is never ran, regardless of TempUnit dying. For whatever reason, it seems impossible to check if a unit in a Unit Group function is dead. I have tried IsUnitAlive = false, and even a real comparison of 0.405 , but the trigger is still not running.

Why will Then - Actions not run when I have the conditional statement IsUnitDead = true? On a side note, checking if the unit is alive works perfectly fine.
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
First general thing coming to mind in such situations is that non-hero units are removed from the game after their death time and after eventual decay.
Units do not have to have a decay though and cetain abilities disable it.

But as you seem to have checked the whole thing thoroughly it more likely is another trigger interfering. Or some other hardcoded interaction.

Enough with the babbling, I will give an explanation but please post a testmap (stripped from as many triggers as possible) depicting the issue :).
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
Ok, so if I'm getting this right you want to know why the side of the Loop trigger that runs very often does not fire the Death trigger.

It's simply because you set the unit to explode on death. It will disable death time and decay and the next time the loop runs the dead unit will be removed and therefore not be indexed.

Why do zombies spawn at the last run of the loop where the unit also explodes if it dies from the spell damage you might ask now. Well the removal of the unit is not instant. Thats why it still is existant (and dead) immediatly after getting the fatal damage and will be indexed.
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
It's simply because you set the unit to explode on death. It will disable death time and decay and the next time the loop runs the dead unit will be removed and therefore not be indexed.
This is odd. They are still present in the Unit Group, so that would mean that they are still "technically" in the game, right? Even though they are marked to explode on death, the Run Death <gen> function works at the end of the duration. It's really confusing to see it work at the end, but not during the loop o:

Why do zombies spawn at the last run of the loop where the unit also explodes if it dies from the spell damage you might ask now. Well the removal of the unit is not instant. Thats why it still is existant (and dead) immediatly after getting the fatal damage and will be indexed.
The way the spells work is if a unit dies with the "infection", they explode and spawn a zombie, which is why I have to constantly check if the unit dies DURING the duration, and if they die from the damage at the end of the duration.
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
This is odd. They are still present in the Unit Group, so that would mean that they are still "technically" in the game, right?
No, they are not when dying during the loop.

the Run Death <gen> function works at the end of the duration. It's really confusing to see it work at the end, but not during the loop o:
I tried to explain that in my previous post, here another explanation:

situation 1, infected unit dies during the loop:
-unit dies some time during two runs of the loop
-unit explosion and removal from the game happens in the next game frame after it died.
-loop runs again, the unit is removed though.

situation 2, infected unit dies on the last run of the loop from the final damage:
-unit dies from the final damage while in the final run of the loop
-unit is indexed immediatly after that and is still in the group
-after the loop in the next game frame the unit explodes and is removed from the game
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
No, they are not when dying during the loop.


I tried to explain that in my previous post, here another explanation:

situation 1, infected unit dies during the loop:
-unit dies some time during two runs of the loop
-unit explosion and removal from the game happens in the next game frame after it died.
-loop runs again, the unit is removed though.

situation 2, infected unit dies on the last run of the loop from the final damage:
-unit dies from the final damage while in the final run of the loop
-unit is indexed immediatly after that and is still in the group
-after the loop in the next game frame the unit explodes and is removed from the game
Thank you for the explanation :) I remember doing the test to see if the unit was still inside the unit group after death, in which I thought resulted in showing that the unit WAS still present. However, after running another test, it is confirmed that the unit was no longer there.
 
Status
Not open for further replies.
Top