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

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 18
Joined
Sep 26, 2009
Messages
2,086
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.
 
Top