Doom-Angel
Jass User (Just started using NewGen)
- Reaction score
- 167
k so i have this function:
this function supposed to take the arguments written (position is only 1,2 or 3)
and return location using the facing and the taken location so it's suppoed to be something like this:
red - wanted location
blue - unit facing
it didn't came out execly the way i wanted but anyway think the other two lines are exacly the same distance and are splited in 3 equal pieces (meaning there is 120 difference beetwen the facing angles of each.
anyway this points aren't working and they split all over on random spots depending on the facing and location.
i need someone to tell me what am i doing wrong here
thanks in advance :thup:
JASS:
function Test takes location loc,real distance,real facing,integer position returns location
local real x = GetLocationX(loc)
local real y = GetLocationY(loc)
local real face = ModuloReal(360,facing)
call RemoveLocation(loc)
set face = face - ((position-1) * 120)
set x = x + distance * Cos(Deg2Rad(face))
set y = y + distance * Sin(Deg2Rad(face))
return Location(x,y)
endfunction
this function supposed to take the arguments written (position is only 1,2 or 3)
and return location using the facing and the taken location so it's suppoed to be something like this:
red - wanted location
blue - unit facing
Code:
[COLOR="Red"]O[/COLOR]
[COLOR="Blue"]|
|[/COLOR]
o
/ \
/ \
[COLOR="Red"]O[/COLOR] [COLOR="Red"]O[/COLOR]
anyway this points aren't working and they split all over on random spots depending on the facing and location.
i need someone to tell me what am i doing wrong here
thanks in advance :thup: