Create account / Log in

secret random roll results

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

secret random roll results

Postby GrognardKC » January 2nd, 2021, 3:57 pm

I have a question for the brain trust.
I am making a module where players explore a hex. The result is secret and permanent. I would like to leave a masked counter on the map belonging to the original discover. The owning player will show it to any other player who explores that hex.


I would like the player to choose an option on his counter in the hex. And have vassal do the rolls and create a masked counter in that hex.

I am having trouble figuring out how to have vassal roll 2 dice and record the values on 1 counter.
Or I was thinking of making a deck to the 36 possible results. But how do I keep the deck full?
Is it possible to somehow “lock” the cards in the deck and have clones made, on the draw?

Ideas / suggestions?

Thanks in advance Kevin.
Attachments
prosc Table.jpg
prosc Table.jpg (102.27 KiB) Viewed 1494 times
GrognardKC
 
Posts: 4
Joined: December 2nd, 2020, 1:38 am

Re: secret random roll results

Postby jrwatts » January 2nd, 2021, 9:49 pm

To make clones of the cards, set your deck to Shuffle: Always. On each card, include a "Place Marker" trait; define the new piece using the same prototype as the original card (which would not contain the Place Marker and Return to Deck traits). When the card is drawn, trigger the Place Marker, then Return to Deck back to the original deck.

Alternatively, to roll 2 dice and record the values on a counter, you could again use Place Marker to create a new piece, and on this piece use a pair of Dynamic Properties (e.g., RichnessRoll and ExtensivenessRoll), and set their values to "{Random(6)}" (without the quotes) when triggered. If you want to be able to display the text from the table instead of just the roll, you could add a pair of Calculated Properties (e.g., Richness and Extensiveness). Richness would be
Code: Select all
RichnessRoll == 1 ? "None" : RichnessRoll == 2 ? "Trace" : RichnessRoll == 3 ? "Poor" : RichnessRoll == 4 ? "Good" : RichnessRoll == 5 ? Rich" : "Pure"}
and similarly for Extensiveness. Note that this option only works with VASSAL 3.4 or later.
jrwatts
 
Posts: 222
Joined: April 29th, 2020, 10:30 pm

Re: secret random roll results

Postby jrwatts » January 2nd, 2021, 10:24 pm

Oops, I left an extraneous "}" on the end of the RichnessRoll code.
jrwatts
 
Posts: 222
Joined: April 29th, 2020, 10:30 pm

Re: secret random roll results

Postby GrognardKC » January 3rd, 2021, 4:37 am

Thanks I think I am going down the correct path. I had to change the Calculated property some to get it to show green.
Calculated Property Richness
((RichnessRoll == 1 ) ? (None) : (RichnessRoll == 2) ? (Trace) : (RichnessRoll == 3) ? (Poor) : (RichnessRoll == 4) ? (Good) : (RichnessRoll == 5) ? (Rich) : (Pure))
I made a text label to watch RichnessRoll change, that works.
I cannot get Richness to display
I made both a text label and a report action no matter what I do with Richness and $$,"",'' I either get the word Richness to display or nothing.
Its probably something stupid Im doing.
Attachments
Demo 2.jpg
Demo 2.jpg (232.58 KiB) Viewed 1478 times
GrognardKC
 
Posts: 4
Joined: December 2nd, 2020, 1:38 am

Re: secret random roll results

Postby jrwatts » January 3rd, 2021, 4:45 am

You definitely need quotes instead of parentheses around the texts; I just noticed I was missing a quote before the word "Rich" in my version, which would explain why it doesn't work. (Without the quotes, it will be looking for the value of a property called None, Trace, Poor, etc., rather than displaying literal text.)

Edit: You may need the parentheses around the whole thing (which I left out), but the rest of those parentheses should be unnecessary (but shouldn't hurt anything, either).
jrwatts
 
Posts: 222
Joined: April 29th, 2020, 10:30 pm

Re: secret random roll results

Postby rprasadusa » January 8th, 2021, 11:52 am

It seems that you need a True:False for each comparison? It works with nested statements like this (I used SCDieRollResult and the quotes in my mod), i.e., with lots of parentheses at the end:
SCDieRollResult==1 ? "Yellow: A, B; Purple: C, D" : (SCDieRollResult==2 ? "Yellow: A, C; Purple: B, D" : (SCDieRollResult==3 ? "Yellow: A, D; Purple: B, C" : (SCDieRollResult==4 ? "Yellow: B, C; Purple: A, D" : (SCDieRollResult==5 ? "Yellow: B, D; Purple: A, C" : "Yellow: C, D; Purple: A, B"))))

As for reporting: I think you just need the $'s in your ReportRichness action, so "$Richness$" rather than "{Richness}"
rprasadusa
 
Posts: 8
Joined: September 6th, 2020, 6:03 pm


Return to Module Design

Who is online

Users browsing this forum: No registered users and 4 guests