I want to have a text box on the map that will display text set by the module, rather than entering it manually.
Specifically, what I would like it to do is, if I click on a card/piece that is on the map, the text box will be filled with information taken from the piece’s properties/traits.
Adding a Text Label trait to each piece does not work, as the label rotates when the piece does.
I “could” do something like creating a giant game piece that contains a Spreadsheet, but I would like it to be able to be dynamic enough to change depending on what piece I select. Is this possible, or am I just asking too much out of Vassal?
Disclaimer: Haven’t tried this - your milage may vary
Define a Action Button trait to your pieces that triggers a key command - say ShowDetails
Add an Attachement trait to your pieces with some specific name, say PieceDetails with
Key command to attach pieces: AttachToDisplay with conditions such as {BasicName=="PieceDisplay"}
Add a Global Key Command trait to your pieces listening for DoShowDetails, and that that does Fast Match on Current Attachments and send key command ShowDetails
Add a Trigger Action trait to your pieces that listens for the Action Button key command - e.g., ShowDetails, and performs the key commands
AttachToDisplay
DoShowDetails
Prepare a piece - say PieceDetailViewer - the “display piece” - with some large image and a bunch of
Add an Attachement trait to your pieces with some specific name, say PieceDetails with
Before adding attachments: Clear existing attachments first
When another piece attaches to this one using this attachment’s name: Attach to that piece
What should then happen is
User clicks a piece
That triggers ShowDetails
Which then triggers AtttachToDisplay which then
Attaches the piece to the display piece
But only after that piece cleared all other attachements
and the display piece attaches back to the selected piece
Then triggers DoShowDetails which
Sends ShowDetails to the display piece
Which triggers all the Dynamic Property traits to take the propery values from the selected (attached) piece
And the Text Label traits see the change and update
At least, that’s the thinking
An alternative could be
Define a Trigger Action trait in your pieces (or prototype) with menu command Print and key Ctrl-P (say).
Define a Report Action trait in your pieces (or prototype) which listens for the key (Ctrl-P) and simply prints relevant piece properties to the chat. Remember that you can somewhat format your output.
This is simpler, and should have very little overhead.
Note, you cannot set the content of Spreadsheet cells from the pieces - only the user can enter information.