• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Casting of "Crushing Wave" spell in all directions

Status
Not open for further replies.
Level 22
Joined
Aug 27, 2013
Messages
3,973
It should be something like this
  • YourTower
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • -------- Your Tower Location --------
      • Set TempPoint = (Position of YourTower)
      • -------- Your point target ability location --------
      • Set TempPoint2 = (TempPoint offset by 300.00 towards TowerAngle degrees)
      • -------- Create a custom Crushing Wave ability based on Carrion Swarm --------
      • -------- Then order your tower to cast it --------
      • Unit - Order YourTower to Undead Dreadlord - Carrion Swarm TempPoint2
      • -------- Keep track of the angle which always changing every 2 seconds --------
      • Set TowerAngle = (TowerAngle + 20.00)
      • -------- Remove leaks --------
      • Custom script: call RemoveLocation(TempPoint)
      • Custom script: call RemoveLocation(TempPoint2)
Make sure to make a Crushing Wave based on Dreadlord's Carrion Swarm.
 
Level 8
Joined
Jan 28, 2016
Messages
486
I thought he wanted the tower to cast the spell in each direction every two seconds, like below.

I assumed this is for a pre-placed tower because I'm lazy at the moment and didn't want to go through making this MUI. We can do that later on if you need to, but you'll have to give us some more information about your spell and possibly your map. In the meantime, there's this.

The first trigger just sets up a few variables. Since you said it was a tower, I assumed that it wouldn't be able to move and so you can store it's position in a variable without having to clear the leak and create a dummy unit at that same position. I also stored the number of waves and the degrees between each wave; in this case, 18 and 20 respectively.

  • Aqua Nova Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Position = (Position of Tower 0000 <gen>)
      • Set NumberOfWaves = 18
      • Set Angle = (360 / TempIntLevels)
      • Unit - Create 1 DummySpecial for (Owner of Tower 0000 <gen>) at Position facing Default building facing degrees
      • Set DummySpecial = (Last created unit)
      • -------- No need to clear the location leak here because we will use it for the loop --------

The key thing to take from the periodic trigger is the loop; it will run though the actions once from 1 to 18 (18 = NumberOfWaves). For each time, it will set the angle, the target point and cast the wave. So at 1, 2, 3, ..., 18, the angles will be 20, 40, 60, ..., 360 (0). The offset amount isn't an issue unless it's beyond the cast range of the dummy spell. And a Rheiko stated above, it's best to use Carrion Swarm as Crushing Wave has an inherent lag associated with it that cannot be fixed (same goes for War Stomp, Thunder Clap and Shockwave).

  • Aqua Nova Periodic
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer TempInteger) from 1 to NumberOfWaves, do (Actions)
        • Loop - Actions
          • Set TempReal = (0.00 + (Real((Angle x TempInteger))))
          • Set Location = (Position offset by 256.00 towards TempReal degrees)
          • Unit - Order DummySpecial to Undead Dreadlord - Carrion Swarm Location
          • Custom script: call RemoveLocation( udg_Location )
 
Last edited:
Level 13
Joined
May 10, 2009
Messages
868
Rheiko's trigger casts one crushing wave every 2 seconds, but it also changes the angle with every cast, adding +20 to it. While Dehua_Darbuya's casts, at once, 18 crushing waves in a different angle at a tower location.
 
Level 13
Joined
May 10, 2009
Messages
868
One thing that I forgot to say is, the Angle variable that Dehua_Darbuya created is diving 360 by a variable (TempIntLevels) that has not value set before.
  • Set Angle = (360 / TempIntLevels)
So, it should probably be something like this:
  • Set Angle = (360 / NumberOfWaves)
And this:
  • Set TempReal = (0.00 + (Real((Angle x TempInteger))))
should be:
  • Set TempReal = (Real((Angle x TempInteger)))
 
Level 11
Joined
Nov 25, 2014
Messages
526
Will this be OK as well?

  • Baellarum Might
  • Events
  • Unit - A unit starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to Heat Wave Roar
  • Actions
  • For each (Integer A) from 1 to 20, do (Actions)
  • Loop - Actions
  • Set baellarum1 = (Position of (Casting Unit))
  • Set baellarum2 = (baellarum1 offset by 500.00 towards (18 x (Real((Integer A)))) degrees)
  • Unit - Create 1 Dummy for (Owner of (Casting Unit)) at baellarum1 facing (Angle from baellarum1 to baellarum2) degrees
  • Unit - Add Heat Wave Dummy to (Last Created Unit)
  • Unit - Add a 1.00 second Generic expiration timer to (Last Created Unit)
  • Unit - Order (Last Created Unit) to Undead Dreadlord - Carrion Swarm baellarum2
  • Custom script: call RemoveLocation(udg_baellarum1)
  • Custom script: call RemoveLocation(udg_baellarum2)
 
Level 11
Joined
Nov 25, 2014
Messages
526
*I'm not with my laptop now... this Saturday perhaps*

So, yours is releasing a wave at each specified angle after each passing second right?
So if I want to launch all waves in different angles at the SAME TIME, that trigger also helps? Does it leak?
 
Level 11
Joined
May 16, 2016
Messages
730
So basically both of our triggers don't leakk...... right? o_O
in your trigger I've found one problem.
1.baelarum1 point must be outside the loop (and remove loc baelarum1 also must stay after the loop)
2. Loop triggers are very unfriendly to locations variables. You need to create array (baelarumM[x] for example and then
set baelarumM[Integer A] = blah blah
then remove location. These two actions must be inside the loop.
 
Level 8
Joined
Jan 28, 2016
Messages
486
To add to what @Fruit Forest said, you should also move your dummy unit outside the loop instead of creating a new dummy every angle. And you don't need a location array like he said because you set and destroy the location each time, one after the other. Here's the trigger by the way.

  • Baellarum Might
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Heat Wave Roar
    • Actions
      • Set Baellarum1 = (Position of (Triggering unit))
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at Baellarum1 facing Default building facing degrees
      • Set DummyUnit = (Last created unit)
      • Unit - Add Heat Wave Dummy to DummyUnit
      • Unit - Add a 1.00 second Generic expiration timer to DummyUnit
      • For each (Integer TempInteger) from 1 to 20, do (Actions)
        • Loop - Actions
          • Set Baellarum2 = (Baellarum1 offset by 256.00 towards (Real((18 x TempInteger))) degrees)
          • Unit - Order DummyUnit to Undead Dreadlord - Carrion Swarm Baellarum2
          • Custom script: call RemoveLocation(udg_Baellarum2)
      • Custom script: call RemoveLocation(udg_Baellarum1)
 
Level 11
Joined
May 16, 2016
Messages
730
To add to what @Fruit Forest said, you should also move your dummy unit outside the loop instead of creating a new dummy every angle. And you don't need a location array like he said because you set and destroy the location each time, one after the other. Here's the trigger by the way.
The problem is will the dummy unit can cast 20 times at the instant moment? Ithink the part about create 20 dummies was right.
 
Status
Not open for further replies.
Top