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

[Solved] Dynamic Tornadoes! Help!

Status
Not open for further replies.
Level 2
Joined
Dec 29, 2017
Messages
16
Hello! this is my first post here, so sorry if I don't get it right.

I am trying to create a trigger that enables a knock back effect when a unit walks into a radius around the same unit type (in this case a tornado dummy with wander passive) regardless of how that unit came into play (Placed in editor, created with a trigger, etc) To do this, I used a 3 step trigger queue

First, it picks all "Dummy Tornadoes" in the playable map area, and sets some variables
Second, a trigger is in place that "turns on" another trigger when a unit comes within x range of any tornado
Third, trigger that "Turns on" is basically an effect that knocks back all units and turns off after .50 seconds

First Trigger
  • Pick Tornado
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Dummy Tornado) and do (Actions)
        • Loop - Actions
          • Set Tornado = (Picked unit)
          • Set TornadoGroup = (Units within 200.00 of (Position of (Picked unit)))
          • Set TornadoOrigin = (Position of (Picked unit))
Second Trigger
  • Tornado Active
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
      • (Number of units in (Units within 200.00 of (Position of Tornado))) Greater than or equal to 1
    • Actions
      • Special Effect - Create a special effect attached to the chest of (Matching unit) using Abilities\Spells\Other\Tornado\Tornado_Target.mdl
      • Trigger - Turn on Tornado Knockback Effect <gen>
      • Wait 0.80 seconds
      • Trigger - Turn off Tornado Knockback Effect <gen>
Third trigger
  • Tornado Knockback Effect
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Set Tempgroup = (Units within 400.00 of (Position of Tornado))
      • Unit Group - Pick every unit in Tempgroup and do (Actions)
        • Loop - Actions
          • Set tornadovictimpos = (Position of (Picked unit))
          • Set TornadoPos = (Position of Tornado)
          • Unit - Move (Picked unit) instantly to (tornadovictimpos offset by 20.00 towards (Angle from TornadoPos to tornadovictimpos) degrees)
          • Custom script: call RemoveLocation (udg_TornadoPos)
          • Custom script: call RemoveLocation (udg_tornadovictimpos)
          • Custom script: call DestroyGroup (udg_Tempgroup)
The issue im running into, is that if I have more than 1 tornado on the map, the triggers only run for one, and the rest do nothing. Is there a solution to this without causing major leaks? Thank you!
 
Last edited:
Level 2
Joined
Dec 29, 2017
Messages
16
I'm not sure but did you try "For each Integer A, Do Multiple Actions"? This will loop actions for a period between 1 and unlimited.
I am not sure how to set the variable array value of all picked tornadoes on the map to different values, is there a math forumla that does that?

The problem is that when i use "Pick all units in (Playable map area) and do actions" and then use "Set variable blablabla" I would have to set an index a number, which in theory would make all tornadoes on the map set the array value 1 (For example) making an integer loop impossible.
 
Status
Not open for further replies.
Top