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

[Trigger] Arrow Volley - not really a volley

Status
Not open for further replies.
Level 11
Joined
Jun 26, 2014
Messages
497
The spell should be a volley/barrage of arrows simillar to the one that Ashe from LoL has. It's based of from flame strike and the dummy spell is based off from carrior swarm. The problem is that when the archer casts the spell only one arrow shoots out at the targeted area. What do I need to change so that multiple arrows go flying in the direction.

Trigger:
  • Arrow Barrage
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Arrow Barrage
    • Actions
      • For each (Integer A) from 1 to 20, do (Actions)
        • Loop - Actions
          • Set SpellABarrageUnit = (Casting unit)
          • Set SpellABarragePoint[1] = (Position of SpellABarrageUnit)
          • Set SpellABarragePoint[2] = (Target point of ability being cast)
          • Set SpellABarragePoint[3] = (SpellABarragePoint[2] offset by 100.00 towards (18.00 x (Real((Integer A)))) degrees)
          • Unit - Create 1 Arrow Barrage Dummy for (Owner of SpellABarrageUnit) at SpellABarragePoint[1] facing (Angle from SpellABarragePoint[1] to SpellABarragePoint[3]) degrees
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm SpellABarragePoint[3]
          • Custom script: call RemoveLocation (udg_SpellABarragePoint[1])
          • Custom script: call RemoveLocation (udg_SpellABarragePoint[2])
          • Custom script: call RemoveLocation (udg_SpellABarragePoint[3])
 
Level 8
Joined
Jan 28, 2016
Messages
486
The way your trigger is set up at the moment, it will fire 20 arrows in a circle around the caster if I'm not mistaken. It will also fire all those arrows at the same time rather than one after the other.

To get the arrows to fire in the same direction, you need to save the angle between the caster and the target point. As for firing the arrows one after the other, you would need a periodic trigger so that every X seconds the dummy will fire an arrow at the angle set in the cast trigger. You'll need to use dynamic indexing (or hashtables) to make this part MUI.

P.S.: Ashe's volley is similar to Lucien's ultimate, right? :eek:
 
Level 38
Joined
Feb 27, 2007
Messages
4,951
I don't see anything that would cause it not to run, but the way it's currently set up it should launch 20 carrion swarms in a circle away from the target point (18 degrees per swarm * 20 swarms = 360 degrees coverage). Is that what you wanted? It's effectively a Gragas ult, not an Ashe volley. To fix that you'd need to take the cast angle into account and then offset your 20 target points from there.

Edit: Mother fuck, literally a minute too slow.

The way your trigger is set up at the moment, it will fire 20 arrows in a circle around the caster if I'm not mistaken.

P.S.: Ashe's volley is similar to Lucien's ultimate, right? :eek:
It's a circle centered at SpellABarragePoint[2]. And kinda but not really. Ashe is an arc of arrows fired at once and Lucian is a barrage of bullets all in the same direction sequentially for a few seconds.


You can set SpellABarrageUnit and SpellABarragePoint[1]/[2] before the loop since you don't need to remove and then reset them every time.
  • Arrow Barrage
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Arrow Barrage
    • Actions
      • Set SpellABarrageUnit = (Casting unit)
      • Set SpellABarragePoint[1] = (Position of SpellABarrageUnit)
      • Set SpellABarragePoint[2] = (Target point of ability being cast)
      • For each (Integer A) from 1 to 20, do (Actions)
        • Loop - Actions
          • Set SpellABarragePoint[3] = (SpellABarragePoint[2] offset by 100.00 towards (18.00 x (Real((Integer A)))) degrees)
          • Unit - Create 1 Arrow Barrage Dummy for (Owner of SpellABarrageUnit) at SpellABarragePoint[1] facing (Angle from SpellABarragePoint[1] to SpellABarragePoint[3]) degrees
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm SpellABarragePoint[3]
          • Custom script: call RemoveLocation (udg_SpellABarragePoint[3])
      • Custom script: call RemoveLocation (udg_SpellABarragePoint[1])
      • Custom script: call RemoveLocation (udg_SpellABarragePoint[2])
 
Level 11
Joined
Jun 26, 2014
Messages
497
Yea I was watching a tutorial on how to do an AoE spell around the caster and I tought I could change it a bit and make my spell work but it didn't happen. Now when I moved the SpellABarrageUnit outside of the Integer A loop it worked, but all the arrows went to the center of the map and were very strangely spread. Could u post me the triggers of how the spell should look? How do I have to save the angle that it is casted at and how do I use that saved angle?
 
Level 38
Joined
Feb 27, 2007
Messages
4,951
The only change to my above trigger post is how to calculate the angles and target points. And I offset by 10.00 rather than 100.00 but that's just preference. I've kept your naming convention, but for things you don't have to store long-term it's generally better to have a couple generic TempPoint, TempReal, TempUnit in your variable editor. Nothing wrong with doing it your way, just array allocations technically take more memory than non array variables of the same type, even if you're only using 1 index.

Basically you get the angle between the caster and target (SpellABarrageReal[2]) minus half of the total angle spread (SpellABarrageReal[1]). Then with each carrion swarm cast you just increase SpellABarrageReal[2] by 1/19th of the total spread angle (what I call the increment angle), basically like you're working your way through the arc from the bottom, one cast at a time.

Why not 1/20th? If you do that then the last cast carrion swarm won't be on the outer edge of the cone, it will be 1/20th of the spread angle short. Imagine a simple case where your spread is 45 degrees, you shoot 3 arrows, and you ignore the cast angle entirely. 45/3 = 15 degrees per arrow and the first one starts at 0 degrees: 0, 15, 30. Where's the 45 degree one? Now you have a 30 degree spread instead! If alternatively you do 45/2 = 22.5 then you cast arrows at: 0, 22.5, 45 degrees again! So we must subtract 1 from the denominator before computing our increment angle.

  • Arrow Barrage
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Arrow Barrage
    • Actions
      • Set SpellABarrageUnit = (Casting unit)
      • Set SpellABarragePoint[1] = (Position of SpellABarrageUnit)
      • Set SpellABarragePoint[2] = (Target point of ability being cast)
      • Set SpellABarrageInt[1] = 20 //The number of arrows. If you set this to 1 you'll get a divide by 0 error lower down
      • Set SpellABarrageReal[1] = 45.00 //This is your spread angle: what arc the arrows cover
      • Set SpellABarrageReal[2] = (Angle between SpellABarragePoint[1] and SpellABarragePoint[2]) - (SpellABarrageReal[1]/2)
      • Set SpellABarrageReal[3] = SpellABarrageReal[1]/(SpellABarrageInt[1]-1) //This could be /0 error
      • For each (Integer A) from 1 to SpellABarrageInt[1], do (Actions)
        • Loop - Actions
          • Set SpellABarragePoint[3] = (SpellABarragePoint[1] offset by 10.00 towards (SpellABarrageReal[2]) degrees)
          • Set SpellABarrageReal[2] = SpellABarrageReal[2] + SpellABarrageReal[3]
          • Unit - Create 1 Arrow Barrage Dummy for (Owner of SpellABarrageUnit) at SpellABarragePoint[1] facing (Angle from SpellABarragePoint[1] to SpellABarragePoint[3]) degrees
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm SpellABarragePoint[3]
          • Custom script: call RemoveLocation (udg_SpellABarragePoint[3])
      • Custom script: call RemoveLocation (udg_SpellABarragePoint[1])
      • Custom script: call RemoveLocation (udg_SpellABarragePoint[2])
You should consider that any unit that gets hit by multiple carrion swarms will take damage from each one, so a unit very close to the caster might take 5x or 10x damage from the spell. I think you can avoid this by making Carrion Swarm cast in a cone rather than a line. There should be some options for start width and end width, so make it start at 0 (or 1?) width and compute how wide it should be from the number of arrows, the distance they travel, and the spread angle.
 
Level 11
Joined
Jun 26, 2014
Messages
497
You should consider that any unit that gets hit by multiple carrion swarms will take damage from each one, so a unit very close to the caster might take 5x or 10x damage from the spell. I think you can avoid this by making Carrion Swarm cast in a cone rather than a line. There should be some options for start width and end width, so make it start at 0 (or 1?) width and compute how wide it should be from the number of arrows, the distance they travel, and the spread angle.

Thanks a lot for the help, unfortunately I have to go to school now so I don't have time to check out if it'll work out properly or not. I'll post updates this night.

Edit: Okay it's working but there is one problem. The end of the arc starts from the cast point. What I need is so that the center of the arc should be on the cursor/center of cast point.
 
Last edited:
Status
Not open for further replies.
Top