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

[Trigger] Move units in range to a point with an animation

Status
Not open for further replies.
Level 5
Joined
Feb 18, 2016
Messages
96
So i made a skill that moves all enemy units in range to a point but i want this trigger to be a bit animated instead of instatly move.
  • Detener
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Custom Ability
    • Actions
      • Set ETPoint = (Position of (Target unit of ability being cast))
      • Set ETGroup = (Units within 500.00 of ETPoint)
      • Unit Group - Pick every unit in ETGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True
              • ((Picked unit) is A structure) Equal to False
            • Then - Actions
              • Unit - Move (Picked unit) instantly to ETPoint
            • Else - Actions
      • Custom script: call DestroyGroup (udg_ETGroup)
      • Custom script: call RemoveLocation (udg_ETPoint)
How can i add a short animation of units moving to center to this ability? I know i should use the
  • Events
    • Time - Every 0.03 seconds of game time
  • Conditions
  • Actions
but I did not know how to do it correctly
 
You want to learn or to create this spell?

Only Create:
If you only want to add an animated move you could search in the Spell-section for "Knockback"/"Charge" -> find a suiting System and importing it to your map.
for example: GUI Knockback 2.5D v4.2.3.1 by Bribe

Learn:
You need to somehow save the Angel/Speed/Duration of the Knockback for each affected Unit and inser them in an constant group which represents all affected Units.
This can be archieved by Using an Unit-Indexer or by Using an Hashtable.
During loop you load values and move the Units according to the loaded until a unit's Exit-Condition is valid -> remove it from the Group.
The Constant Group needs to be created before else it won't work

This would work but might bring problems with walkablity and Unit Colision.
  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Create an Empty Group --------
      • Set Knockback_Affected = (Units in (Playable map area) matching (False Gleich True))
  • loop Unit indexer
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Einheitengruppe - Pick every unit in Knockback_Affected and do (Actions)
        • Schleifen - Aktionen
          • -------- Represents the Affectes Units Index, granted by the Unit Indexer --------
          • Set Index = (Custom value of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Condition
              • Knockback_Duration[Index] > 0
            • Then - Actions
              • Set loc = (Position of (Picked unit))
              • Set loc2 = (loc offset by Knockback_Speed[Index] towards Knockback_Angel[Index] degrees)
              • Einheit - Move (Picked unit) instantly to loc2
              • Custom script: call RemoveLocation(udg_loc2)
              • Custom script: call RemoveLocation(udg_loc)
              • Set Knockback_Duration[Index] = (Knockback_Duration[Index] - 1)
            • Else - Actions
              • Einheitengruppe - Remove (Picked unit) from Knockback_Affected
 
Last edited:
Level 5
Joined
Jan 17, 2014
Messages
131
So i made a skill that moves all enemy units in range to a point but i want this trigger to be a bit animated instead of instatly move.
  • Detener
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Custom Ability
    • Actions
      • Set ETPoint = (Position of (Target unit of ability being cast))
      • Set ETGroup = (Units within 500.00 of ETPoint)
      • Unit Group - Pick every unit in ETGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True
              • ((Picked unit) is A structure) Equal to False
            • Then - Actions
              • Unit - Move (Picked unit) instantly to ETPoint
            • Else - Actions
      • Custom script: call DestroyGroup (udg_ETGroup)
      • Custom script: call RemoveLocation (udg_ETPoint)
How can i add a short animation of units moving to center to this ability? I know i should use the
  • Events
    • Time - Every 0.03 seconds of game time
  • Conditions
  • Actions
but I did not know how to do it correctly

Order them to move to the location.

  • Unit Group - Order temp_group to Move To temp_location
 
Status
Not open for further replies.
Top