Question about moving pieces fixed distances

Hi,

Is there a way to restrict the movement of a piece to anywhere within a radius around the piece’s position?

What about a way to highlight/show that area? when a player selects a piece?

And also, could different pieces have different radius variables? For example, pieces of type A the radius is 6 units, type B pieces have a radius of 4 units, and C pieces can only move 1 unit?

Finally, can a piece leave a trail behind showing where it moved?

Is there a way to restrict the movement of a piece to a radius around
the piece’s position?

Not really. The intent of Vassal is to let you play a game, but not to
enforce the rules.
There is some automation of game functions, but the idea is to generally
play the game as you would on a board.

What about a way to highlight/show that area? when a player selects a
piece?

Look at area of effect.
You could show the radius, but it would move with the piece. I’m not
exactly sure if this can be easily triggered by selection.

And also, could different pieces have different radius variables? For
example, pieces of type A the radius is 6 units, type B pieces have a
radius of 4 units, and C pieces can only move 1 unit?

Yes, you can have different radii. This can be controlled by a property.
You would want to use prototypes for each of the different types, since it
simplifies having such common properties shared among lots of pieces.

Finally, can a piece leave a trail behind showing where it moved?

Yes. Look at “movement trails”.

I think there is, but it might be a little complicated.

You need to keep track of the unit’s position (X,Y) using a [Dynamic Prop]. Next, using the Apply command to a piece ending movement in this Map Window of the [Map Window] property, make that command part of a trigger for the unit. When the unit is moved from its current location, use a [Calc Prop] to determine the distance to the new position, r=sqrt([oldX-X]^2 + [oldY-Y]^2). and use this result as part of the Properties Matching of the trigger. If the distance r is greater than the desired range limit, then execute a [Send To Location] using the Old position coordinates (oldX, oldY). Otherwise, update the unit’s new position with your [Dynamic Prop] mentioned above.

Hope this helps!

edit equation