• 🏆 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!

[Trigger] Help with easy trigger!

Status
Not open for further replies.
Level 3
Joined
Sep 25, 2008
Messages
50
  • Events
  • Game - GDD_Event becomes Equal to 0.00
  • Conditions
  • (Unit-type of GDD_DamagedUnit) Equal to Berserker
  • Actions
  • Set UV_Unit=GDD_DamagedUnit
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (UV_Unit has buff Undying ) Equal to True
    • Then - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • GDD_Damage Greater than or equal to (Life of UV_Unit)
    • Then - Actions
      • Unit - Set life of UV_Unit to 1.00
    • Else - Actions
      • Unit - Set life of UV_Unit to ((Life of UV_Unit) - GDD_Damage)
    • Else - Actions
Im using Gui Damage Detection System.
Yeah I don't get why this doesn't work
Also, the buff UNDYING is a modified ability that multiplies all damage by 0.
 
Level 7
Joined
Dec 26, 2010
Messages
401
I'm not seeing where it sets your damage to a specific number, you show the variable GDD_Damage as being used as the amount to subtract, but there's nothing that's telling the variable to hold an amount of damage.

Also I don't notice any leak stops, which commonly happen with variables and unit groups, in which I might suggest visiting the Things that leak. thread.

But if you already know how to stop leaks then disregard the link.
 
Level 3
Joined
Sep 25, 2008
Messages
50
The variable GDD_Damage is detected in another trigger
function GDD_Event takes nothing returns boolean
local unit damagedcache = udg_GDD_DamagedUnit
local unit damagingcache = udg_GDD_DamageSource
local real damagecache = udg_GDD_Damage
set udg_GDD_DamagedUnit = GetTriggerUnit()
set udg_GDD_DamageSource = GetEventDamageSource()
set udg_GDD_Damage = GetEventDamage()
set udg_GDD_Event = 1.
set udg_GDD_Event = 0.
set udg_GDD_DamagedUnit = damagedcache
set udg_GDD_DamageSource = damagingcache
set udg_GDD_Damage = damagecache
set damagedcache = null
set damagingcache = null
return false
endfunction
Part of the function ^
 
Level 9
Joined
Oct 11, 2009
Messages
477
Why does the second loop is outside the first loop like in the encircled part of the screenshot I took? I recommend containing the second loop under the first loop in the 'Then' part.
 

Attachments

  • untitled.JPG
    untitled.JPG
    139.1 KB · Views: 67
Status
Not open for further replies.
Top