Is there a way of placing a piece on the board map that acts as a game piece pallette?

Sorry but I haven’t found this answered anywhere; I guess it is a simple question:

I would like to have pieces on the map board that would act like a piece on a piece pallete: i.e. if I would click on it and drag, an immediate clone is created?

If it is possible it would avoid the need to put a trait clone in the piece, then rigt-click on it, then choose “clone”, then drag the new piece from above the older one, or (B) avoid the need to go the Game piece pallete in the menu. At table top is very easy but at Vassal I don’t know if it’s possible…

Is it?

Thank you so much in advance and Merry Christmas,

José Miguel

You can have a palette appear in a separate window but assuming you must have a piece on the board that can act exactly like a piece in a pallette (as I understand your request), here is the bones of a method:

Establish your palette piece on the board (typically through an At Start Stack).

Your Map will need a Movement Key Command configured. Let’s call that mapMove.

On your piece, add a Trigger Action trait, that responds to mapMove

The actions performed by the mapMove Trigger should be:

i) Clone

ii) Send to Location (to OldX, OldY)

Let us know if that works for you. Possibly two pieces will return to the original (Palette”) location. In which case we will need to restrict the Send to Location to limit it to just one piece.

I’m expecting that dragging the piece will create a new piece at the drop location whilst the original piece appears to remain in your palette area.

Mark

2 Likes

Thanks Mark. I’ll try it and let you know how it goes.

Yours greatful,

José Miguel

I think I see what you are asking, but I have a couple of questions:

  • What is the advantage of pulling from a previously placed piece versus pulling from the pallette?
  • you said the clone action triggers when moved. Does the clone action need to be turned off once gameplay begins if the piece is moved?

I think, without having tried it, there’s a simpler way and one that needn’t fail when a clone is placed back in its original slot.

You make a piece (or prototype) with

  • Clone trait
    • Key command: cloneMe
  • Action Button trait
    • Invoke key command: cloneMe
    • Invoke context menu: false
    • Clicking anywhere: true
  • Restrict Commands trait
    • Restriction: Hide
    • Property match: {CloneID!="" && CloneId!=UniqueID}
      (Each piece has a unique UniqueID - duh - and CloneID is set to the UniqueID of the parent piece by the Clone trait)
    • Key commands: [cloneMe]

Hence, when you click the “mother” piece, a clone will be created, and that clone will get the a new unique UniqueID, and will have the property CloneID set to the UniqueID of the mother piece. The RestrictCommads trait disables the cloneMe command (and hence the Clone trait) for all clones since their UniqueID does not match their CloneID.

This method is slightly different than @marktb1961 's suggestion, in that a user will simply click the mother piece, rather than dragging it somewhere.

Another option is to make an entirely different mother piece - probably one that cannot be moved - which, when the user clicks it, uses a Place Marker trait to place a copy of the the actual piece on top of it. The mother piece can share the base image of the actual piece, of course, but is otherwise not very feature rich.

Yours,
Christian

1 Like

This would be a good idea to use with any implementation of a parent / child piece; including with the method that I suggested.

You guys are terrific!!!

Even at Christmas Day I’ve posed a question and received not only one but three solutions for my problem. It is really amazing the way you are so efficient!

In the end I went by Christians’ suggestion of using a place marker trait. Not only I am already used to this trait but also I am not really that at ease with expressions and properties.

The advantage of not going to the pallete menu is that I want to play this game with people who are not very familiar with vassal, and I find it more intuitive to get your new piece right from the map instead of navigating through tabbed panels to chose a specific piece among dozens of others.

Merry Christmas to you all and congratulations for your fine work.

Yours, José Miguel

( I think I will start using your advices to solve, not only Vassal things, but also to decide about my financial investments and about my love life :grinning_face: ).

Hi José Miguel,

First, thank you for the kind words and votes of confidence - perhaps a bit unwarranted - especially when it comes to financial advice and affairs of the heart :slight_smile:

If you do this, then i think the mother piece should have the Does not stack trait with

  • Select piece: never - should not prevent the Action Button from being efficiated, but ensures that the mother piece is not selected together with the spawned pieces.
  • Band-Select piece: never - as above
  • Move Piece: never - the mother piece stays where you placed it on the board, probably using an At-Start Stack.
  • Piece can stack: false - so that it doesn’t get mangled up in a stack with the spawned pieces.

Furthermore, you should probably place the mother piece on a separate Game Piece Layer by giving it a Marker with

  • Name: pieceLayer
  • Value: SpawnButtons

If you want to do some book-keeping, i.e., count how many pieces has been spawned, you can have the Action Button fire a Trigger Action that first increments a Dynamic Property or Global Property, and then fires the Place Marker trait.

Regarding the Place Marker trait: It is most efficient to define the “marker” piece like you would normally do, and then simply reference that piece from the Place Marker trait. Do not define the piece in the Place Marker trait directly.

Also, remember that you can hide the Game Piece Palette from the user. You can still have it in the module and use it as a repository of pieces, but the user will not see it. Will make sense especially if you do book-keeping in the mother pieces.

Yours,
Christian

Thanks again Christian.

I have already done the mother pieces almost exactly as you said. I wouldn’t need the book keeping but thanks for the advice.

Yes, I know I can hide the game piece pallete.

Have a happy new year.

Yours

José Miguel