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

[General] Skillshot in cone

Status
Not open for further replies.
Level 5
Joined
Dec 25, 2018
Messages
110
I want my hero to throw 3 projectiles in a cone, something like this:
upload_2019-12-18_13-15-1.png

I tried doing it like this:

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Facing of SS_Caster[SS_iM]) Less than or equal to 360.00
              • (Facing of SS_Caster[SS_iM]) Greater than or equal to 300.00
          • And - All (Conditions) are true
            • Conditions
              • (Facing of SS_Caster[SS_iM]) Greater than or equal to 150.00
              • (Facing of SS_Caster[SS_iM]) Less than or equal to 250.00
    • Then - Actions
      • Set SS_tLoc[SS_iM] = (PositionOfChargedSpell[(Player number of (Owner of (Triggering unit)))] offset by (0.00, -130.00))
    • Else - Actions
      • Set SS_tLoc[SS_iM] = (PositionOfChargedSpell[(Player number of (Owner of (Triggering unit)))] offset by (-130.00, 0.00))
But that's not consistent, does anyone know smarter way to do it?
 
Level 39
Joined
Feb 27, 2007
Messages
5,016
Ideally it would be a loop:
  • Set Count = 3
  • Set Spread = 80.00
  • Set Angle = ((Facing of (Triggering Unit)) - (Spread/2))
  • For each (Integer A) from 1 to Count do (Actions)
    • Loop - Actions
      • Set Angle = (Angle + (Spread/Count))
      • -------- do whatever ---------
 
Level 24
Joined
Nov 9, 2006
Messages
2,558
This method is the most flexible.
Ignore the leaks and obvious shit.
  • Melee Initialization
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shockwave
    • Actions
      • Set ConeWidth = 90.00
      • Set Projectiles = 3
      • Set ConeWidthSpread = (ConeWidth / (Real(Projectiles)))
      • Set TemporaryReal = ((Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) - (ConeWidth / 2.00))
      • For each (Integer A) from 1 to Projectiles, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at ((Position of (Triggering unit)) facing (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees
          • Unit - Add Shockwave to (Last created unit)
          • Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave ((Position of (Triggering unit)) offset by 600.00 towards TemporaryReal degrees)
          • Set TemporaryReal = (TemporaryReal + ConeWidthSpread)
 
Status
Not open for further replies.
Top