(Answered) Image Slot Question

Started by Harkler, November 05, 2013, 10:32:52 AM

Previous topic - Next topic

Harkler

I do not know any coding languages and just started learning CRPL yesterday.
CurrentCoords 59 98 GetCreeper 2 Div AddCreeper
59 98 59 98 GetCreeper 2 Div SetCreeper
1 Delay

I got this code to take half of the creeper from a cell and add it to the cell that the Core is at, but I do not know what an Image slot is.
Self "Custom0" Self "Custom0" GetImageRotation 10 Add SetImageRotation
1 Delay

I am trying to get the image attached to the core to rotate, and I think everything else is correct, but I don't know what to put in the parentheses. I've tried "0", "default", custom0, and "Micro-Rift" (The name of the image) to no avail.

eduran

First you need to set the image:
Self "rotatingPart" "Custom0" SetImage

The second argument - "rotatingPart" - is the name of the image slot, while the third argument - "Custom0" - is the name of the image. If you used the editor's interface to set the image the name of the slot is "main".

Afterwards you can do the rotation:
Self "rotatingPart" Self "rotatingPart" GetImageRotation 10 Add SetImageRotation

or

Self "main" Self "main" GetImageRotation 10 Add SetImageRotation

Note that the image rotation is measured in radians, so adding 10 will rotate the image by about 570 degree.

Grayzzur

You name the images. The primary image (the one you assign in the properties dialog) on a unit is "main". The "Custom0"/"Custom1" is just used to assign an image to the unit.


This may do what you're attempting:
self "main" self "main" GetImageRotation 0.175 add SetImageRotation

Note that the rotation angle is in radians, not degrees. 2*PI, or 6.28, is equivalent to 360 degrees.
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker