Problem related to GDD by weep

canons200

New Member
Reaction score
50
when the follow trigger take action, my w3 instantly closed and drop me out to the destop. Any problem with the trigger? i use the spell as roar, to place a buff on the unit, then the trigger take action on the buff as my hero attack. This spell supposes to make the hero normal attack into area of attack. (last time i use the event, a unit is attacked, it works fine, i just edit a bit to match the GDD system)
Code:
Lightning Buff
    Events
        Game - GDD_Event becomes Equal to 0.00
    Conditions
        (Unit-type of GDD_DamageSource) Equal to Lino 
        (GDD_DamagedUnit belongs to an enemy of (Owner of GDD_DamageSource)) Equal to True
        (GDD_DamageSource has buff Lightning Buff ) Equal to True
    Actions
        Set Lino = GDD_DamageSource
        Set U_AttackedUnitLB = GDD_DamagedUnit
        Set P_AttackedUnitLB = (Position of U_AttackedUnitLB)
        Set I_DamageLB = ((Agility of Lino (Include bonuses)) x ((Level of Lightning Buff lino for Lino)
        Set I_AreaOfEffectLB = (50 + (50 x ((Level of Lightning Buff lino for Lino)
        Set UG_DummyLB = (Units within (Real(I_AreaOfEffectLB)) of P_AttackedUnitLB)
        Unit Group - Pick every unit in UG_DummyLB and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) belongs to an enemy of (Owner of Lino)) Equal to True
                        ((Picked unit) is alive) Equal to True
                    Then - Actions
                        Unit - Cause Lino to damage (Picked unit), dealing (Real(I_DamageLB)) damage of attack type Spells and damage type Normal
                    Else - Actions
        Custom script:   call RemoveLocation (udg_P_AttackedUnitLB)
        Custom script:   call DestroyGroup (udg_UG_DummyLB)

i re-edit it and use only GDD data, same result, anyone know the problem?
Code:
Lightning Buff
    Events
        Game - GDD_Event becomes Equal to 0.00
    Conditions
        (Unit-type of GDD_DamageSource) Equal to Lino
        (GDD_DamagedUnit belongs to an enemy of (Owner of GDD_DamageSource)) Equal to True
        (GDD_DamageSource has buff Lightning Buff ) Equal to True
    Actions
        Set P_AttackedUnitLB = (Position of GDD_DamagedUnit)
        Set I_DamageLB = (((Agility of GDD_DamageSource (Include bonuses)) x ((Level of Lightning Buff for GDD_DamageSource)
        Set I_AreaOfEffectLB = (50 + (50 x ((Level of Lightning Buff for GDD_DamageSource) 
        Set UG_DummyLB = (Units within (Real(I_AreaOfEffectLB)) of P_AttackedUnitLB)
        Unit Group - Pick every unit in UG_DummyLB and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) belongs to an enemy of (Owner of GDD_DamageSource)) Equal to True
                        ((Picked unit) is alive) Equal to True
                    Then - Actions
                        Unit - Cause GDD_DamageSource to damage (Picked unit), dealing (Real(I_DamageLB)) damage of attack type Spells and damage type Normal
                    Else - Actions
        Custom script:   call RemoveLocation (udg_P_AttackedUnitLB)
        Custom script:   call DestroyGroup (udg_UG_DummyLB)
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
when the follow trigger take action, my w3 instantly closed and drop me out to the destop. Any problem with the trigger?
Trigger:
  • Lightning Buff
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Unit-type of GDD_DamageSource) Equal to Lino
      • (GDD_DamagedUnit belongs to an enemy of (Owner of GDD_DamageSource)) Equal to True
      • (GDD_DamageSource has buff Lightning Buff ) Equal to True
    • Actions
      • [...]
        • Unit - Cause GDD_DamageSource to damage (Picked unit), dealing (Real(I_DamageLB)) damage of attack type Spells and damage type Normal
Notice that the conditions for the trigger to run are the same conditions as you're using to determine whether to damage a unit, meaning that you've created a classic "infinite loop" situation - when you deal damage in this trigger, it causes the trigger to run again, ad infinitum. The solution is to turn off the trigger before dealing damage, and turning the trigger back on afterward.
 

canons200

New Member
Reaction score
50
Notice that the conditions for the trigger to run are the same conditions as you're using to determine whether to damage a unit, meaning that you've created a classic "infinite loop" situation - when you deal damage in this trigger, it causes the trigger to run again, ad infinitum. The solution is to turn off the trigger before dealing damage, and turning the trigger back on afterward.
what a simple mistake.................thank for the help, rep added
 
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