• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Tornado Suck-in trigger

Status
Not open for further replies.
Level 20
Joined
Jul 14, 2011
Messages
3,213
Hi!

I'm working on a TD where there's a Wind Elemental that has a random chance to create a tornado that sucks units in 350 AoE into it. To make it more realistic: near units are more attracted than far units.

The thing is, I don't want to interrupt unit orders so I have to do it with X/Y coords and i'm not that good on math.

It's not like Dota's Dark Seer Vaccum which sends them all to the center, but rather increase the "sucking power" nearer the units are from the base of the tornado.

I would really appreciate any help!


I also have an Earth elemental, but I don't know what AoE effect give to it. Any ideas?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Sure I can... the only order is "Attack"... but, as far as I know, working with real coords is faster than doing with locations..

Anyway, can you help me doing it either way?

BDW: Sorry If i said something wrong. English is not my native language.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,219
something like this i belive it should look like for my sulution
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Set point = (Position of (Target unit of ability being cast))
      • Unit Group - Pick every unit in (Units within vortex_area of point) and do (Actions)
        • Loop - Actions
          • Set Order = (Current order of (Picked unit))
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
That's the easy part xD How to "suck" units in?

When I said I wasn't good at math I meant to say "I have no Idea how to do this".
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
350 AOE is very insignificant small circle, and it would not affect the Sucking Power of a unit, I mean there is a small difference of Sucking Power if you include a small area to to cover compared to 1000 AOE, where you can see 500 distance unit are more attracted to 900 distance unit

If you are to use a 350-AOE, the difference is too small
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
But the roads where creeps goes by have about 350-400 width and they go right through the center, so, for 3 seconds, it will suck units and get them all together for other towers deal the AoE damage.

I want it to suck like an espiral... Like a big inverse toilet :) I think it will be noticeable... Anyway, if it's not enough I can just change the radius later, but the system would be the same... right?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Realistic. In spiral shape towards to the right (The direction tornados spin in Wc3)... I don't care if it's hard to do, I'm willing to put all my effort into it.

- Spiral shape towards right
- Increase the suction power the nearer the unit is to the tornado base
- If possible, better using X/Y instead of Loc.

I'm just thinking that maybe it could have around 500 AoE, but the units will move 350 distance towards the tornado in spiral shape, so, units in a distance lower or equal to 350 will end in the center of the tornado, while the other units will reach (500-350) distance towards the tornado, so, they would end up at 150 distance from the tornado... (Just an idea).
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • Untitled Trigger 001
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in SUCKERS and do (Actions)
        • Loop - Actions
          • Set u1 = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (u1 is alive) Equal to True
            • Then - Actions
              • Set p1 = (Position of u1)
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within MAX_PULL_DIST of p1) and do (Actions)
                • Loop - Actions
                  • Set u2 = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (u2 is alive) Equal to True
                      • (u2 is A structure) Equal to False
                    • Then - Actions
                      • Set p2 = (Position of u2)
                      • Set r1 = (Distance between p1 and p2)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • r1 Greater than 128.00
                        • Then - Actions
                          • Set r2 = (1.00 - (r1 / MAX_PULL_DIST))
                          • Set r3 = ((Angle from p1 to p2) - (r2 x MAX_SPIN_ANGLE))
                          • Set r1 = (r1 - (MAX_PULL_SPEED x r2))
                          • Custom script: call RemoveLocation(udg_p2)
                          • Set p2 = (p1 offset by r1 towards r3 degrees)
                          • Custom script: call SetUnitX(udg_u2, GetLocationX(udg_p2))
                          • Custom script: call SetUnitY(udg_u2, GetLocationY(udg_p2))
                          • Custom script: call RemoveLocation(udg_p2)
                        • Else - Actions
                          • Unit - Kill u2
                    • Else - Actions
              • Custom script: call RemoveLocation(udg_p1)
            • Else - Actions
              • Unit Group - Remove u1 from SUCKERS
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (SUCKERS is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions


http://www.hiveworkshop.com/forums/pastebin.php?id=d7uyma

There is no pathing detection, you need to add that.

The suction power will be 0 at max distance and full when distance is 0. You can ofcurse modify it by editing
Set r2 = (1.00 - (r1 / MAX_PULL_DIST)) . That will determine the pull power.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
OMG! It's so awesome! How can I make the unit move towards the tornado in the same cliff level? If I set the condition in the movement part it won't even move, so... ¿?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Ok... i got this


  • WindTornado
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Random integer number between 1 and 100) Less than or equal to 15
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units within 500.00 of (Position of GDD_DamagedUnit) matching ((Unit-type of (Matching unit)) Equal to Dummy Tornado))) Equal to 0
        • Then - Actions
          • Unit - Create 1 Dummy Tornado for Player 1 (Red) at (Position of GDD_DamagedUnit) facing Default building facing degrees
          • Unit Group - Add (Last created unit) to TornadoVortex
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
          • Trigger - Turn on WindTornadoLoop <gen>
        • Else - Actions
  • WindTornadoLoop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in TornadoVortex and do (Actions)
        • Loop - Actions
          • Set u1 = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (u1 is alive) Equal to True
            • Then - Actions
              • Set p1 = (Position of u1)
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within MAX_PULL_DIST of p1) and do (Actions)
                • Loop - Actions
                  • Set u2 = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (u2 is alive) Equal to True
                      • (u2 is A structure) Equal to False
                    • Then - Actions
                      • Set p2 = (Position of u2)
                      • Set r1 = (Distance between p1 and p2)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • r1 Greater than 128.00
                          • (Terrain cliff level at p1) Equal to (Terrain cliff level at p2)
                        • Then - Actions
                          • Set r2 = (1.00 - (r1 / MAX_PULL_DIST))
                          • Set r3 = ((Angle from p1 to p2) - (r2 x MAX_SPIN_ANGLE))
                          • Set r1 = (r1 - (MAX_PULL_SPEED x r2))
                          • Custom script: call RemoveLocation(udg_p2)
                          • Set p2 = (p1 offset by r1 towards r3 degrees)
                          • Custom script: call SetUnitX(udg_u2, GetLocationX(udg_p2))
                          • Custom script: call SetUnitY(udg_u2, GetLocationY(udg_p2))
                        • Else - Actions
                      • Custom script: call RemoveLocation(udg_p2)
                    • Else - Actions
              • Custom script: call RemoveLocation(udg_p1)
            • Else - Actions
              • Unit Group - Remove u1 from TornadoVortex
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (TornadoVortex is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions


The creeps just stop moving if they're in the same cliff level, I'd like them to move towards the tornado in the same level without going over cliffs and other unpathable terrains, like going in the border of the pathable way.
 
Status
Not open for further replies.
Top