Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Variables:
unit1, unit2 = unit variables
loc1, loc2 = point variables
angle = real variable
Actions

-------- --------------------------------- --------

-------- -- Set variables -- --------

-------- --------------------------------- --------

Set unit1 = (Triggering unit)

Set loc1 = (Position of unit1)

Set angle = (Facing of unit1)

-------- --------------------------------- --------

-------- - Check nearby units - --------

-------- --------------------------------- --------

Custom script: set bj_wantDestroyGroup = true

Unit Group - Pick every unit in (Units within 900.00 of loc1) and do (Actions)


Loop - Actions



Set unit2 = (Picked unit)



Set loc2 = (Position of unit2)



If (All Conditions are True) then do (Then Actions) else do (Else Actions)




If - Conditions





(unit2 is alive) Equal to True





(unit2 belongs to an enemy of (Owner of unit1)) Equal to True





(Acos((Cos((angle - (Angle from loc1 to loc2)))))) Less than or equal to 45.00




Then - Actions





-------- IN --------




Else - Actions





-------- OUT --------



Custom script: call RemoveLocation(udg_loc2)

-------- --------------------------------- --------

-------- ------ Clear Leaks ------ --------

-------- --------------------------------- --------

Custom script: call RemoveLocation(udg_loc1)

Custom script: set udg_loc1 = null

Custom script: set udg_loc2 = null
Actions

Set unit1 = (Triggering unit)

Set loc1 = (Position of unit1)

Set loc2 = (Position of (Target unit of ability being cast))

Set angle = (Angle from loc1 to loc2)

Custom script: call RemoveLocation(udg_loc2)

Custom script: set udg_loc2 = null
Actions

Set unit1 = (Triggering unit)

Set loc1 = (Position of unit1)

Set loc2 = (Target point of ability being cast)

Set angle = (Angle from loc1 to loc2)

Custom script: call RemoveLocation(udg_loc2)

Custom script: set udg_loc2 = null
Actions

Set facing = (Facing of Unit)

Set pt1 = (Position of Unit)

Unit Group - Pick every unit in (Units within 512.00 of (pt1) and do (Actions)


Schleifen - Aktionen



Set pt2 = (Position of (Picked unit))



Set angle = (Angle from pt1 to pt2)



If (All Conditions are True) then do (Then Actions) else do (Else Actions)




'IF'-Bedingungen





angle < (facing + 45.00)





angle > (facing - 45.00)




Then - Actions





Game - Display to (All players) the text: in cone




Else - Actions





Game - Display to (All players) the text: not in cone


... remove leaks
I don't think that will work well.If it's too complicated with cos you also simple could do:
Angle between points:
135° 90° 45°
|
180° ---|--- 0°
|
[B][COLOR="Yellow"]-135° -90° -45°[/COLOR][/B]
------------
Facing of unit:
135° 90° 45°
|
180° ---|--- 0°
|
[B][COLOR="yellow"]225° 270° 315°[/COLOR][/B]
Inefficient and obsolete.(Acos((Cos((angle - (Angle from loc1 to loc2)))))) Less than or equal to 45.00 Thats what i seeked for 6 hours !!
Elaborate? In what way were they weird. Do not just say "it did not work", I want to know the actual values being returned compared with the expected values.@Dr Super Good i tried cosinus before but it gave me weired results ^^
This makes no sense anyway and is not what I told you to do.if Cos[UnitAngel] is between Cos[(HeroAngel - 45)] and Cos[(HeroAngel + 45 )]
Complex math? I see no complex maths. Heck these numbers are still real!and doesn't involve complicated maths.
I doubt it is more efficient though. Checking every damage response for a debuff sounds like a huge overhead to me.There's a lot simpler way you can do this
