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

Pause Ensnared Units

Status
Not open for further replies.
Level 10
Joined
Feb 19, 2006
Messages
237
I would like a trigger that will prevent ensnared units from attacking. This is what i have come up with so far.

  • PauseEnsnaredUnits
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Ensnare (Ground)) Equal to True
            • Then - Actions
              • Unit - Pause (Picked unit)
            • Else - Actions
              • Unit - Unpause (Picked unit)
Is this an efficient way to do this? Is there a trigger that would use up less memory/cpu while accomplishing the same task?
 
Level 15
Joined
Oct 16, 2010
Messages
941
There's some problems with pausing units so if the Ensare has a fixed duration I would reccomend creating a dummy unit and stunning the target for however many seconds you want (remove the swirly effect and re-name the buff ensare)

As far as the pause/unpause thing goes if you still choose to do it that way, I would reccomend you add any unit that gets ensared to an ensare group and pause them. Then periodically check those within the group to see if they have the ensare buff and if they don't unpause them and remove them from the group.

Hope I helped somewhat and didn't just confuse you ^-^
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Use Entangling Root-based ability
Change the Entangling Root's Buff
From the Buffs/Effects Tab in Object Editor, search for Entangling Root
Change the "Art - Target" to "Ensnare (General) <Target>, Ensnare (Ground) <Target>"

By using Entangling Roots ability, the unit that is affected CANNOT move/attack but still can cast spell
If you want the Missile Effect (a net is thrown from the caster's position), just use dummy unit for that and use the real Ensnare ability (ONLY and ONLY for the ANIMATION/EFFECT)
Make sure to change the effect ti 0.01 (this is ONLY for the net to fly from the caster's position towards the targeted unit)
 
Level 12
Joined
Nov 20, 2007
Messages
660
I would like a trigger that will prevent ensnared units from attacking. This is what i have come up with so far.

  • PauseEnsnaredUnits
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Ensnare (Ground)) Equal to True
            • Then - Actions
              • Unit - Pause (Picked unit)
            • Else - Actions
              • Unit - Unpause (Picked unit)
Is this an efficient way to do this? Is there a trigger that would use up less memory/cpu while accomplishing the same task?

I suggest you to make a unit group and check if the unit is in that group
  • PauseEnsnaredUnits
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Ensnare (Ground)) Equal to True
            • Then - Actions
              • If - Conditions
                • (Unit is in unit group(Mygroup) Equal to False
                  • Unit - Add to group(My group)
                  • Unit - Pause (Picked unit)
                • Else - Actions
                  • Unit - Remove from group (My group)
                  • Unit - Unpause (Picked unit)
Still need help ? replay me, and if you want i can make this spell for you
 
Status
Not open for further replies.
Top