Set rotation and absolute location relative to another unit?

Are there currently traits which can be manipulated to set a unit’s location (in pixels or whatever ‘world’ co-ordinates) and rotation angle relative to another unit?

As a for-instance of how this might be used… imagine a game like my understanding of the original Gettysburg where the counters are free to move anywhere and face any direction (somewhat akin to a miniatures game actually - you could also imagine System7 Napoleonics or Napoleon’s Battles with the counters if you prefer, and I am sure there are further examples).

Completely ignoring any need to enforce movement rules, is there just simply(?) a way to use the existing traits to command one counter to align itself to another counter, by copying its system rotation property and moving to an absolute system location relative to the absolute system location of the ‘target’ counter?

If not quite do-able with a current trait, are there system properties of the units which are accessible, without writing custom Java classes, that might be read from one unit and modified for another unit by some command trigger, could even be on either unit for that matter? If so what would they be and what would be the method to read and modify them?

Not wanting to re-invent any wheels here, so and/or… is there a module from which I might unabashedly steal an implementation of this?

Thanks.

I would imagine for instance, that the current stacking mechanism must do something very similar to this? Perhaps there is way to manipulate the stacking properties to handle something similar?

More thanks.

There are piece properties CurrentX and CurrentY, and there is a trait “Send to Location”. The Send trait can take property arguments, so what would be needed, perhaps is a way to access the CurrentX/Y properties of another piece, in a Message Format expression, and use that expression as the target location of the Send trait.

This leaves you with a rotation issue if you are not using circular shaped pieces, BUT you might neatly solve this by adding a trigger to use a “Move Fixed Distance” after the “Send to Location” is completed. The MFD can be set up to allow for the rotation of the piece.

But you would still need the actual piece rotation of the target to do any of this, and I do not see that in the exposed property list even if you could get around the need to access properties of some other piece aside from the one being acted upon.

Anyhow, just more thoughts on the subject.

On 1/05/2009 at 9:41 AM IrishBouzouki wrote:

It is possible to access properties from another piece using triggers and Global Properties, but it is somewhat torturous.

I think there is an easier way to achieve to achieve what you want.

The Send To Location trait has a variety of methods of selecting the Destination. One of these is ‘Another counter, selected by properties’. This allows you have a counter ‘home in’ on the location of another counter. Click on the ‘Advanced Options’ button to add additional offsets to the move.

Not sure what to suggest about your rotation issue. Both the facing and degrees are returned as Properties by a rotation trait (name_FACING and name_DEGREES properties), but you can’t use these directly to set the rotation of another counter, without a messy set of triggers.

Realistically, I believe you need a custom trait to achieve what you want in a workable way.

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)