• 🏆 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 that pauses units around it for a certain time does not work.

Status
Not open for further replies.
Level 4
Joined
Nov 6, 2011
Messages
44
  • Time Stop
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Time Stop
    • Actions
      • Unit Group - Pick every unit in (Units within 200.00 of (Position of (Casting unit))) and do (Actions)
        • Loop - Actions
          • Unit - Pause (Picked unit)
          • Animation - Change (Picked unit)'s animation speed to 0.00% of its original speed
          • Unit - Unpause (Casting unit)
          • Animation - Change (Casting unit)'s animation speed to 100.00% of its original speed
          • Wait 2.00 seconds
          • Unit - Unpause (Picked unit)
          • Animation - Change (Picked unit)'s animation speed to 100.00% of its original speed
What it does : Pauses units around it in a 200 AoE along with their animation, unpauses the caster and its animation, after 2 seconds, it still keeps the picked units paused with their animation.

What it's supposed to do : Pause units around it in a 200 AoE with animation, unpause caster and its animation, wait 2 seconds, unpause the picked units and their animation.

I am still starting out with spells.

Help would be appreciated. :)
 
Level 14
Joined
Aug 8, 2010
Messages
1,022
In the unit group, use the action "Set UnitGroup = Units in XXX range matching condition". In the action below, i use this : "Unit in XXX range matching ((Condition1 and Condition2) and (Condition3)"
  • Set UnitGroup = (Units within XXX of PointVariable matching ((((Matching unit) belongs to an ally of (Owner of Triggering Unit)) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((Unit-type of (Matching unit)) Not equal to Dummy))
This makes the action add to the group only units that are alive and are enemy to the caster. This means that the actions below are unneeded :
  • Unit - Unpause (Casting unit)
  • Animation - Change (Casting unit)'s animation speed to 100.00% of its original speed
It doesn't add dummies aswell. So your trigger should look like this now :
  • Time Stop
  • Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to Time Stop
  • Actions
  • Unit Group - Pick every unit in (Units within XXX of PointVariable matching ((((Matching unit) belongs to an ally of (Owner of Triggering Unit)) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((Unit-type of (Matching unit)) Not equal to Dummy)) and do (Actions)
  • Loop - Actions
  • Unit - Pause (Picked unit)
  • Animation - Change (Picked unit)'s animation speed to 0.00% of its original speed
  • Wait 2.00 seconds
  • Unit - Unpause (Picked unit)
  • Animation - Change (Picked unit)'s animation speed to 100.00% of its original speed
Without the Wait of course! You can check Hanky's Dynamic Indexing Template to design your trigger in another way without waits. Be wary of leaks too.
 
Level 5
Joined
May 20, 2008
Messages
138
Try this:

  • Time Stop
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Time Stop
  • Actions
    • Set TempPoint1 = Position of (Casting Unit)
    • Set TimeStopGroup = Units within 200.00 of (TempPoint1)
    • Custom script: call RemoveLocation(udg_TempPoint1)
    • Unit - Remove (Casting Unit) from TimeStopGroup
    • Unit Group - Pick every unit in TimeStopGroup and do (Actions)
      • Loop - Actions
        • Unit - Pause (Picked unit)
        • Animation - Change (Picked unit)'s animation speed to 0.00% of its original speed
    • Wait 2.00 seconds
    • Unit Group - Pick every unit in TimeStopGroup and do (Actions)
      • Loop - Actions
        • Unit - Unpause (Picked unit)
        • Animation - Change (Picked unit)'s animation speed to 100.00% of its original speed
    • Custom script: call DestroyGroup(udg_TimeStopGroup)
TempPoint1 and TimeStopGroup are variables that you have to create in the variable editor (The yellow "X" button in the trigger editor). The custom scripts remove the variables from the game memory when you have finished using them (prevents memory leaks).
 
Status
Not open for further replies.
Top