[messages] [Module Design] Calculated Layer and messaging
vassal at flyhi.de
Thu Nov 30 15:02:40 CET 2017
trying something new again. I have a piece with the Layer trait, and I
want to let the layers follow an expression value: The layer should
switch if the deck FateChits is down to a certain number of cards
(halfway through the 24-card-deck, to be precise).
This works, in a way, even if I do not understand the logic.
Follows Expression = AggravationLevel -> this is a Calculated Property
on the same piece: If(FateChits_numPieces<=12,1,2)
Level 1 = 1
What happens: when the cards are <=12, I see level 2. When the cards are
>=13, I see level 1. Huh? Reverse logic?
The result is the same if I put the IF clause directly into the layer
OK, I can easily work around that: If(FateChits_numPieces<=12,2,1) works
as intended, though different from the logic I understand.
Next q.: I want to report the Layer change. Doing that if I change the
level by menu/key is no problem. But "follows expression" does not send
a key command, right? Is there a way to do this?
Read this topic online here:
More information about the messages