• 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.

angle restrictions in casting a target point spell, help!

Status
Not open for further replies.
Level 2
Joined
Jan 27, 2009
Messages
15
i need help in forcing my unit to only cast the target point spell in 45 to 135 degrees only. when the angle from the caster to the target point is greater than 135 the angle will be then changed to 135 and if lower than 45 it changes to 45. i already tried adding conditions;

  • Set Leak_Unit = (Triggering unit)
  • Set Leak_Points[0] = (Position of Leak_Unit)
  • Set Leak_Points[1] = (Target point of ability being cast)
  • Set Leak_Real = (Angle from Leak_Points[0] to Leak_Points[1])
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Leak_Real Greater than 135.00) and (Leak_Real Greater than or equal to 270.00)
    • Then - Actions
      • Set SS_Point[SS_Integers[2]] = (Leak_Points[0] offset by 256.00 towards 135.00 degrees)
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Leak_Real Less than 45.00) and (Leak_Real Greater than 270.00)
        • Then - Actions
          • Set SS_Point[SS_Integers[2]] = (Leak_Points[0] offset by 256.00 towards 45.00 degrees)
        • Else - Actions
          • Set SS_Point[SS_Integers[2]] = (Target point of ability being cast)
  • Set SS_Angle[SS_Integers[2]] = (Angle from Leak_Points[0] to SS_Point[SS_Integers[2]])
the SS_Angle is then used as the angle to send the missile. but it still shoots around except when i shoot from 135 to 180 degrees it works, sending the missile at 135 degrees but other than that its still shoots around... T_T

Is there a better method other than this?
 
Status
Not open for further replies.
Top