Using attachments... property for the attachment name?

Hello. I’m not sure this is the right category to put this in, but I figure if I chose wrong someone will tell me. :slight_smile:

The very short version of my question: is it possible to use a property value as the name of an attachment? In other words, in the “Attachment name” field on the “Attachment properties” window, I’d like to be able to put in $MyCharacterNumber$ or something like that. After experimenting a lot, using alternate forms, beanshell braces, and etc., it appears to me that either what I want to do is not possible, or I am just completely misunderstanding something.

The longer version:

Basics out of the way first:
OS: Devuan Linux “Chimaera”, linux kernal 5.10.0-31-amd64
Vassal version: 3.7.13
Starting version of Gunslinger module: 1.9.4DC, now heavily modified
Java version: openjdk 11.0.24+8-post-Debian-2deb11u1
Memory: 64GB
Me: Software engineer since 1982, and I’ve written millions of lines of programs, primarily in C, though I have done some C++/Java things enough to know the differences and how they work. It’s just that usually in systems programming, the efficiency differences matter, so I tended to stick with plain C. :slight_smile:

I am doing a fairly large redesign on the Gunslinger module, to suit the way I and my friends play it. In particular, I am splitting one large map into several smaller maps. However, there are details that I want to keep consistent across pieces on the actual terrain map, information about the character on their legend sheet, and some character information and cards on a playmat area. If you don’t know Gunslinger or the module, that’s not necessarily a barrier to answering my question, I’ll give a simple example of what I want to do.

For instance, one characteristic of a character in the game is “Delay”. It is useful to know the character’s delay on three different maps, which are used for different purposes. So, I’d like to be able to display the delay on each of those three maps, and also make it possible to modify the delay on any of those three maps.

The solutions I have found for this involve one of:

  1. a ridiculous number of global properties, with consistency issues, but I think can be managed using GKCs and careful definition of key commands for each of the three pieces
  2. a ridiculous number of counters in an at-start-stack (or deck), each of which has to have custom values different from each other
  3. a ridiculous number of piece prototypes for pieces that are fundamentally identical, just with different variables (e.g., the aforementioned Delay)

What I would like to do is have a generic counter that would work for any of the characters, which can decide what other counters it is associated with at runtime using a variable. This will be placed in a single at-start stack, which can then clone and instantiate pieces for an individual character. In the end, this would let me use a zone or map global property to set just the character number (1-12), and then all the rest of the characteristics can be found by attaching to the other pieces with the same character number.

I’ve gotten very close to getting this working using the aforementioned plethora of global properties, passing values for dynamic properties with the GKC or ReplaceWIthOtherPiece traits, and some careful attention to synchronization so that the global properties remain consistent on all pieces. I don’t really need to know how to make it work that way, I’m pretty close and know it’s just minor issues to finish up.

But. It’s ugly. It’s wasteful. And I’d rather do it more elegantly, which I can if I can specify the attachment name at runtime, rather than at compile time.

Any help or suggestions would be greatly appreciated.

Sorry to say, no this is not possible in the Attachment trait itself.

It is allowed for references to the Attachment - e.g. in GKCs and GetAttachmentProperty().

Okay, thanks. I’ll just continue the way I’ve been doing it, then.

Thank you very much for the quick response!