• 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.

[General] Basic Attack Special Effect but no leak

Level 8
Joined
Oct 6, 2022
Messages
185
Hello Everyone, i'm trying to create a special effect on basic attack of my range hero using triggers; but this is the only thing i know. because what i would like to happen is when it launched its projectile attack, that's the only time the special effect shows up. but unfortunately its not, the special effect is still shows up even i'm stopping the attack of the hero. Please help me with this.

  • Atk
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Ramada
    • Actions
      • Special Effect - Create a special effect attached to the weapon right of (Attacking unit) using Abilities\Weapons\RedDragonBreath\RedDragonMissile.mdl
      • Special Effect - Destroy (Last created special effect)
 
Level 8
Joined
Oct 6, 2022
Messages
185
i have damage engine that is compatible to my Warcraft version, but i don't know how would that work since i believe that the damage engine implies only from the time the unit lands a hit to the specific target. I could be wrong about it, so if that's the case. how do i do it via gui?
 
Level 29
Joined
Sep 26, 2009
Messages
2,596
yes, damage engine and the "unit takes damage" event react to when actual damage is to be applied. So for ranged units that means the time the projectile hits the target.
As far as I know, there is no way to detect when a ranged unit shot a projectile.
The "Unit is attacked" event fires when a unit attempts an attack - for ranged units like Archer it is the moment they start drawing their bow.
The time difference between attack start and actually shooting a projectile can vary. It is offset by "Combat - Attack - Animation Damage Point" value, but is affected by attack speed buffs and debuffs like Slow, Cripple and Endurance Aura.

So if you really want the effect to be shown when unit shoots a projectile, you will need to create a system that detects when unit is attacked, calculate attacker's actual animation damage point (i.e. include att. speed modifiers to default animation damage point from object data), run a timer that expires after that time (an on expiration displays the effect of your choice), all the while keeping track of the attacker to make sure its attack is not interrupted (i.e. by stun or different order).
 
Level 8
Joined
Oct 6, 2022
Messages
185
creating a system like that seems too difficult(At least for me), was there any existing system like that in here for me to able to progress faster?
(it could be a useful system if that was able to be created)
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,869
creating a system like that seems too difficult(At least for me), was there any existing system like that in here for me to able to progress faster?
(it could be a useful system if that was able to be created)
Honestly, just adding a Wait to the "A unit is attacked" trigger will probably yield the best results.

Otherwise, I came up with a way to detect the moment a ranged attack is launched by using a self-targeting Barrage ability + Damage Events. But this may have some undesirable side effects, especially if you wanted this unit to use Barrage for something else.
  • Attack SFX
    • Events
      • Game - DAL_Event becomes Equal to 1.00
    • Conditions
      • (Unit-type of DAL_Unit) Equal to Ramada
    • Actions
      • Special Effect - Create a special effect attached to the weapon right of DAL_Unit using Abilities\Weapons\RedDragonBreath\RedDragonMissile.mdl
      • Special Effect - Destroy (Last created special effect)
 
Last edited:
Level 8
Joined
Oct 6, 2022
Messages
185
@Pyrogasm my goal is to make this hero appealing when attacking by giving the hero a special effect when launching projectile and not to be just simple launching projectile like any hero does.
I was thinking it'll be great if it was did on a trigger so that when I needed it I'll just going to copy and modify it.
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,869
I was thinking an alternative way @Uncle & @Pyrogasm , maybe i should forbid the stop control to the players using the hero. but idk if that function even exist in my own version.
Is the Barrage method I suggested not going to work?

Regardless, I feel like forbidding Stop is a pretty awful limitation. As a Player I'd much rather have an occasional unexpected Special Effect which has zero impact on gameplay than to be unable to cancel and interrupt my orders, which is integral to controlling units.
 
Level 8
Joined
Oct 6, 2022
Messages
185
Honestly, just adding a Wait to the "A unit is attacked" trigger will probably yield the best results.

Otherwise, I came up with a way to detect the moment a ranged attack is launched by using a self-targeting Barrage ability + Damage Events. But this may have some undesirable side effects, especially if you wanted this unit to use Barrage for something else.
  • Attack SFX
    • Events
      • Game - DAL_Event becomes Equal to 1.00
    • Conditions
      • (Unit-type of DAL_Unit) Equal to Ramada
    • Actions
      • Special Effect - Create a special effect attached to the weapon right of DAL_Unit using Abilities\Weapons\RedDragonBreath\RedDragonMissile.mdl
      • Special Effect - Destroy (Last created special effect)
Is the Barrage method I suggested not going to work?

Regardless, I feel like forbidding Stop is a pretty awful limitation. As a Player I'd much rather have an occasional unexpected Special Effect which has zero impact on gameplay than to be unable to cancel and interrupt my orders, which is integral to controlling units.
Regarding to the barrage, i've tried to figure out how it would do its thing since i didn't manage to open the map due to my current version thus relying to what i've understand to your idea. I manage to crack it(i think), but @Uncle , @Pyrogasm , @Nichilus , and @Chaosium . Let me guys know if i've done it right and what could possibly improve this if there might be some cons in the future.

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • And - All (Conditions) are true
        • Conditions
          • DamageEventTarget Equal to DamageEventSource
          • (Unit-type of DamageEventSource) Equal to Ramada
    • Then - Actions
      • Set DamageEventAmount = 0.00
      • Set DamageEventType = DamageTypeBlocked
      • Special Effect - Create a special effect attached to the weapon right of DamageEventTarget using war3mapImported\Fireball Minor.mdx
      • Special Effect - Destroy (Last created special effect)
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (DamageEventTarget belongs to an enemy of (Owner of DamageEventSource)) Equal to True
              • (Unit-type of DamageEventSource) Equal to Ramada
        • Then - Actions
          • Special Effect - Create a special effect at (Position of DamageEventTarget) using war3mapImported\Fireball Minor.mdx
          • Special Effect - Set Height of (Last created special effect) to: 60.00
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,869
Regarding to the barrage, i've tried to figure out how it would do its thing since i didn't manage to open the map due to my current version thus relying to what i've understand to your idea. I manage to crack it(i think), but @Uncle , @Pyrogasm , @Nichilus , and @Chaosium . Let me guys know if i've done it right and what could possibly improve this if there might be some cons in the future.
Your trigger appears to make sense and it looks like you added some extra stuff for damaging enemies, but here's exactly what you need just in case:

You add a custom version of Barrage to Ramada, with the proper settings:
1717050226461.png

Now whenever Ramada attacks, the hero will immediately damage itself since it will fire a Missile at itself.

Then you create a trigger like this:
  • Events
    • Game - DamageEvent becomes Equal to 1.00
  • Conditions
    • DamageEventTarget Equal to DamageEventSource
    • (Unit-type of DamageEventSource) Equal to Ramada
  • Actions
    • Set DamageEventAmount = 0.00
    • Special Effect - Create a special effect attached to the weapon right of DamageEventSource using war3mapImported\Fireball Minor.mdx
    • Special Effect - Destroy (Last created special effect)
That should be all you need to get it to work properly. Not sure if the DamageTypeBlocked thing is necessary on older versions but it wasn't necessary on my version. You can add the Boolean Condition IsDamageRanged to ensure that this only runs when you deal ranged attack damage to yourself, which should ensure that it only ever detects self-Barrage damage.


Also, some random notes about your trigger:

1) You don't need to use:
  • And - All (Conditions) are true
This is already the default behavior of Conditions. Note how your If Then Else says "If (All Conditions are True)".

2) This leaks a Point:
  • Special Effect - Create a special effect at (Position of DamageEventTarget) using war3mapImported\Fireball Minor.mdx
 
Last edited:
Top