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

[Spell] [Reforged] Freeze animation on Bash-Stun

Status
Not open for further replies.
Level 12
Joined
May 16, 2020
Messages
660
Hi all,

I want to re-create the ability "Time Lock" from Dota. It's basically Bash with a trigger that freezes the animation of a unit when stunned.

My triggers work for 1 stunned unit. But as soon as 2 units are affected by the stun, the trigger bugs out: The first stunned unit's animation is frozen forever, while the 2nd stunned unit works normal.

Does anyone have a clever idea how to solve this, while keeping this as performance friendly as possible? (I don't want to have a 0.05 interval running 24/7 in the background)

Thanks!



  • Time Lock new
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (GDD_DamagedUnit has buff Time Lock (Pause)) Equal to True
    • Actions
      • Set VariableSet TimeLock_Count = (TimeLock_Count + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TimeLock_Count Greater than Universal_CountMaxSize
        • Then - Actions
          • Set VariableSet TimeLock_Count = 1
        • Else - Actions
      • Custom script: set udg_TimeLock_Group[udg_TimeLock_Count] = CreateGroup()
      • Unit Group - Add GDD_DamagedUnit to TimeLock_Group[TimeLock_Count]
      • Trigger - Turn on Time Lock Loop <gen>
  • Time Lock Loop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in TimeLock_Group[TimeLock_Count] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Time Lock (Pause)) Equal to True
            • Then - Actions
              • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Undead\AbsorbMana\AbsorbManaBirthMissile.mdl
              • Special Effect - Destroy (Last created special effect)
              • Animation - Change (Picked unit)'s animation speed to 0.00% of its original speed
            • Else - Actions
              • Unit Group - Remove (Picked unit) from TimeLock_Group[TimeLock_Count].
              • Animation - Change (Picked unit)'s animation speed to 100.00% of its original speed
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TimeLock_Group[TimeLock_Count]) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Custom script: call DestroyGroup (udg_TimeLock_Group[udg_TimeLock_Count])
        • Else - Actions
 
Level 12
Joined
May 16, 2020
Messages
660
Just solved it myself by using 3 triggers. In case someone else has the same problem, here my solution:

  • TimeLock Learn
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Time Lock
      • (Learned skill level) Equal to 1
    • Actions
      • Trigger - Turn on TimeLock Loop <gen>
  • TimeLock Loop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in TimeLock_LockedUnits and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Time Lock (Pause)) Equal to False
            • Then - Actions
              • Animation - Change (Picked unit)'s animation speed to 100.00% of its original speed
              • Unit Group - Remove (Picked unit) from TimeLock_LockedUnits.
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (TimeLock_LockedUnits is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn on TimeLock Start again <gen>
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Time Lock (Pause)) Equal to True)) and do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Undead\AbsorbMana\AbsorbManaBirthMissile.mdl
          • Special Effect - Destroy (Last created special effect)
          • Animation - Change (Picked unit)'s animation speed to 0.00% of its original speed
          • Unit Group - Add (Picked unit) to TimeLock_LockedUnits
      • Custom script: call DestroyGroup(GetLastCreatedGroup())
  • TimeLock Start again
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • (Level of Time Lock for DamageEventSource) Greater than 0
    • Actions
      • Trigger - Turn on TimeLock Loop <gen>
      • Trigger - Turn off (This trigger)
 
Status
Not open for further replies.
Top