Create account / Log in

Can Rotate - Allow arbitrary rotations - Degrees

Suggestions for additional features for the module editor and Vassal engine.

Moderators: uckelman, Tim M

Can Rotate - Allow arbitrary rotations - Degrees

Postby jamalm » December 21st, 2020, 11:22 pm

It would be very helpful to me to have an option here that would set the unit's reported degrees as 0 degrees in pointing toward the top of the game window and report the degrees facing as always relative from 0 to 359 degrees from a clock-wise direction no matter which direction the the units was rotated or what it's previous direction was at start of the move and no matter how many times the unit is rotated more than 360 degrees in any direction, it would reset to 0 (or 359) upon passing the top of the window in rotation. In other words, it would be very useful to know from a fixed direction (toward the top of the map window, for example) how the unit is oriented so it can be compared to other unit's facing. Thanks! Jim. (I find the current function of the Degrees property is not usable for determining the answers to my above programming needs.)
Posts: 13
Joined: May 23rd, 2016, 3:48 pm

Re: Can Rotate - Allow arbitrary rotations - Degrees

Postby barbanera » December 24th, 2020, 10:40 am

As a solution to your problem I suggest you:

1) define on each piece a market trait like Start_Degrees storing the initial orientation (degrees) compared to your required absolute zero (towards the top, say);

2) define a Calculated Property Absolute_Degrees equal to (Rotate_Degrees + Start_Degrees) % 360, where I assumed here Rotate was the name of your Can Rotate trait;

3) compare that among different pieces to achieve your purpose.
Posts: 470
Joined: January 12th, 2012, 2:27 pm

Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest