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

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