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

[Trigger] Problems with angles facing and offset...

Status
Not open for further replies.
Level 3
Joined
Sep 9, 2015
Messages
56
So I have a custom ability just like mirror image but the caster splits up into three units (unaffected by dispels and not mirror image but original), my problem is that I cannot make them summon in a way it should be (take a look on this pic):


247800-albums8466-picture102321.jpg




EXPLANATION:
The yellow boundary is the limit angle (I guess 270 degress to 90 degrees) where I can summon the copies of the caster.
The problem is that SOME instances, the copies are summoned at the back of the caster.

The correct function must be that the copies are summoned in within the yellow boundary and offsets are considered.


--------

  • Chal Trilocation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Trilocation
        • Then - Actions
          • Set A_Chal_Trilocation_Index = (A_Chal_Trilocation_Index + 1)
          • Set A_Chal_Trilocation_Caster[A_Chal_Trilocation_Index] = (Casting unit)
          • Set A_Chal_Trilocation_Distance[A_Chal_Trilocation_Index] = ((Position of A_Chal_Trilocation_Caster[A_Chal_Trilocation_Index]) offset by (Random real number between 300.00 and 600.00) towards (Random real number between 90.00 and 270.00) degrees)
          • Unit - Create 1 Footman for Player 1 (Red) at A_Chal_Trilocation_Distance[A_Chal_Trilocation_Index] facing (Facing of A_Chal_Trilocation_Caster[A_Chal_Trilocation_Index]) degrees
        • Else - Actions


Any fix?
 
Last edited:
Level 25
Joined
Sep 26, 2009
Messages
2,387
When you look at the caster, the angle 90 is above caster (to the north), 180 is to the left of him (west) and 270 is below him (south). If anything, you need to use arithmetic function like and facing of unit like (facing of caster) + (random number between 0 and 180), etc.
 
Status
Not open for further replies.
Top