Piece Variables

Is it possible to “connect” to pieces with one varible.
Means, i have to pieces (an investigtor sheet and an investigator card, to show investigators location on the map).
Both of the pieces have a “hp” and “mana” layer and same shortcuts for increasing and deacreasing it.
How can i mange it, that if i increase hp-layer on investigator sheet, the hp-layer on the card increases as well?

That would ideally be through Global Properties… “Character1HP”, “Character1Mana”, “Character2HP”, etc… then you’d add relevant Set Global Property traits to each piece. You can then also have the layers themselves automatically follow a numerical global property through “levels follow expression value” (found in the layer trait’s property).

vassalengine.org/wiki/GlobalProperties

It could be managed through Global Key Command traits for each piece instead… when HP is raised it sends a GKC to the “connected” piece to also raise the HP; when HP is lowered, etc… then same for Mana too… but globals are much cleaner.

hm, that means that I need a global property for each character, thats a lot of properties :slight_smile:

There are shortcuts for either method but stuff needs to match.

For example, with the second method, GKCs, you could just have four default GKC traits for all the pieces (hp up/down, mana up/down - using the same key commands that the actual up/down layers use), put them into a prototype folder, put the folder into each relevant piece, and that’s it. But the base name (or some other property) for each of the connected pieces (sheet and card) would have to match. The matching properties for each default GKC would be: BasicName=$BasicName$&&Selected!=true. So the hp up shortcut, also triggers a GKC that tells its connected piece that it should raise its hp too (and it won’t loop back because of the “selected” match).

Similarly, you could use $BasicName$HP (as the Global Property Name) in a default Set Global Property trait for HP that you’d use for all the characters (with the global property you created matching the basic names for each connected piece).

Maybe that gives you an alternative to try out.