need help on image rotation

Started by Nicant, August 20, 2015, 05:18:07 PM

Previous topic - Next topic

Nicant

Is it possible to have a CRPL core rotate it's image the direction it is moving? I am trying to make a plane producing unit and the planes look hilarious if they don't rotate in the direction they are moving. If anyone knows if it is possible please tell me how.

P.S. I am a noob at CRPL.
CW4 hype!!

driesemol

i'm a newbie as well at CRPL, but i think you need to take a look at the chimera map in the VirgilW system in the alpha sector. He uses CRPL to make a cannon-like structure, and the cannon itself (image) rotates to the place it's going to fire (direction). Perhaps you can get something usefull from it.

To get this CRPL script (and others from existing maps): check this wiki article: http://knucklecracker.com/wiki/doku.php?id=crpl:examine_map_resources

Nicant

CW4 hype!!

warren

#3
Well, there is the setImageRotation command.

example:
self "main" 1.2 SetImageRotation

Edit: oh, if you were talking about calculating it out, you need a vector.
deltaX = destX - startX
deltaY = destY - startY
ang = atan2(deltax,deltay)



Nicant

I knew about the command i just had no idea how to calculate but thanks for telling me about the vector!
CW4 hype!!