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

GUI-Friendly Damage Detection v1.2.1

GUI-Friendly Damage Detection
by Weep
Version 1.2.1

-- General Information --
This system provides a leak-free, GUI-friendly implementation of an "any unit takes damage" event. It requires no JASS knowledge to use, nor any other systems, nor any software other than the World Editor. It will not interfere with other systems, either.

It uses the Game - Value Of Real Variable event as its method of activating other triggers, and passes the event responses through a few globals.

Before you copy triggers that use GDD into a new map, you need to copy over GDD with its GDD Variable Creator trigger, or the variables won't be automatically created correctly.
If you pasted GDD-using triggers before pasting GDD, to fix it, change the type of the variable GDD_Event to be a Real in the Trigger Editor's Variables window, and then find the triggers that became disabled and change their event to use the variable GDD_Event.


-- How To Implement --
  1. Be sure "Automatically create unknown variables while pasting trigger data" is enabled in the World Editor general preferences.
  2. Copy the trigger category "GDD" from the demo map and paste it into your map. (Alternately: create the variables listed in the globals block below, create a trigger named GUI Friendly Damage Detection", and paste in this entire text.)
  3. Create your damage triggers using Game - Value Of Real Variable, select GDD_Event as the variable, and leave the rest of the settings to the default "becomes Equal to 0.00".
The event responses are the following variables:
  • GDD_Damage is the amount of damage, replacing Event Response - Damage Taken.
  • GDD_DamagedUnit is the damaged unit, replacing Event Response - Triggering Unit.
    • However, Triggering Unit can still be used, if you need to use waits. Read the Notes section below for more info.
  • GDD_DamageSource is the damaging unit, replacing Event Response - Damage Source.

-- Example Usage --
  • Display Damage
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
    • Actions
      • Game - Display to (All players) for 1.00 seconds the text: ((((Name of GDD_DamageSource) + damaged ) + (Name of GDD_DamagedUnit)) + ( for + ((String(GDD_Damage)) + damage.)))
-- System Code --
JASS:
// GUI-Friendly Damage Detection -- v1.2.1 -- by Weep
//    http://www.thehelper.net/forums/showthread.php?t=137957
//
//    Requires: only this trigger and its variables.
//
// -- What? --
//    This system provides a leak-free, GUI-friendly implementation of an "any unit takes
//    damage" event.  It requires no JASS knowledge to use.
//
//    It uses the Game - Value Of Real Variable event as its method of activating other
//    triggers, and passes the event responses through a few globals.
//
// -- Why? --
//    The traditional GUI method of setting up a trigger than runs when any unit is damaged
//    leaks trigger events.  This system is easy to implement and removes the need to do
//    you own GUI damage detection setup.
//
// -- How To Implement --
//    0. Before you copy triggers that use GDD into a new map, you need to copy over GDD
//       with its GDD Variable Creator trigger, or there will be a problem: the variables
//       won't be automatically created correctly.
//
//    1. Be sure "Automatically create unknown variables while pasting trigger data" is
//       enabled in the World Editor general preferences.
//    2. Copy this trigger category ("GDD") and paste it into your map.
//       (Alternately: create the variables listed in the globals block below, create a
//       trigger named "GUI Friendly Damage Detection", and paste in this entire text.)
//    3. Create your damage triggers using Game - Value Of Real Variable as the event,
//       select GDD_Event as the variable, and leave the rest of the settings to the default
//       "becomes Equal to 0.00".
//       The event responses are the following variables:
//          GDD_Damage is the amount of damage, replacing Event Response - Damage Taken.
//          GDD_DamagedUnit is the damaged unit, replacing Event Response - Triggering Unit.
//              Triggering Unit may still be used, if you need to use waits.
//              Read the -- Notes -- section below for more info.
//          GDD_DamageSource is the damaging unit, replacing Event Response - Damage Source.
//
// -- Notes --
//    GDD's event response variables are not wait-safe; you can't use them after a wait in
//    a trigger.  If you need to use waits, Triggering Unit (a.k.a. GetTriggerUnit()) can
//    be used in place of GDD_DamageSource.  There is no usable wait-safe equivalent to
//    Event Damage or Damage Source; you'll need to save the values yourself.
//
//    Don't write any values to the variables used as the event responses, or it will mess
//    up any other triggers using this system for their triggering.  Only use their values.
//
//    This uses arrays, so can detect damage for a maximum of 8190 units at a time, and
//    cleans up data at a rate of 33.33 per second, by default.  This should be enough for
//    most maps, but if you want to change the rate, change the value returned in the
//    GDD_RecycleRate function at the top of the code, below.
//
//    By default, GDD will not register units that have Locust at the moment of their
//    entering the game, and will not recognize when they take damage (which can only
//    happen if the Locust ability is later removed from the unit.)  To allow a unit to have
//    Locust yet still cause GDD damage events if Locust is removed, you can either design
//    the unit to not have Locust by default and add it via triggers after creation, or
//    edit the GDD_Filter function at the top of the code, below.
//
// -- Credits --
//    Captain Griffin on triggerc.net for the research and concept of GroupRefresh.
//
//    Credit in your map not needed, but please include this README.
//
// -- Version History --
//    1.2.1: Minor code cleaning.  Added configuration functions.  Updated documentation.
//    1.2.0: Made this system work properly with recursive damage.
//    1.1.1: Added a check in order to not index units with the Locust ability (dummy units).
//           If you wish to check for damage taken by a unit that is unselectable, do not
//           give the unit-type Locust in the object editor; instead, add the Locust ability
//           'Aloc' via a trigger after its creation, then remove it.
//    1.1.0: Added a check in case a unit gets moved out of the map and back.
//    1.0.0: First release.


//===================================================================
// Configurables.
function GDD_RecycleRate takes nothing returns real //The rate at which the system checks units to see if they've been removed from the game
    return 0.03
endfunction

function GDD_Filter takes unit u returns boolean //The condition a unit has to pass to have it registered for damage detection
    return GetUnitAbilityLevel(u, 'Aloc') == 0 //By default, the system ignores Locust units, because they normally can't take damage anyway
endfunction

//===================================================================
// This is just for reference.
// If you use JassHelper, you could uncomment this section instead of creating the variables in the trigger editor.

// globals
//  real udg_GDD_Event = 0.
//  real udg_GDD_Damage = 0.
//  unit udg_GDD_DamagedUnit
//  unit udg_GDD_DamageSource
//  trigger array udg_GDD__TriggerArray
//  integer array udg_GDD__Integers
//  unit array udg_GDD__UnitArray
//  group udg_GDD__LeftMapGroup = CreateGroup()
// endglobals

//===================================================================
// System code follows.  Don't touch!
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

function GDD_AddDetection takes nothing returns boolean
//  if(udg_GDD__Integers[0] > 8190) then
//      call BJDebugMsg("GDD: Too many damage events!  Decrease number of units present in the map or increase recycle rate.")
//      ***Recycle rate is specified in the GDD_RecycleRate function at the top of the code.  Smaller is faster.***
//      return
//  endif
    if(IsUnitInGroup(GetFilterUnit(), udg_GDD__LeftMapGroup)) then
        call GroupRemoveUnit(udg_GDD__LeftMapGroup, GetFilterUnit())
    elseif(GDD_Filter(GetFilterUnit())) then
        set udg_GDD__Integers[0] = udg_GDD__Integers[0]+1
        set udg_GDD__UnitArray[udg_GDD__Integers[0]] = GetFilterUnit()
        set udg_GDD__TriggerArray[udg_GDD__Integers[0]] = CreateTrigger()
        call TriggerRegisterUnitEvent(udg_GDD__TriggerArray[udg_GDD__Integers[0]], udg_GDD__UnitArray[udg_GDD__Integers[0]], EVENT_UNIT_DAMAGED)
        call TriggerAddCondition(udg_GDD__TriggerArray[udg_GDD__Integers[0]], Condition(function GDD_Event))
    endif
    return false
endfunction

function GDD_PreplacedDetection takes nothing returns nothing
    local group g = CreateGroup()
    local integer i = 0
    loop
        call GroupEnumUnitsOfPlayer(g, Player(i), Condition(function GDD_AddDetection))
        set i = i+1
        exitwhen i == bj_MAX_PLAYER_SLOTS
    endloop
    call DestroyGroup(g)
    set g = null
endfunction

function GDD_GroupRefresh takes nothing returns nothing
// Based on GroupRefresh by Captain Griffen on triggerc.net
    if (bj_slotControlUsed[5063] == true) then
        call GroupClear(udg_GDD__LeftMapGroup)
        set bj_slotControlUsed[5063] = false
    endif
    call GroupAddUnit(udg_GDD__LeftMapGroup, GetEnumUnit())
endfunction

function GDD_Recycle takes nothing returns nothing
    if(udg_GDD__Integers[0] <= 0) then
        return
    elseif(udg_GDD__Integers[1] <= 0) then
        set udg_GDD__Integers[1] = udg_GDD__Integers[0]
    endif
    if(GetUnitTypeId(udg_GDD__UnitArray[udg_GDD__Integers[1]]) == 0) then
        call DestroyTrigger(udg_GDD__TriggerArray[udg_GDD__Integers[1]])
        set udg_GDD__TriggerArray[udg_GDD__Integers[1]] = null
        set udg_GDD__TriggerArray[udg_GDD__Integers[1]] = udg_GDD__TriggerArray[udg_GDD__Integers[0]]
        set udg_GDD__UnitArray[udg_GDD__Integers[1]] = udg_GDD__UnitArray[udg_GDD__Integers[0]]
        set udg_GDD__UnitArray[udg_GDD__Integers[0]] = null
        set udg_GDD__Integers[0] = udg_GDD__Integers[0]-1
    endif
    set udg_GDD__Integers[1] = udg_GDD__Integers[1]-1
endfunction

function GDD_LeaveMap takes nothing returns boolean
    local boolean cached = bj_slotControlUsed[5063]
    if(udg_GDD__Integers[2] < 64) then
        set udg_GDD__Integers[2] = udg_GDD__Integers[2]+1
    else
        set bj_slotControlUsed[5063] = true
        call ForGroup(udg_GDD__LeftMapGroup, function GDD_GroupRefresh)
        set udg_GDD__Integers[2] = 0
    endif
    call GroupAddUnit(udg_GDD__LeftMapGroup, GetFilterUnit())
    set bj_slotControlUsed[5063] = cached
    return false
endfunction

// ===========================================================================
function InitTrig_GUI_Friendly_Damage_Detection takes nothing returns nothing
    local region r = CreateRegion()
    call RegionAddRect(r, GetWorldBounds())
    call TriggerRegisterEnterRegion(CreateTrigger(), r, Condition(function GDD_AddDetection))
    call TriggerRegisterLeaveRegion(CreateTrigger(), r, Condition(function GDD_LeaveMap))
    call GDD_PreplacedDetection()
    call TimerStart(CreateTimer(), GDD_RecycleRate(), true, function GDD_Recycle)
    set r = null
endfunction

-- Notes --
GDD's event response variables are not wait-safe; you can't use them after a wait in a trigger. If you need to use waits, Triggering Unit (a.k.a. GetTriggerUnit()) can be used in place of GDD_DamageSource. There is no usable wait-safe equivalent to GDD_Damage or GDD_DamageSource; you'll need to save the values yourself.

A common problem when using any damage detection system occurs when you try to cause the damage source to damage the damaged unit from a damage event - for example, if triggering bonus damage. This causes the unit to repeatedly damage the target, because dealing damage in the trigger causes that trigger to run again, and again in turn, infinitely. One solution is to add the action Turn off (This trigger) before dealing damage and add the action Turn on (This trigger) afterward.

Don't write any values to the variables used as the event responses, or it will mess up any other triggers using this system for their triggering. Only use their values.

This uses arrays, so can detect damage for a maximum of 8190 units at a time, and cleans up data at a rate of 33.33 per second, by default. This should be enough for most maps, but if you want to change the rate, change the value returned in the GDD_RecycleRate function at the top of the code.

By default, GDD will not register units that have Locust at the moment of their entering the game, and will not recognize when they take damage (which can only happen if the Locust ability is later removed from the unit.) To allow a unit to have Locust yet still cause GDD damage events if Locust is removed, you can either design the unit to not have Locust by default and add it via triggers after creation, or edit the GDD_Filter function at the top of the code.

-- Credits --
Captain Griffin on triggerc.net for the research and concept of GroupRefresh.

Credit in your map not needed, but please include the README.

-- Version History --
1.2.1: Minor code cleaning. Added configuration functions. Updated documentation.
1.2.0: Made this system work properly with recursive damage.
1.1.1: Added a check in order to not index units with the Locust ability (dummy units). If you wish to check for damage taken by a unit that is unselectable, do not give the unit-type Locust in the object editor; instead, add the Locust ability 'Aloc' via a trigger after its creation, then remove it.
1.1.0: Added a check in case a unit gets moved out of the map and back.
1.0.0: First release.


Keywords:
gui, friendly, damage, detection, detect
Contents

GUI-Friendly Damage Detection (Map)

Reviews
17:29, 16th Jan 2010 TriggerHappy: Very easy to use for GUI users and a fairly unique implementation.
Level 11
Joined
Aug 1, 2009
Messages
714
Turn off
  • Unit - Cause GDD_DamageSource to damage GDD_DamagedUnit, dealing (((75.00 x (Real((Level of Dummy Unit Ability - Storm Bolt for GDD_DamageSource)))) + ((Real((Strength of GDD_DamageSource (Include bonuses)))) x 0.75)) - GDD_Damage) damage of attack type Spells and damage type Normal
    • Unit - Add a 0.50 second Generic expiration timer to GDD_DamageSource
Turn on

Doesn't work ? o_O

Yes. doesn't work even with those codes
 
Level 11
Joined
Aug 1, 2009
Messages
714
what doesn't work? it don't cast the storm bolt, or it doesn't deal the damage?

btw, you might want to use hashtables or arrays to link the unit caster to the dummy caster rather than using a hero-based dummy caster...

The first trigger which is used to summon the dummy hero that will attack the unit - target ability cast WORKS

The problem is the second trigger which doesn't work at all
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,456
You can't detect the damage type of non-triggered damage. There are some
orb effects like Orb of Frost which stack with other orb effects so it's not too
buggy, but it does bug bouncing attacks and when a lot of units are focusing
on a target you can notice a slowing effect. Oh and when you use attack-
ground from artillery it makes the game suddenly crash.

Blizzard needs only to create a new native called "GetEventDamageType".
That would really change the game.
 
Level 11
Joined
Aug 1, 2009
Messages
714
You can't detect the damage type of non-triggered damage. There are some
orb effects like Orb of Frost which stack with other orb effects so it's not too
buggy, but it does bug bouncing attacks and when a lot of units are focusing
on a target you can notice a slowing effect. Oh and when you use attack-
ground from artillery it makes the game suddenly crash.

Blizzard needs only to create a new native called "GetEventDamageType".
That would really change the game.

Agreed, especially there are some people having an idea involving "Damage-Type" in there spells. Like return damage for the magical.
My question has been answered "No" Damn.

BTW, Bride if I recall you are planning to do something like that, I hope you can do it sooner
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,456
Well that's why I made Damage Engine, but you have to trigger all spell
damage and set the DamageEventType variable to whatever damage type
you want it to represent.

I think you and I have talked about it before and you told me about some
bugs that it has? I haven't hide time to test it yet unfortunately but I will
get to it tonight I hope!
 
Level 8
Joined
Dec 9, 2009
Messages
397
Your system ignores units with locust, is that for units with locust that GET hit?

or units with locust that HIT something else.

I would like my units with locust to trigger the damage event when they hit.
 
Level 5
Joined
May 20, 2008
Messages
138
I'm having an odd problem with this system. I copied the folder into my map as instructed and then added this simple trigger

  • damage taken check
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (GDD_DamageSource belongs to an enemy of Player 12 (Brown)) Equal to True
    • Actions
      • Game - Display to (All players) the text: trigger ran
the trigger fires twice each time a unit is damage (ie if I attack a unit, "trigger ran" is written twice on the screen)

What is the cause of this and how do I fix it? I otherwise like this system really much because it was so simple to implement.
 
Level 5
Joined
May 20, 2008
Messages
138
Ah I managed to figure it out (finally). It was "conflicting" with some old damage detection triggers that I had, had forgotten all about them lol. Thanks for a great system!
 
I've used this system before, and I've gotten it working on many maps. But for whatever odd reason, when I copied it into the map I'm currently working on, it absolutely refused to work. I have all of the variables copied, and yet it still insists the variables are undeclared.
152739-albums4597-picture62799.jpg

152739-albums4597-picture62800.jpg


Any idea why it would work before, and still continue to work in my other maps, and then suddenly refuse to work in this one? I don't have any triggers or variables that would interfere with this one.
 
Level 18
Joined
Nov 21, 2012
Messages
835
Although it is very simple its very usefull;]
The simpler the better.
I switch from Bribe's DDS to this and it works w/o problems
zibi

edit 28-03-2014

Bug. Is it warcraft bug or this DDS ?
Here's how:
Hero walks near enemy tower. Sometimes DDS shows that my hero damaged tower with 0.000 damage while hero didnt touch tower! I noticed that happends with buildings only (it didnt happend with enemy units). It messed some my triggers, for now I add -as solution- condition 'GDD_Damage > 0'. It works with this condition for me. But it even happend with enemy invunerable Fountain!. Im confused.. Is anyone know why it shows zero damage?? And only sometimes?
regards Zibi
 
Last edited:
Level 3
Joined
Apr 12, 2015
Messages
19
That is exactly what I was looking for. Very easy to use this system and it works without problems. Thank you very much :thumbs_up:
 
Level 16
Joined
May 1, 2008
Messages
1,605
Okay I'm back after all these years, still having lot of private messages and some of them where including this system. As I see, this system never got a real update, so I want to share some solutions.

1) Some people just used the jass code of this system without using any GUI variables, finding out that the system wasn't working for them. Main solution was here, that not all variables got initiated which you have to change:
JASS:
[code=jass]globals
  real udg_GDD_Event = 0.
  real udg_GDD_Damage = 0.
  unit udg_GDD_DamagedUnit = null
  unit udg_GDD_DamageSource = null
  trigger array udg_GDD__TriggerArray[1]
  integer array udg_GDD__Integers[1]
  unit array udg_GDD__UnitArray[1]
  group udg_GDD__LeftMapGroup = CreateGroup()
endglobals

2) Another problem was, that this damage detection sometimes triggered for no reason. In most cases the problem was, that this system also triggers at 0 damage dealed. For example a stun effect without damage dealed still triggers 2 times; When the stun is applied and removed.
All in all make sure that the damage variable is greater than 0.

3) Also there were one or two "infinite damage" problems. For the next trigger, we wanted to simulate taking more damage from normal attacks when the target unit has certain debuff:
JASS:
library Ceffect1 initializer Ceffect1_Init

    function Ceffect1_Actions takes nothing returns nothing
        call UnitDamageTarget(GDD_Source,GDD_Target,GDD_Damage,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,null)
    endfunction
    
    function Ceffect1_Conditions takes nothing returns boolean
        return GetUnitAbilityLevel(GDD_Target,'B000') > 0
    endfunction

    function Ceffect1_Init takes nothing returns nothing
        local trigger t = CreateTrigger()
        
        call TriggerRegisterVariableEvent(t,"GDD_Event",EQUAL,0)
        call TriggerAddCondition(t,Condition(function Ceffect1_Conditions))
        call TriggerAddAction(t,function Ceffect1_Actions)
        
        set t = null
    endfunction
endlibrary
As you see we were using UnitDamageTarget which causes the damage detection to run infinitely. Our fastest solution was creating a dummy (which actually every map has at some point), filter the dummy out and let the dummy do the damage.

JASS:
library Ceffect initializer Ceffect_Init

    function Ceffect_Actions takes nothing returns nothing
        local unit u
        
        if GDD_Damage > 0 and GetUnitTypeId(GDD_Source) != 'dumx' then
            set u = CreateUnit(GetOwningPlayer(GDD_Source),'dumx',GetUnitX(GDD_Target),GetUnitY(GDD_Target),0)
            call UnitDamageTarget(u,GDD_Target,GDD_Damage,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,null)
            call UnitApplyTimedLife(u,'BTFL',1.)
            set u = null
        endif
    endfunction
    
    function Ceffect_Conditions takes nothing returns boolean
        return GetUnitAbilityLevel(GDD_Target,'B000') > 0
    endfunction

    function Ceffect_Init takes nothing returns nothing
        local trigger t = CreateTrigger()
        
        call TriggerRegisterVariableEvent(t,"GDD_Event",EQUAL,0)
        call TriggerAddCondition(t,Condition(function Ceffect_Conditions))
        call TriggerAddAction(t,function Ceffect_Actions)
        
        set t = null
    endfunction
endlibrary

I don't know if this system got replaced already or if people even check the latest posts, tho as I said I just wanted to share some solutions of the problems people private messaged me using this system.

Greetings and Peace
- Dr. Boom
 
Last edited:
Level 3
Joined
Jun 18, 2016
Messages
68
How about if i want to only detect when enemy hit by my storm bolt ability then do damage unit group. Not by only detect i done the damage to unit then action
 
Level 5
Joined
Oct 16, 2015
Messages
132
Thanks for this, I am a newbie to WE and this works fine. Btw do u know any way to convert it to Integer? The decimals in real are annoying and I tried it to convert the "GDD_Damage" to Integer but when I save it it says error. Can you help me a bit?
 

Deleted member 247165

D

Deleted member 247165

This is exactly what I needed! My DDS was very weak. Thank you so much! 5/5 for your hard effort!
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,456
For those who want a 1.31.1-optimized version of this script (without bridging it off of Damage Engine), here you are:

JASS:
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

//===========================================================================
function InitTrig_GUI_Friendly_Damage_Detection takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_DAMAGED)
    call TriggerAddCondition(t, Filter(function GDD_Event))
    set t = null
endfunction
 
Level 7
Joined
Jul 4, 2007
Messages
249
When I assign "GDD_DamageSource" to "unit" in my trigger it gets overwritten. Can someone tell me why this happens? How is it conflicting with other triggers? There's no timers and no calling or triggering other triggers in any way.
  • Javelin finish
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (GDD_DamageSource is in Javelin_unitGrp) Equal to True
    • Actions
      • Set GDD_DamageSource = unit
      • Unit - Remove Max Atk Speed from unit
      • Unit Group - Remove unit from Javelin_unitGrp
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Javelin_unitGrp) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
When I use GDD_DamageSource instead of unit it works fine.
I'm using "unit" in other GDD triggers aswell and haven't come across this problem before, so would be nice to know how it works.
 
Level 3
Joined
May 28, 2019
Messages
39
Year 2020 and it still works fine! Thank you very much for such USER friendly tool <3
 
Level 7
Joined
Aug 8, 2010
Messages
48
Very glad this exists, it's the easiest system I could find still compatible for 1.27b. Perfect for damage floating text feedback and simple OnDamage effect triggering.

It is very interesting that the game uses a 0-damage hit to trigger the base attack alarm (which would explain ZiBitheWand3r3r's problems at the bottom of page 4) but Dr.Boom gives a simple fix, so all in all everything is good.

+5
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,456
Very glad this exists, it's the easiest system I could find still compatible for 1.27b. Perfect for damage floating text feedback and simple OnDamage effect triggering.

It is very interesting that the game uses a 0-damage hit to trigger the base attack alarm (which would explain ZiBitheWand3r3r's problems at the bottom of page 4) but Dr.Boom gives a simple fix, so all in all everything is good.

+5
I would recommend Damage Engine 3A.0.0.0 and 3.8.0.0 | HIVE if you want to broaden your horizons to include spell damage detection and still be compatible with older versions of WC3.
 
Level 4
Joined
Jun 8, 2020
Messages
28
I Just wundering is there any way to separate auto attack damage from spell damage? Wanted to use another colour of floating text when dealing damage with the spells and do not display any text when using particular spells. Any way to do it using this dds?
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,456
I Just wundering is there any way to separate auto attack damage from spell damage? Wanted to use another colour of floating text when dealing damage with the spells and do not display any text when using particular spells. Any way to do it using this dds?

No that is not possible using this DDS as it has 0 features outside of extremely basic damage detection.

You would want to use Damage Engine 5.7.1.2
 
Level 3
Joined
Mar 13, 2021
Messages
5
Hello, i tried the script and it worked as expected however when attempting to optimize the map i get the following error:

VXJWTSOPT_aqzkuXvEKx.png


After some trial and error i figured that unchecking Compress Names fixes the issue. The error occurs if
Game - GDD_Event becomes Equal to 0.00 is present with the system in place. I tried optimizing the provided example to rule out the implementation being faulty in my side and i still get the same issue, i'm using 1.27b for the provided war3patch.mpq as it can be seen in the image.

I don't wanna give up on compressing names so, any ideas?
 
Level 1
Joined
May 8, 2021
Messages
2
Hi, am really appreciating the simplicity of this DDS. However, I do have a question. In my map, to get around the limitations of orb-effects and buff-placers, I've been scripting on-damage effects instead of using the tried-and-tested Orb of Slow method. However, due to having Cleave and similar splash-damage abilities, the on-damage effects are triggering on the units affected by the splash damage as well. Is there any way to get around this? Or do I have to move on to a more advanced DDS? Thanks!
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,456
Hi, am really appreciating the simplicity of this DDS. However, I do have a question. In my map, to get around the limitations of orb-effects and buff-placers, I've been scripting on-damage effects instead of using the tried-and-tested Orb of Slow method. However, due to having Cleave and similar splash-damage abilities, the on-damage effects are triggering on the units affected by the splash damage as well. Is there any way to get around this? Or do I have to move on to a more advanced DDS? Thanks!
This is an ultra-simple DDS. When you need more than just knowing damage amount, target and source, you have to switch to a more advanced DDS.
 
Level 1
Joined
May 8, 2021
Messages
2
Thanks for your reply! I've more or less finagled a weird (and potentially definitely buggy) solution of adding dummy buffs when attacking and checking for them when dealing damage, but since it's a map I made for my own enjoyment, I can live with a simple DDS for now.
 
Top