Resetting button capture history

There may be a way to accomplish my goal without actually resetting the button capture history. Maybe I can clear out the numberList instead…? I really just need the game mechanic of “resetting the running total when a 7 is rolled” to work.

Any help/advice is appreciated.

When you press the reset button, have it capture the number of times you have added to the list. You can then use that number as a starting point for the actual list you want to use, instead of 1. Here is an example to illustrate.

Thanks for jumping in to help!
Can you think of a way that the reset would be triggered just by rolling 7, without the need for a reset button?

Oh, sorry, I didn’t actually look at the activity. In your case, a ticker and an action will work, because you can have the ticker constantly run the action, which is checking to see if the roll is 7.

Actually, I added in a state variable to check if the roll is finished, and to only add the value then, so that it wouldn’t add the value multiple times. At that point, if the total is 7, instead of adding the dice roll, it sets the total back to 0.

You can grab the runningtotal variable from the dice graph and use it in your other components. Let me know if any of it is not clear.

Thanks! That’s great!
Can you point me toward documentation to learn more about tickers with actions?

I came up with somewhat of a brute force solution of creating a separate list for each round.

Sure, here is a good start:

You can also get rid of the action buttons for banking points as well if you like. Create a polygon (or import a picture of a button) on the graph, and make it clickable, and then have it run an action. You can hold all of the scores and totals inside the dice graph, do all calculations there, and then just have the tables and notes pull from them. That can be much easier to do and manage than having several action buttons.

1 Like

Here’s an example of making buttons work with tickers/actions: 3 buttons • Activity Builder by Desmos

1 Like