Re: Direction and Angle calculator
Try
Angle <> LongDir( "Advanced Direction Object", X( "Active" ), Y( "Active" ), XMouse, YMouse )
-> set angle to Rotate( "Advanced Direction Object", Angle of active, LongDir( "Advanced Direction Object", X( "Active" ), Y( "Active" ), XMouse, YMouse ), 3 )
Then just replace the Xmouse and Ymouse with the position you want it to rotate to.
Re: Direction and Angle calculator
Try
Angle <> LongDir( "Advanced Direction Object", X( "Active" ), Y( "Active" ), XMouse, YMouse )
-> set angle to Rotate( "Advanced Direction Object", Angle of active, LongDir( "Advanced Direction Object", X( "Active" ), Y( "Active" ), XMouse, YMouse ), 3 )
Then just replace the Xmouse and Ymouse with the position you want it to rotate to.
Re: Direction and Angle calculator
I don't understand that at all. Why are there 2 lines stuff and where do I put that in? Is it really that complicated?
Re: Direction and Angle calculator
I don't understand that at all. Why are there 2 lines stuff and where do I put that in? Is it really that complicated?
Re: Direction and Angle calculator
One of the lines are for the event, the other one is for the action. To make the event, go to "compare two general values" then enter
Angle( "Active" )
different
LongDir( "Advanced Direction Object", X( "Active" ), Y( "Active" ), XMouse, YMouse )
This condition compares the current angle of the active to the angle between the active, and the mouse. If they are different, then it means that the active isn't facing the correct angle, and it needs to be rotated. The action looks like this:
set angle to Rotate( "Advanced Direction Object", Angle( "Active" ), LongDir( "Advanced Direction Object", X( "Active" ), Y( "Active" ), XMouse, YMouse ), 3 )
The first part, Angle( "Active" ) gets the current angle. The second part, LongDir( "Advanced Direction Object", X( "Active" ), Y( "Active" ), XMouse, YMouse ) Gets the angle between the active and the mouse, and it's this angle the active is rotated to.
The last part is just the speed of how fast it should be rotated.
It's not really complicated, just a bit long.
Re: Direction and Angle calculator
One of the lines are for the event, the other one is for the action. To make the event, go to "compare two general values" then enter
Angle( "Active" )
different
LongDir( "Advanced Direction Object", X( "Active" ), Y( "Active" ), XMouse, YMouse )
This condition compares the current angle of the active to the angle between the active, and the mouse. If they are different, then it means that the active isn't facing the correct angle, and it needs to be rotated. The action looks like this:
set angle to Rotate( "Advanced Direction Object", Angle( "Active" ), LongDir( "Advanced Direction Object", X( "Active" ), Y( "Active" ), XMouse, YMouse ), 3 )
The first part, Angle( "Active" ) gets the current angle. The second part, LongDir( "Advanced Direction Object", X( "Active" ), Y( "Active" ), XMouse, YMouse ) Gets the angle between the active and the mouse, and it's this angle the active is rotated to.
The last part is just the speed of how fast it should be rotated.
It's not really complicated, just a bit long.
Re: Direction and Angle calculator
Ah ok but I don't want to use angles I just want to use the 32 directions, and it doesn't seem to work with that :/
Re: Direction and Angle calculator
Ah ok but I don't want to use angles I just want to use the 32 directions, and it doesn't seem to work with that :/
Re: Direction and Angle calculator
Under the Advanced directions setup box, just set the number of directions to 32, and replace all Angle( "Active" ) with Dir( "Active" ))
Re: Direction and Angle calculator
Under the Advanced directions setup box, just set the number of directions to 32, and replace all Angle( "Active" ) with Dir( "Active" ))