Graphic Dice incrementor

Sure thing…it’s still in the works but very functional at this point. I’ve included a graphic to show where I am trying to go compared to what I do have. And, to help clarify, a Doctor’s Note ;)

You can find the file here - brummbar44.com/wp-content/pl … .php?id=30

Thanks for looking at this!

Sorry for the delay. I actually had this sample done a couple days ago but I got interrupted before I had a chance to post it and then I completely forgot about it.

Anyway, here’s a sample which I believe does somewhat what you want. Includes notes.

http://www.drnostromo.com/DHSample.zip

Thanks very much for your efforts Dr.Nostromo!

But I’m afraid this wasn’t quite what I was looking for. Perhaps I needed to explain it better.

What I was trying to do with the dice incrementor graphic (the one with the plus/minus sign) was by increasing or decreasing that, the appropriate number of dice would appear in the battle boxes below. So for example, when the Battle 1 incrementor is set to 4, then 4 graphic dice appear in the Battle 1 box. The player would then roll those dice (each die has symbols on their face that have specific meaning in the game).

So in essence, the graphic dice would be stored somewhere (perhaps off board?) then when the incrementor is changed, it moves them to the battle boxes. Would that work? If so, how can I have something hidden then appear? Or is there a better way to handle this?

Again, thanks for all of your help!

You can have each dice use a layer trait. Start it at layer 0 (zero) with that layer being a transparent graphic. Then when the variable used to control which layer is display is reset to 0, the die will disappear. Any other number will display the graphic you have assigned to that number.

Does that make sense?

It does make sense.

I do have a layer trait on the dice already that is set to random (in order to show the symbolic face when rolled). If I add another level to that layer with a blank graphic, won’t it skew the results? (ie. the dice now have 7 sides…and wouldn’t it be then possible for the blank side to be rolled?).

The other problem is that I’m not looking to have the ‘incrementor’ actually roll the dice, I just want it to increase or decrease the number of dice available for the player to roll. So if a 4 is showing on the incrementor, 4 dice appear in the battle box. The player can then select those dice and roll them.

I’m thinking that the incrementor could use the ‘send to location’ to have the dice appear or disappear accordingly. Seems like this would be the most straightforward method to produce the result I am trying to describe. But I don’t yet understand how to make the dice visible and invisible. Is there a method to do this?

Thanks

You could set up your D6 roll to add 1 to the result. Therefore, your die rolls would actually be 2 thru 7. Then you can use a value of 1 to reset the die to blank. …or, you can set the layer to Level 1 = 0. Since a D6 can never roll a 0, the 0 would only be used to reset the die.

When a player rolls those dice, do you want it set up so that they roll them individually or collectively?

You could probably go either way here. You can have the dice remain on the table with a blank graphic so they are invisible when not used or you can have them in a hidden deck and withdraw the dice (with a Send to Location) from that deck when needed and sent back (Return to Deck) when you don’t. The advantage to that would be they wouldn’t need a blank graphic as level one.

Do the dice in the mod you sent me have all the graphics for the die sides in place? If so, I’ll come up with another sample. I’m off work for a week and a half so I should be able to get to this in the next day or so.

I’m not sure how to set the results to only be 2 thru 7 but I see what you mean here. I’m also not sure how I could allow only the proper number of dice to roll? Even though the blank face wouldn’t appear to the player, it could still be selected and rolled no?

They would be rolled collectively for each battle. I liked your ‘Roll’ button, it would save on having to make the player select then right click on the dice to be rolled. I suppose that would need to be a Trigger to get the dice appearing to be rolled on a battle basis?

Ahhh…a hidden deck would be the answer here then? I was tinkering last night with the concept but am afraid I am out of my depth (and it was getting late). But yes, the idea would be to have all of the dice somewhere hidden from both players. Then when the incrementor is changed from 0 to a number, that number of dice would then appear in the respective battle box. If later decreased, then the extra dice would again be hidden so that only the dice appearing would show results (which makes me wonder, would the hidden dice also show return results?).

Again, ideally, there would then be a “Roll Battle 1” button that would allow the player to avoid having to select the visible dice and right click to roll them.

Yes, the dice that are in the mod sent are functional as dice now with the correct faces in place. Again, much appreciated with the help here, will be sure to give you credit!

Cheers!

You guys don’t mind if I … um … borrow the ideas, do you? :smiley: I’m going to be adding dice to my module soon, and the adjustable number of dice you are going for here would be a very handy feature for it.

Also, couldn’t you determine the random die result in its own trait, and have the layer set to follow a dynamic property based on that trait, with an extra layer for unused (hidden) dice? That should allow both more than six (ten, twelve, whatever sides your die has) layers and the ability to randomly generate the die roll without getting a “null” result. Or is that what you’re already aiming at, DrNostromo? :slight_smile:

Quick note. I’ll be back later for some more discussion.

In the meantime, there’s another thread both of you may be interested it with a sample mod I made just recently. The sample allows for up to 15 dice but with a few adjustments, you can make the sample use any number of dice you want.

[url]https://forum.vassalengine.org/t/a-complex-dice-rolling-problem/3422/1]

…and yes, feel free to borrow any ideas you like.

Thanks DrNostromo, I actually did find and have a look at that example. Wasn’t really applicable in my case though. Close but not quite.

Here’s a link to what I think you’re looking for:

http://www.drnostromo.com/DHSample_3.zip

…and here’s an answer to some of your previous questions:

You’ll note in the sample that I have the dice graphic levels set to 0 = transparent blank (non-active die), 1 = equals active die. This is controlled by a Dynamic Property (prototype) on each of the dice called DisplayControl. The die roll is set up to roll a D6+1 (results = 2 to 7) and the layers 2 thru 7 will display the results of the die roll.

As far as the proper number of dice rolling, I just made sure that the DisplayControl = 1 (active die) in order to roll it. If the DisplayControl equals 0, then it hasn’t been included and it won’t roll.

I’ve set it up so that once the number of dice is selected, the dice button will roll them. It will also reset the die counter to 0 so that when you click the + or - buttons the dice display will reset as well.

Didn’t need to in this case.

I just set up dice for the first Battle Die roll area. You should be able to duplicate what I’ve done for the second area. I labeled most everything 1-x with x being the die number. When you duplicate it for the second area, just name everything 2 or 2-x. Everything should work for the second set as well. If this still isn’t quite what you had in mind or you’re still having problems with it, let me know.

Thanks much Dr.!

Looks great in theory…so I downloaded the link…but there is no vmod to view? How do I look at it? What am I missing?

Thanks again, can’t wait to check it out!

The mod is inside the Zip file. It’s called DH_3.vmod.

Hmmm…when I download and unzip I get a folder with three things - an images folder, a buildFile and a moduledatafile…but no DH_3.vmod

I’m on a mac…does that make a difference?

That’s kind of weird. Oh, well.

A mod file is just a zip file with a vmod extension. I actually put the mod inside a zip but apparently it isn’t unpacking itself that way.

Take the zip file I sent you and just change the .zip to .vmod and see if that will do it.

If that doesn’t work, then create an empty zip file and place the Images folder, the buildFile and the moduledatafile inside it. Then change the .zip extension to .vmod.

Drat! No luck. I actually tried to do the old .zip to .vmod trick when I first downloaded it (I recall having to do that with a module awhile back) but no matter what, I get the error message that it’s not a valid vassal module.

Hmmmm…

Any other suggestions? Anyone?

On Dec 14, 2010, at 6:48 AM, GreenBear wrote:

Hmmm…when I download and unzip I get a folder with three things - an
images folder, a buildFile and a moduledatafile…but no DH_3.vmod

I’m on a mac…does that make a difference?

Could be. It may be unzipping both levels if you just double-click on
it.
However it seems to work for me.
I’ll try sending just the vmod to you directly.

The Archive Utility (the default Mac unzip utility) is very aggressive when it comes to zip files.

If you have a zipped module, and try to unzip it on a Mac using the Archive Utility , it will first unzip the zip file, and then find the module inside. The module is itself a zip file, so the Utility will then unzip that too, leaving you with the module components (an images file, a Build file, some other bits) and no explanation for what happened.

If you must deal with a zipped module on Mac OS, I’d recommended you use StuffIt Expander instead, which isn’t quite so aggressive.

Thanks for the replies folks. Someone sent me a copy as a .vmod and it worked just fine. I’ll keep this in mind for the future.

And thank very much to DrNostromo! PERFECT! That is exactly what I was looking for. Thanks, thanks and again a thousand thanks!

You’re welcome. Enjoy!