Need help to fix a reviving trigger.

Level 6
Joined
Feb 20, 2020
Messages
164
The problem with this one is, sometimes it doesnt revive all the monster the player have... :

  • Healing and Reviving
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Heal Monsters
    • Actions
      • Set VariableSet TempPlayer = (Owner of (Hero manipulating item))
      • Set VariableSet PNRES = (Player number of TempPlayer)
      • -------- --------
      • Set VariableSet TempPoint = (Position of (Hero manipulating item))
      • Special Effect - Create a special effect at TempPoint using Abilities\Spells\NightElf\MoonWell\MoonWellCasterArt.mdl
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Set VariableSet Delayed_Duration = 2.00
      • Trigger - Run Delayed Destroy Effect <gen> (ignoring conditions)
      • -------- --------
      • Set VariableSet MonsterOutsideBall[PNRES] = 0
      • Set VariableSet TempGroup = (Units owned by TempPlayer.)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set VariableSet ChosenMonster = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of ChosenMonster) Not equal to Tamer
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (ChosenMonster is dead) Equal to True
                • Then - Actions
                  • Set VariableSet TempPoint = (Center of Player_Region[PNRES])
                  • Hero - Instantly revive ChosenMonster at TempPoint, Hide revival graphics
                  • Custom script: call RemoveLocation(udg_TempPoint)
                  • Unit - Set life of ChosenMonster to 100.00%
                  • Unit - Set mana of ChosenMonster to 100.00%
                • Else - Actions
                  • Unit - Set life of ChosenMonster to 100.00%
                  • Unit - Set mana of ChosenMonster to 100.00%
            • Else - Actions
          • -------- --------
          • -------- Move Chosen Monster --------
      • Custom script: call DestroyGroup (udg_TempGroup)
 
Level 6
Joined
Feb 20, 2020
Messages
164
They are heroes... and it works well most of the time...
idk what happens that sometimes, it just doesnt revive everyone.

example:
i have 6 heroes dead, i buy the item, it revives everyone, okay working!
then sometimes i try to revive everyone again, revive 5 of 6, and that hero is still in the save/load code, so if you save the game, restart and load,
this hero is saved...

And it is a multiplayer, so you have 4 players dying and reviving, and not everyone gets the bug...
 
Level 10
Joined
Feb 27, 2019
Messages
254
I believe the boolean condition (Unit) is dead = True only checks if the hit points of a unit is = 0.00
If the hit points of the unit is above 0.00 it will not be considered dead by the game.

This bug often happens with the Death Coil ability or if you increase the hit points of a dead unit.
 
Level 6
Joined
Feb 20, 2020
Messages
164
I believe the boolean condition (Unit) is dead = True only checks if the hit points of a unit is = 0.00
If the hit points of the unit is above 0.00 it will not be considered dead by the game.

This bug often happens with the Death Coil ability or if you increase the hit points of a dead unit.
what do you mean?
the game think the unit is alive while it is not?
how do i fix it?
 
Level 10
Joined
Feb 27, 2019
Messages
254
what do you mean?
the game think the unit is alive while it is not?
how do i fix it?
Yes, if you kill a unit and use a trigger to increase its hit points the game thinks the unit is alive, you can test it easily yourself:

Unit dies
Set hit points of (triggering unit) to 20.0
If (triggering unit) is dead = True
Then revive unit

The first thing would be to be sure that is the problem. So as the bug happens have some kind of command that allows to see the hit points of the unit not being revived.

Fixing it is to find the source of the problem. Per heaps you have a Death Coil like ability or you have a trigger that increases the hit points of a unit that needs to not increase hit points of dead units. For example you could debug by putting If units = dead then display text: Dead unit "X" recieved hit points while dead from "X" ability. Another fix would be to have your own boolean like MonsterIsDead() and set the True/False yourself.
 
Last edited:
Top