I was trying to make a custom unit...

Started by Ondrejoda, June 11, 2017, 10:48:24 AM

Previous topic - Next topic

Nicant

CW4 hype!!

Ondrejoda

And, is it possible to make a code that when you hold down the right buttonon the mouse, the CRPLCore will be right on the location of the mouse, and, when I will stop holding the right button on the mouse, the CRPLCore will stop moving?

GoodMorning


1 GetMouseButton if #Right mouse button is down
GetMousePosition ->MousePX ->MousePY
Self CONST_PIXELCOORDX <-MousePX SetUnitAttribute
Self CONST_PIXELCOORDY <-MousePY SetUnitAttribute
endif


This should work.
A narrative is a lightly-marked path to another reality.

Ondrejoda

And, can I set the CurrentCoords of a CRPLCore to a different CRPLCore?

GoodMorning

Yes, provided you have the UID of the other Core.


Self CONST_PIXELCOORDX <-Other CONST_PIXELCOORDX GetUnitAttribute SetUnitAttribute

...and similarly for Y.
A narrative is a lightly-marked path to another reality.

Ondrejoda

#35
Sorry, but the unit what will move is just going to the Down Left corner...