I was working on an engine for a sonic game and clwe (the person that created sonic diy demo) was kind enough to show me an example of his way around wall climbing using sine and cosine.
i needed mmf to open it so i got the demo version and opened it, after a LONG time trying to type the events into tgf and getting the thing working.
on the very last line i typed i came across a problem.
the advanced math object has a function called fixed object where it can releate angles from an object and the engine im using needs this
so i typed it and and when i pressed enter one of the brackets was missing and now no matter how many times i put the bracket in it still goes away.
trying to run the program crashes it because its actually an invalid expression.
so i type
set counter to FixedAngle( "Advanced Math object", X( "right" ), Y( "right" ) )
and pressing enter it turns to
set counter to FixedAngle( "Advanced Math object", X( "right", Y( "right" ) )
if you are still with me here i was wondering if there was any other way to figure out an objects angle using its x and y position.
a formula mabye?
Try adding a space after the bracket it deletes, and before it. You might also try setting an alterable value/counter to the x coordinate before calculating it, then get the alterable value.
I had this weird bracket bug before too. I solved it by placing two brackets instead of one. After that the expression was valid, the game crashed in runtime...
Im not sure what your purpose is with those angles as I have never worked with the advanced math object. If you want the angle between two objects: the tangent of x degrees is equal to Y of the second object minus the first divided by the X of the second object minus the first. In formula: Tan x degrees=(Y("2")-Y("1"))/(X("2")-X("1")) If you didn't know that already. I don't know if its usefull. Besides, you'll probably still need the advanced math object to use the tangent function
That's no good as you'll only get a number between 0 and 90. Instead of using the angle from fixed object expression, use the other expression and subtract the end object positions from the start object positions as the parameters.