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

My detecting damage Passive didn't MUI

Status
Not open for further replies.
Level 6
Joined
Jul 22, 2015
Messages
66
Uhhh.. i want create passive ability that deal AoE damage on impact with some cooldown, and there the problem if i used 2nd unit (for testing MUI or not) the trigger didn't fire, here is my trigger. I'm using Damage Engine 3.8.8.8.

  • Help
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Flail Smack for DamageEventSource) Greater than 0
          • IsDamageSpell Equal to False
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Set PM_Loop = (Custom value of DamageEventSource)
          • Set DamageEventAmount = (DamageEventAmount x 2.00)
          • Set FlailDamage = (DamageEventAmount x 0.50)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • FlailImpact[PM_Loop] Equal to True
            • Then - Actions
              • Set GenericPoint = (Position of DamageEventTarget)
              • Set FlailDex = (FlailDex + 1)
              • Set FlailHero[PM_Loop] = DamageEventSource
              • Special Effect - Destroy FlailEffect[PM_Loop]
              • Set FlailDuration[PM_Loop] = 0.00
              • Special Effect - Create a special effect at GenericPoint using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
              • Special Effect - Destroy (Last created special effect)
              • Set GenericGroup = (Units within 275.00 of GenericPoint matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of DamageEventSource)) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit)
              • Unit Group - Pick every unit in GenericGroup and do (Actions)
                • Loop - Actions
                  • Unit - Cause FlailHero[PM_Loop] to damage (Picked unit), dealing FlailDamage damage of attack type Hero and damage type Normal
              • Set FlailImpact[PM_Loop] = False
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • FlailDex Equal to 1
                • Then - Actions
                  • Trigger - Turn on Duration <gen>
                • Else - Actions
              • Custom script: call DestroyGroup(udg_GenericGroup)
              • Custom script: call RemoveLocation(udg_GenericPoint)
            • Else - Actions
          • Trigger - Turn on (This trigger)
        • Else - Actions
  • Duration
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Flailndex) from 1 to PM_Loop, do (Actions)
        • Loop - Actions
          • Set FlailDuration[Flailndex] = (FlailDuration[Flailndex] + 1.00)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • FlailDuration[Flailndex] Greater than or equal to FlailDur
            • Then - Actions
              • Set FlailImpact[Flailndex] = True
              • Set PM_Loop = (Custom value of FlailHero[Flailndex])
              • Special Effect - Create a special effect attached to the hand,right of FlailHero[Flailndex] using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
              • Set FlailEffect[Flailndex] = (Last created special effect)
              • Set FlailEffect[PM_Loop] = FlailEffect[Flailndex]
              • Set FlailDex = (FlailDex - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • FlailDex Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
Duration for Cooldown

  • Set FlailDur = 7.00
 
Level 6
Joined
Jul 22, 2015
Messages
66
NvM just fiixing it after try too many hour lol

  • Duration
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Flailndex) from 1 to FlailDex, do (Actions)
        • Loop - Actions
          • Set FlailDuration[Flailndex] = (FlailDuration[Flailndex] + 1.00)
          • Game - Display to (All players) the text: (String(FlailDuration[Flailndex]))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • FlailDuration[Flailndex] Greater than or equal to FlailDur
            • Then - Actions
              • Set PM_Loop = (Custom value of FlailHero[Flailndex])
              • Set FlailImpact[PM_Loop] = True
              • Special Effect - Create a special effect attached to the hand,right of FlailHero[Flailndex] using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
              • Set FlailEffect2[Flailndex] = (Last created special effect)
              • Set FlailEffect[PM_Loop] = FlailEffect2[Flailndex]
              • Set FlailEffect2[Flailndex] = FlailEffect2[FlailDex]
              • Set FlailDuration[Flailndex] = FlailDuration[FlailDex]
              • Set FlailHero[Flailndex] = FlailHero[FlailDex]
              • Set Flailndex = (Flailndex - 1)
              • Set FlailDex = (FlailDex - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • FlailDex Equal to 0
                • Then - Actions
                  • Game - Display to (All players) the text: 0
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
 
Level 39
Joined
Feb 27, 2007
Messages
5,014
I'm using Damage Engine 3.8.8.8.
Holy shit, dude.
While what you have works, counting up the cooldown manually in 1-second chunk intervals is bound to become a problem for you eventually. If you ever change the cooldown or anything in your map modifies ability cooldowns... suddenly everything is out of sync. Your cooldown could also be off by as much as 1 second so if the skill has a 5s cooldown it could sometimes be as short as 4 or as long as 6 depending on the sync of the attack and periodic trigger. I would suggest you instead use one of the most useful WC3 tricks I know of to make the ability a visible passive ability that goes on CD whenever a unit attacks while it is up:
The method would be like this:
  • Instead of attaching the SFX to the unit directly you can create an ability based off of Sphere or Tornado Slow Aura that will provide a UI buff and arbitrary SFX attachment point to the unit as long as the unit has that ability. I'll refer to this ability as "Flail VFX Passive"
  • Give Cargo Hold (or a copy of it if you need Cargo Hold in your map for something else) an invalid techtree requirement so it's always disabled, or disable the ability for all players on map init, then give this ability in the OE to the unit with Flail Smack
  • Make Exhume Corpses into your passive Flail Smack ability
    • Give it 2 levels, but have both levels be identical to each other (you'll need this later)
  • (At this point, Flail Smack will cast automatically every time the CD is up (not when you attack))
  • Make a trigger that catches when Flail Smack is cast and do different things depending on which level it is:
    • If level 1:
      • Remove the Cargo Hold ability from the unit
      • Set Flail Smack to level 2
      • Give the unit the Flail VFX passive ability
      • Refresh the cooldown of Flail Smack (this is an action in somewhat recent version of the WE that wasn't there before)
    • If level 2:
      • <<Give the unit the Cargo Hold ability>> I put this in <> brackets because it will have already been done by another trigger you will create, but for completeness it's an important step I wanted to show
      • Set Flail Smack to level 1
      • Remove the Flail VFX passive ability
      • Do all the normal damaging stuff you have written in your trigger above
  • Make a second trigger that detects when a unit with the Flail Smack ability damages a unit with an attack (using DamageEngine)
    • If the current level of Flail Smack for that unit is 2, give the unit the Cargo Hold ability
    • This will cause it to cast Flail Smack immediately
By cycling between the Flail Smack ability at level 1 and level 2 you allow the cooldown to 'occur' normally and detect when that happens because the unit instantly casts Flail Smack when its available. You allow this to occur, remove the CH ability that enabled the cast, up the level by 1, and then wait for it to attack something. At that point you give it CH to trigger the cooldown again manually and set the level back to 1 to complete the loop.

If the unit with Cargo Hold can morph into another unit for any reason, then you'll need to use UnitMakeAbilityPermanent on the Flail VFX Passive and Cargo Hold abilities whenever you re-add them to the unit. Otherwise they will be lost upon morphing.
 
Level 39
Joined
Feb 27, 2007
Messages
5,014
Updating the game has nothing to do with Reforged. There are other problems with the current patches, though.

I believe the cooldown reset native doesn't exist in 1.30 so the only way to reset the ability cooldown is to remove it from the unit and then re-add it. Make sure you set the level to 2 after if you are going to do what I suggested.
 
Status
Not open for further replies.
Top