Create account / Log in

different marker/counter value if a card is masked

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

different marker/counter value if a card is masked

Postby bugggg » July 16th, 2014, 5:38 pm

I'm attempting to add automatic basic scoring to my Yardmaster Express (http://www.vassalengine.org/wiki/Module:Yardmaster_Express) module, but it would require each card to have two different values depending on whether or not it's been masked. The value is 4 if it is masked. If the face is showing, it can be 4, 5, 6, or 8 (I don't think that there are any 7 cards). Does anyone know how to give a different marker/counter value to a card based on whether or not it's masked -- if it's even possible? Thanks!
bugggg
 
Posts: 20
Joined: September 21st, 2011, 6:37 pm

Re: different marker/counter value if a card is masked

Postby Tim M » July 16th, 2014, 6:23 pm

Use a calculated Property with an if statement that references the ObscuredToOthers property

should go something like this (syntax may not be perfect)

CP Name : ScoreValue
CP Value : If (ObscuredToOthers = true, ValueWhenMasked, ValueWhenNotMasked) e.g if(ObscuredToOthers = true, 4, 8)
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1812
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: different marker/counter value if a card is masked

Postby bugggg » July 16th, 2014, 6:53 pm

Interesting... I'll give that a try! (I'm assuming that it's the number eight and then right parenthesis at the end of that statement)
bugggg
 
Posts: 20
Joined: September 21st, 2011, 6:37 pm

Re: different marker/counter value if a card is masked

Postby bugggg » July 16th, 2014, 7:33 pm

Okay, I have that in and it liked it, but I don't know how to really *do anything* with it. I can't seem to get it to do a total or even print the the first value.

I need it to add the values of each card in a zone and display that in a text label -- for five different zones.

I think that I may be in way over my head with this one =-(
bugggg
 
Posts: 20
Joined: September 21st, 2011, 6:37 pm

Re: different marker/counter value if a card is masked

Postby bugggg » July 16th, 2014, 7:43 pm

Oh, some more information that I just realized I left out of the original post:

Each player has a zone that can hold 5-7 cards. The score is a total of the point values of those cards (which, as I said before, can be different depending on the side of the card that's showing)
bugggg
 
Posts: 20
Joined: September 21st, 2011, 6:37 pm

Re: different marker/counter value if a card is masked

Postby bugggg » July 17th, 2014, 12:42 pm

New update:

Your idea works perfectly for making the value appear on the card, so that's definitely a great first step. Now I just have to figure out how to add all of the ScoreValue values in a zone!
bugggg
 
Posts: 20
Joined: September 21st, 2011, 6:37 pm

Re: different marker/counter value if a card is masked

Postby JoelCFC25 » July 17th, 2014, 1:17 pm

See this thread from a couple months ago: viewtopic.php?f=6&t=7279
JoelCFC25
 
Posts: 711
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: different marker/counter value if a card is masked

Postby bugggg » July 17th, 2014, 6:55 pm

I think that I may need to change my single zone for each player to make it so that each train card goes into its own grid "slot". I could then tell it to add everything in the p1 slots, everything in the p2 slots, and so on...

I think that I could then just make a button that does it all without having to trigger on every turn/movement.

Does that sound correct/logical?
bugggg
 
Posts: 20
Joined: September 21st, 2011, 6:37 pm

Re: different marker/counter value if a card is masked

Postby bugggg » July 18th, 2014, 6:54 pm

Ugh, I just realized that doing the ScoreValue thing overrides my card names... so logging/reporting doesn't work like it used to! =-(
bugggg
 
Posts: 20
Joined: September 21st, 2011, 6:37 pm


Return to Module Design

Who is online

Users browsing this forum: No registered users and 3 guests