This was easier when you only had 32 angles for objects(easier but uglier), i wonder why they didn't add angle/scale stuff at least in mmf1.
Anyway, here is the issue. Lets say the blue square is a car, and the green cross is a bumper. I need a formula that will point out the position where the bumper needs to be, as seen in the image below.
Originally Posted by -UrbanMonk- Get the angle of the object then set the bumper's position to:
X -> CarX + cos(CarAngle) * (Car Length / 2.0)
Y -> CarY + sin(CarAngle) * (Car Length / 2.0)
I did this using these formulas:
Always:
-Set (turret) X position to: X( "pl vehicle gunboat" )+Cos(Angle( "pl vehicle gunboat" ))*32
-Set (turret) Y position to: Y( "pl vehicle gunboat" )+Sin(Angle( "pl vehicle gunboat" ))*32
The X position works, the Y position had to be modified to ...+Sin(360-Angle( "pl vehicle gunboat" ))..., so now it works, but i have another problem.
There are 2 machinegunners on the gunboat and i tried the same formula with x-y changes to their positions:
Always:
-Set (mgunner) X position to: X( "pl vehicle gunboat" )+Cos(Angle( "pl vehicle gunboat" ))*-37
-Set (mgunner) Y position to: Y( "pl vehicle gunboat" )+Sin(360-Angle( "pl vehicle gunboat" ))*-17
and
-Set (mgunner2) X position to: X( "pl vehicle gunboat" )+Cos(Angle( "pl vehicle gunboat" ))*-37
-Set (mgunner2) Y position to: Y( "pl vehicle gunboat" )+Sin(360-Angle( "pl vehicle gunboat" ))*17
..and now i realized that OBIVOUSLY this is not how it works, so i have the X now, but how do i change the relative Y-position?
Always:
-Set (mgunner) X position to: X( "pl vehicle gunboat" )+Cos(Angle( "pl vehicle gunboat" )+23)*-41
-Set (mgunner) Y position to: Y( "pl vehicle gunboat" )+Sin(360-Angle( "pl vehicle gunboat" )-23)*-41
Yeah I forgot to mention that sometimes the angles don't translate correctly so you might have to play with the values a little bit. Glad you finally got it!