text label with pieceName? and other questions...

Making a module (duh).

I do not want to hand-make complete pieces for each and every unit. There are a few patterns I would like to combine and use repeatedly. But I do want the unit designation to be unique for each piece, both on the counter and in any reports for whatever the player does with that counter.

To that end my first try (this time around) was to attempt to use the $pieceName$ as a text label in my combat unit prototype. This would mean I could just make different single game pieces using the same set of game piece images and prototype definitions over and over, but have them show up differently by printing the pieceName defined for the piece as this text label.

Instead it prints “pieceName” on all the pieces, tried it with and without the $$.

I would be happy to accomplish this some other smarter way, short of having to define both a game piece image and and actual game piece using that image for each and every counter in the game.

Can anyone help me with this specific problem, and can they or someone else tutor me a bit with my dumb question to try to get over them hump and complete one of these beasts?

under [GamePieceImageDefinitions] [GamePieceLayouts] I created a [GamePieceLayout] called CombatUnit. This has the dimensions of the piece and slots for two images (‘Background’ and ‘TypeSymbol’) which are defined by the actual image.

under that [GamePieceLayout] I then created a [GamePieceImage] called PurpleHC. This just sets a clear background, sets the ‘Background’ image to purple.png and the "TypeSymbol’ image to HC.png.

then under [GamePiecePrototypeDefinitions] I created a [Definition] called CombatUnit. This has, in order, Delete, Mark When Moved, Text Label, Can Rotate, Movement Trail. The only unusual thing here is the Text Label which I would like to use to hold the reference designation or the unit name and who it on the counter and in all the reports.

finally under [GamePiecePalette] I created a [Single piece] called Companions. Actually there are some layers of display tabs but that is irrelevant here. This [Single piece] simply calls out the [GamePieceImage] PurpleHC from above and sets the name to ‘Companions’.

at first I set it up so that the scenario designer (me also) could grab these units off the palette and after placing them on the map make a menu entry to set the unit name (you can do that in the prototype definition text label by assigning a menu command). That worked, and if I save a game for a setup it will remember the name I assign. And the reports are real nice because they say Companion(Agema) or whatever which is both the unit name and the unit type.

but… problem is the menu command stays there as the user (me also) is playing the game.

so I realized to get rid of that I might be back to creating a seperate entire [GamePieceImage] and [Single piece] for each and every counter at module design time instead of scenario design time.

that is what I am trying to avoid.

attached is the module file stripped down to just the above. I really hope someone can give me a pointer or two or a dozen.

$pieceName$ is not the name of any property. According to the documentation, it should be $PieceName$


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

Post generated using Mail2Forum (mail2forum.com)

That is interesting, for two reasons…

  1. the report format that comes by default when you enter a new text label is $pieceName$ ($Label$) - not sure about the caps on Label but am on pieceName. Documentation, interesting as the only way I knew about this was by looking at the report format line - where is there a list of properties like this in the web of stuff in the manual? Nevermind I will find it that would be a pain in the butt to ask of someone.

  2. When I try $PieceName$ (a) I get a bug report screen and the module dies and (b) I can not open the module again without getting bug report screen.

If I can get it to work will that actually do what I am looking for? Take the name you enter for the piece when you create the [Single piece] in the palette and display that for the text label on the counter and in the reports?

I for one prefer to use $BasicName$ which is the name you give the component
in the basic piece field as opposed to $PieceName$
The difference involves something to do with layers, not sure what

A list of all the system properties you can call is here near bottom of the
wiki page:

vassalengine.org/wiki/doku.p … aq_modules

Post generated using Mail2Forum (mail2forum.com)

Not to mention in the on-line reference manual, available by clicking on any of the large friendly Help buttons in the module editor.


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

Post generated using Mail2Forum (mail2forum.com)

Bingo. Thanks once again Tim.
fyi there seems to be some kind of circular reference issue with using PieceName? BUt it does not matter, BasicName is exactly what I was looking for.

Next question, if you all do not mind, is there an alternative to using a [GamePieceImage]? Can you simply define whatever image(s) you wish to stack up for a unit in layers in a prototype? That would save me even more by not putting every combination of unit type and background color in a seperate image (instead the backgronds could go in one layer and the symbols in another and with the same unit they could each be selected to a range of values with different image files for each value), unless there is a better way… not sure if that is going down the road to the same issue of great for scenario design but no way to remove the selection functionality for the player?

Yes - you can define your images that way using layers and control the
display with dynamic properties.

In fact there is many numerous ways one can “deconstruct” counters so that
you can manipulate the pieces the way you like( through layers, protos

The way its done is really a preference of the mod designer and what they
are trying to achieve so there is no right or wrong way here about how to do
it so I’m not going to recommend a method you should pursue - its really up
to you and what you would like to do with your pieces at the end when they
are displayed which should dictate how you build them

Post generated using Mail2Forum (mail2forum.com)


I tried it and it works, and it does exactly what I want - the image is defined one place only and I could theoretically only have a single piece in the palette and still have a bunch of different ones on the map. But two or three more things (if that is okay)…

I notice there is still an image associated with the basic piece. I think I can set that to something essentially out of sight but is there a way to just eliminate that? I am worried it will cause issues further down the line somehow.

Is there a way to allow the commands to change layer images for the scenario designer and then not permit that for the player? Probably a bunch of them but can someone suggest one or a few to investigate? I am not experienced enough with module design to know now what will prove the most useful for me as a scenario designer and player. I am thinking maybe you could have “scenario designer” as a player side to select and restrict the key commands to that player side somehow (although I am not sure how to do that, maybe I could figure it out if I knew that was a target to shoot for)? Sounds kind of clunky but maybe. Is there some kind of extension mechanism or something I am just not familiar with yet?

Double-click on the BasicPiece image to bring up the File Chooser, then click on cancel.

You can use the ‘Restrict Commands’ to Hide the commands that change the look of a piece. Have this controlled by a Dynamic Property and have a ‘Lock’ command the sets the DP to a ‘locked’ value once the module/scenario designer is done changing the look of the piece.

FWIW, I went down exactly the same track you are going, but eventually decided it was just too much trouble for a game with a fixed set of counters, it was much easier to maintain just to create the seperate images.

It does make sense for a ‘kit’ where you are still creating new units.


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

Post generated using Mail2Forum (mail2forum.com)

The module I am working on is a simple game but uses a number of scenarios, which I want to be expandable easily and which I do not know the counter mix for (and may never).

Currently I am having trouble using a DP to set the layer. It worked okay just having the layer values accessible raw from the key commands (and therefore on the unit right-click menu), but to really work for me I would like to have it exposed by and keyed off a value in a DP. Text value matching the layer designation would be great but it looks like you only do this with numeric DP values?

Also I am having trouble maybe with the order of traits, but I think I can look that up in the sticky again and figure it out again. Hopefully.

Right now when I have the reference to the DP set in the editor I still can change the layer with the key commands but have no menu item for the DP value nor does the key command entered for the DP work. In the past I know that certain key commands are reserved, so I tend to use ALT- or SHIFT- CTRL combos that I can hope are not already used by anything else. But that does not seem to be the problem this time.

I will RTFM a bit and see if I come up with something, but if this rings a bell I would appreciate a pointer.

Post your mod and I can set up your DP / Layer relationship for you
(provided you tell me which piece is involved)

I find its easier to fix so you have a working example you can see and
follow after than try to describe

Post generated using Mail2Forum (mail2forum.com)

I think by sheer dumb luck I have stumbled on something that works for me at the moment. See attached file (rename zip to vmod). Apologies for ripping off Prestags graphics, they are making a nice playtest set though.

Right now I only have one piece and everything is done by layers. THere are two layers, one for the player which sets the background color, and one for the unit class which sets the little image for the unit type. They both show up as part of the piece name in the reports which is what I want them to do. Plus you can enter a “unit name” (designation) which shows up on the counter as well as in the reports.

That took some experimenting but I am actually very pleased with the result so far. And it was not so difficult to set up if I had known what I was doing. May be that there are potholes in the road I do not see just yet but for now I can go forward and work with it.

Next up is to implement how I will lock the layers down after the scenario designer is done with it. I will look at Brent’s post above and give it a whirl.

After that the next thing I would like to do is set up the factors for the units. I have done this with DP’s updatable by keyboard between different unit instances before so I think I can swing that and for some items I think will be the way to go, but for others I just want a fixed number I can change for every unit in the class (ie the type image layer) understanding that once the scenario designer plunks it down on the map there is no changing it unless he grabs a new unit off the palette.

Suggestions, mention of unseen-by-me pitfalls, etc appreciated, and thanks for the help so far.


Tim, or anyone,


Is there a way for the type symbol layer that I can use a pull-down menu or list menu instead of cycling up and down one at a time? Hopefully without losing the nice way the layer names fold into the reports as a piece type?


Control the layer with a numeric dynamic property
Add another dynamic property which prompts with list
User trigger actions to set the numeric dynamic property based on the
selection made from the list DP value

Post generated using Mail2Forum (mail2forum.com)

Then it looks like I am back to biting the bullet and figuring out how to get the DP’s and Layers to interact properly. Not much luck with that yet, although the layers themselves work fine, but I will keep plugging away and check for any examples.
Again, I appreciate all the help.

Here is your mod demonstrating the above - I only did the first 5 levels of the layer but this should be enough to show how its done)

Sidenote for Joel - Doing this causes the Bad Data report again, there is nothing flashy going on here - just DP controlling layer and Triggers implementing the control - no GP’s this time

Hey thanks TIm I will take a look.

Regarding restricting for the scenario designer… I looked at Restrict Commands but what about Restricted Access instead? Does that make sense with defining a Scenario Designer player?

When I try to edit the module I get a error. I presume this is what you refer to above and if I just go past it I will see the example? I made the mistake of clicking submit report it may take a while.

Nah it hangs wether I submit the bug report or not. Hmmm…