I was following RyGuyX's 360 degree shooting tutorial. I was fine with the relative X distance, relative Y distance, and total distance (counters in my level for testing showed they were working right). When I got to the part about getting an angle of an object relative to another, I ran into a brick wall. My test counter always shows either 0, 180, or 5280. These are my events-
ALWAYS SET ALTERABLE VALUE A (OF GUN) TO- ArcSin( "Advanced Math object", Value B( "crosshair" ) / Value C( "crosshair" ) ) * ( 180000 / 3142 )
X POSITION (OF CROSSHAIR) >= X POSITION (OF GUN) THEN SET VALUE B (OF GUN) TO ALTERABLE VALUE A (OF GUN)
X POSITION (OF CROSSHAIR) < X POSITION (OF GUN) THEN SET ALTERABLE VALUE B (OF GUN) TO (180 - ALTERABLE VALUE A (OF GUN))
I used 180000/3142 as a substitute for pi which was in the formula. See anything wrong? BTW, all the relative distances were stored in the crosshair's alterable values. Any help would be appreciated.
Make sure you changed the decimal offset to at least 2. Also try altering the expressions so that multiplications are performed before divisions, that'll reduce rounding errors.
I realized that when I tried using 22\7, I forgot the 180\ bit. Put it in, still didn't work. I don't see anywhere in any of the expressions where you could make multiplications before divisions (and still come out with the same result). Any other ideas?
Oh I forgot- setting the decimal offset to 2 didn't seem to do anything.