• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

On hit damage trigger [GUI]

Status
Not open for further replies.
Level 3
Joined
Jun 19, 2014
Messages
26
[GUI] On hit damage trigger

Hi, I'm new here, so forgive me if I did anything wrong when creating this thread, also forgive my English if I commit any mistakes, it isn't my native language.

I'm working in a Hero Arena map and I wanted to create a spell that works like Darius skill W, of League of Legends; basically a basic attack damage bonus that only activates at the first attack after the cast of the spell.
So, I did this trigger:
Sem+t%C3%ADtulo.png


However, the problem is that the trigger is activated even if I stop the Attack (by pressing S before hitting the enemy). So, how can I solve this problem? Activating the trigger only if the Attack wasn't stopped.
 
Last edited:
Level 8
Joined
Jan 8, 2013
Messages
348
The attack is the Attack itself, means this trigger starts when your hero gets the order to ATTACK (not deal damage) and if you cancel the attack during the attacktime the attack already startet and the trigger runs. you could also let your heor attack and spam S and the trigger will spam.

you need to use a DDS (damage detection system) and damage the target when it gets damage from your hit. not if hes getting attacked. it have to become the damage from your hit.

hope you understand this :D my english isnt the best xD

and please dont use waits. thats bad.
 
Level 12
Joined
May 20, 2009
Messages
822
This one is fully GUI compatible. Personally, I like it and it's really easy to use. Not too easy to extend upon though, as the actual coding is JASS. But all you need is the variables it writes to.

basically you use the unit takes damage event, if you don't know how to trigger that correctly, download a damage detection system from the spell section.

I'm pretty sure that DDS' exist because the "Unit Takes Damage" event sucks. ;o

EDIT: Also, keep in mind that when you use this, and in the same trigger that takes the Damage Event, that if you want damage to be done (So it's like extra damage or something) you need to turn the trigger off before the damage then turn it back on right after the damage so there's as small of a window as possible for a damage event to be missed.

Like this:

  • Untitled Trigger 001
    • Events
      • Game - Damage_Event becomes Equal to 0.00
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Cause Damage_Source to damage Damaged_Unit, dealing 10.00 damage of attack type Spells and damage type Normal
      • Trigger - Turn on (This trigger)
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
So, what DDS would you recommend? Does exists anyone that I can use with GUI?

There are several things to think about before this question can be answered. You need GUI, so there are basically only two options, namely GUI-Friendly Damage Detection v1.2.1 or Physical Damage Detection for GUI v1.1.0.0 (I can't recommend Bribes DDS because only the damage detection part works without bugs, the modification is bugged. But if you only need detection, use Weeps DDS directly).

So, what is the difference between those two systems? Weeps DDS allows you to detect damage, nothing else. PDDS allows you to detect damage, damage type (physical or spell), modify damage (for example block damage) or reflect damage. So...

  • If you need damage modification (like blocking damage) or damage reflection, use PDDS
  • If you need damage type detection of native spells, use PDDS
  • If you need damage type detection and don't use native spells in your map but only self-triggered spells, use Weeps DDS
  • If you only need damage detection (without type detection), use Weeps DDS

Go through the list and try to answer all the questions for your map, then you should be able to choose the DDS which is best for your needs.

^ that one is crappy. Or well not crappy, but I personally dislike it a lot.

You shouldn't let your answers being influenced by personal preference if you are trying to help somebody, because then its not "help" anymore. As his initial post suggests, he wants to detect physical damage (the typical replacement of unit is attacked by a DDS) and this can't be done with Weeps DDS (at least if you don't trigger all spells you use).

So even if you don't like the system you should mention this before he implements the wrong DDS and then notices that it can't do the things he likes to do with it.
 
Level 3
Joined
Jun 19, 2014
Messages
26
This one is fully GUI compatible. Personally, I like it and it's really easy to use. Not too easy to extend upon though, as the actual coding is JASS. But all you need is the variables it writes to.



I'm pretty sure that DDS' exist because the "Unit Takes Damage" event sucks. ;o

EDIT: Also, keep in mind that when you use this, and in the same trigger that takes the Damage Event, that if you want damage to be done (So it's like extra damage or something) you need to turn the trigger off before the damage then turn it back on right after the damage so there's as small of a window as possible for a damage event to be missed.

Like this:

  • Untitled Trigger 001
    • Events
      • Game - Damage_Event becomes Equal to 0.00
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Cause Damage_Source to damage Damaged_Unit, dealing 10.00 damage of attack type Spells and damage type Normal
      • Trigger - Turn on (This trigger)

If I don't do it, what would happen? Could the Unit - Damage Target action happen two times?
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,219
You shouldn't let your answers being influenced by personal preference if you are trying to help somebody, because then its not "help" anymore. As his initial post suggests, he wants to detect physical damage (the typical replacement of unit is attacked by a DDS) and this can't be done with Weeps DDS (at least if you don't trigger all spells you use).

So even if you don't like the system you should mention this before he implements the wrong DDS and then notices that it can't do the things he likes to do with it.

He only requested a DDS to replace the "unit is attacked" event, which makes any DDS viable. Also, I clearly stated that it was my personal opinion, I am just another human.


I'm pretty sure that DDS' exist because the "Unit Takes Damage" event sucks. ;o
I have only studied weeps DDS so this may not be correct. But a DDS is basically a work-around since the unit takes damage only works on specific units. Weeps DDS create one trigger for each unit with the event unit takes damage.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
He only requested a DDS to replace the "unit is attacked" event, which makes any DDS viable.

Of course not.

Again: think, then write. If you want to trigger an ability that is only fired on physical damage, which is the replacement of "unit attacked", then you need type detection. Because what happens if the hero damages an unit with a spell? Spell broken, sad.


Also, I clearly stated that it was my personal opinion, I am just another human.

Sure, but...

I have only studied weeps DDS so this may not be correct. But a DDS is basically a work-around since the unit takes damage only works on specific units. Weeps DDS create one trigger for each unit with the event unit takes damage.

... you have obviously no idea about DDSs, so this discussion is quite pointless.
 
Level 12
Joined
May 20, 2009
Messages
822
If I don't do it, what would happen? Could the Unit - Damage Target action happen two times?

If you DON'T do that, it'll cause an infinite loop that'll either completely freeze up the game or crash. Usually crash.

If you want it to happen more then once in the same trigger, but not freeze or crash, just copy/paste the first "Do damage"

But that's only if you want two separate damage events to register. If you just want more damage, then increase the amount of damage in the first one.

EDIT:

Again: think, then write. If you want to trigger an ability that is only fired on physical damage, which is the replacement of "unit attacked", then you need type detection. Because what happens if the hero damages an unit with a spell? Spell broken, sad.

With Weep's system, I think you can just do -

  • Untitled Trigger 001
    • Events
      • Game - DamageEvent becomes Equal to 0.00
    • Conditions
      • (Unit-type of DamageSource) Equal to UNIT_TYPE
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current order of DamageSource) Equal to (Order(attack))
          • (Current order of DamageSource) Not equal to (Order(spellorder))
        • Then - Actions
        • Else - Actions
Or would that still fire if the spell order is only on the DamageSource for a few moments, and the damage happens after the order has changed to attack? (And probably the same scenario for ranged units...)
 
Last edited:
Level 14
Joined
Dec 12, 2012
Messages
1,007
Or would that still fire if the spell order is only on the DamageSource for a few moments, and the damage happens after the order has changed to attack? (And probably the same scenario for ranged units...)

No, that won't work reliable. Especially damage over time (orbs, poison, etc.) or reflection/shared damage (items/spirit link) or instant damage (bash) or triggered damage will break this.
 
Level 3
Joined
Jun 19, 2014
Messages
26
Hi again, sorry for only returning now.

So, I did the changes and yes, it's crashing as you said. Well, here are my actually triggers using the Weep DDS:

Activation Trigger:
  • Mountain R Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Pulverize
    • Actions
      • Set Temp_point = (Position of (Triggering unit))
      • Floating Text - Create floating text that reads Face my Strenght!!! at (Position of (Triggering unit)) with Z offset 5.00, using font size 10.00, color (0.00%, 70.00%, 45.00%), and 20.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
      • Trigger - Turn on Mountain R <gen>
      • Custom script: call RemoveLocation (udg_Temp_point)
The damage bonus trigger:
  • Mountain R
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (GDD_DamageSource has buff Pulverize ) Equal to True
    • Actions
      • Set MountainNinja = GDD_DamageSource
      • Set MountainR_lvl = (Level of Pulverize for MountainNinja)
      • Set Mountain_Str = (Strength of MountainNinja (Include bonuses))
      • Set MountainR_target = GDD_DamagedUnit
      • Set MountainR_dmg = (20.00 + ((15.00 x (Real(MountainR_lvl))) + (1.50 x (Real(Mountain_Str)))))
      • Set Temp_point = (Position of MountainNinja)
      • Unit - Cause MountainNinja to damage MountainR_target, dealing MountainR_dmg damage of attack type Spells and damage type Force
      • Unit - Remove Pulverize buff from MountainNinja
      • Floating Text - Create floating text that reads ((String(MountainR_dmg)) + !) at Temp_point with Z offset 10.00, using font size 10.00, color (70.00%, 40.00%, 0.00%), and 20.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
      • Custom script: call RemoveLocation (udg_Temp_point)
      • Trigger - Turn off (This trigger)
Where should I insert the fixes?
 
Level 3
Joined
Jun 19, 2014
Messages
26
Sorry for the double post, I did it to avoid many different triggers in the same post.

I'm also using the DDS on these triggers, that creates a poison damage effect. I didn't notice any bugs while testing it, but...

Activation (every basic attack (I think that here is the problem))
  • Forest C
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Level of Poison Strike [Dummy] for GDD_DamageSource) Greater than 0
    • Actions
      • Set ForestNinja = GDD_DamageSource
      • Set ForestC_target = GDD_DamagedUnit
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (ForestC_target is alive) Equal to True
        • Then - Actions
          • Unit Group - Add ForestC_target to ForestC_group
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in ForestC_group) Greater than 0
        • Then - Actions
          • Trigger - Turn on Forest C loop <gen>
        • Else - Actions
          • Trigger - Turn off Forest C loop <gen>
Damage loop
  • Forest C loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • (Number of units in ForestC_group) Greater than 0
    • Actions
      • Set Forest_lvl = (Hero level of ForestNinja)
      • Set Forest_Int = (Intelligence of ForestNinja (Include bonuses))
      • Set ForestC_dmg = ((3.00 x (Real(Forest_lvl))) + (0.15 x (Real(Forest_Int))))
      • Unit Group - Pick every unit in ForestC_group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (((Picked unit) has buff Poison Strike (Non-stacking)) Equal to True) or (((Picked unit) has buff Poison Strike (Stacking)) Equal to True)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is alive) Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (((Picked unit) has buff Invulnerable) Equal to False) and (((Picked unit) is Magic Immune) Equal to False)
                    • Then - Actions
                      • Unit - Cause ForestNinja to damage (Picked unit), dealing ForestC_dmg damage of attack type Spells and damage type Poison
                      • Floating Text - Create floating text that reads ((String(ForestC_dmg)) + !) at (Position of (Picked unit)) with Z offset 10.00, using font size 10.00, color (0.00%, 60.00%, 10.00%), and 20.00% transparency
                      • Floating Text - Change (Last created floating text): Disable permanence
                      • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
                    • Else - Actions
                      • Do nothing
                • Else - Actions
                  • Unit Group - Remove (Picked unit) from ForestC_group
            • Else - Actions
              • Unit Group - Remove (Picked unit) from ForestC_group
 
Status
Not open for further replies.
Top