So I hit key the roll and it appears on the counter?
You have several options, depending on your preferences and what your use case is.
-
Use a Layer trait. Enable the option Levels follow expression value, and if the die is called
Dice, then put into Expression the code{Dice_result}Then add a layer image for each possible value of the die roll.
If you need the layers to only be visible when a certain command is sent to the piece, then disable Always active and set Activate to that command.
If you want the label only to be active when a certain property - say
ShowDiceResult- is true, then enable Only show layer if property and put inShowDiceResultand some appropriate value to compare to.
-
Use a Text Label and set the Label text to
{Dice_result}if the dice is called
Dice. If you want the label only to be active when a certain property - sayShowDiceResult- is true, then set Label text to{ShowDiceResult ? Dice_result : ""} -
Use a Place Marker trait for each possible value of
Dice_result, where each referenced marker shows the dice result. Depending on how you want the display to appear, you could need additional Trigger Action traits.For each possible value
XofDice_result, add traits a la- Place trait
- Marker:
Piece Window/sub/directory/Result_X - Key:
placeDiceResult_X
- Marker:
- Trigger action
key:placeDiceResult
actionKeys: [placeDiceResult_X]
property:{Dice_result == X}
- Place trait
-
… and possibly others
Which approach is best, depends a lot on what the module is, what the point of displaying the Dice result is, and how it is used. Perhaps if you gave a bit or information - or even a link to the module, then perhaps we could give you a better recommendation.
Yours,
Christian
What if there will be multiple counters using this feature? It’s an imitative roll to see who moves first for aircraft and there could be duplicates of the same counter on the map. My hope was to have a die result for each counter on the counter itself to save some housekeeping.
Could have a layer that has 6 levels on every aircraft (or whatever number of faces the die being rolled has if not a d6). Each layer is an image of a different die face. Hit a toolbar GKC that sends a command to all aircraft to fire the key command bound to Randomize which layer level is shown.
So you actually wouldn’t be using a dice rolling component at all, but it would have the visual impression of doing so.