Create account / Log in

Can you count pieces in a zone?

Talk about module design ideas and techniques.

Moderators: Tim M, uckelman

Can you count pieces in a zone?

Postby airjudden » May 8th, 2014, 8:21 pm

I have used the deckname_numPieces trait to count the number of cards in a deck and display it on the map.

I have used the Game Piece Inventory Window to display the number of cards in a player's hand (map) in a pop-up inventory window.

Is there a way to combine the ideas and show the number of pieces in a zone and display it to the map? That way, when you add or remove pieces from that zone, the number is automatically updated?

Thanks.
airjudden
 
Posts: 68
Joined: January 30th, 2013, 6:25 am

Re: Can you count pieces in a zone?

Postby Tim M » May 9th, 2014, 2:02 am

not easily :) But I'll clue you how without spelling out all the traits / strokes etc..

Think of a storing GP. when a piece enters the zone it increases the GP by 1. When the piece leaves the zone it decreases the GP by 1.
Use a text label somewhere to display the value of the GP

If you want a reference of something to look at I had to show the designers of Andean Abyss and 1805 (iirc) modules. You'll find similar effect in them
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: 1777
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: Can you count pieces in a zone?

Postby airjudden » May 16th, 2014, 5:31 am

I guess I'm not seeing it. The only thing I saw in Andean Abyss that changed numbers were decks. I can use the $DeckName_NumPieces$ command after checking the property box on a deck that counts the deck. Instead, I was wanting to count the pieces in a zone.
airjudden
 
Posts: 68
Joined: January 30th, 2013, 6:25 am

Re: Can you count pieces in a zone?

Postby Tim M » May 16th, 2014, 1:48 pm

Yeah, looks like the module has changed a lot. Never used to work like that. I will try and find one of the earlier versions that did the zone counting
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: 1777
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: Can you count pieces in a zone?

Postby Rindis » May 23rd, 2014, 5:42 am

This is pretty much something I've been wanting to do for ages, and would love anything that gets me there. ^_^

Poking around the 1805 module, I'm seeing some prototypes that upon a key command will move a piece into the removed box, and increment a Global Property count for that action. (Well, in theory, it looks like that's not in use currently.)

However, I want (and I think this is what Judd wants) to have this count increment/decrement whenever a piece moves in/out of a zone/map, even if (especially if) the user just manually puts the piece in there. There's some other complications with what I want, but I'm pretty sure I can work those out on my own, if I can just figure out how to get this part to work.
User avatar
Rindis
 
Posts: 196
Joined: December 22nd, 2007, 12:49 am

Re: Can you count pieces in a zone?

Postby JoelCFC25 » May 23rd, 2014, 1:30 pm

The key components as I see them would be:

1. The map needs a keystroke that will be applied to all pieces ending movement there (e.g., MovedOnMap)
2. Global properties for each zone to hold the piece count
3. Every piece type that will be counted needs 2 Triggers and 1 Set Global Property per zone (this is guaranteed to work, but there's probably a more elegant method, more below)

Each Trigger watches for MovedOnMap, and when it receives that keystroke, it fires the keystroke defined in the SGP to increment or decrement by 1. The property match on the increment Trigger would be along the lines of this (I'm using an example zone name of Italy just for a lark):

CurrentZone = Italy && OldZone != Italy

That's just to make sure we don't increase the count for someone futzing around with pieces within the zone. The property match on the decrement Trigger would be:

CurrentZone != Italy && OldZone = Italy


There's probably a way to do it all with just 2 Triggers (one for incrementing when a piece is moved into a zone where it's meant to be counted, one for the reverse) and a single SGP where you reference a Zone-level property by inline substituting your zone name (e.g., $CurrentZone$Count).

All that's left is some static blank pieces with Text Label traits to display the count for each zone. I think.
JoelCFC25
 
Posts: 589
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: Can you count pieces in a zone?

Postby JoelCFC25 » May 23rd, 2014, 2:03 pm

Here's a quick proof of concept: https://db.tt/TRyJCwHF
JoelCFC25
 
Posts: 589
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: Can you count pieces in a zone?

Postby Tim M » May 23rd, 2014, 2:22 pm

thats it exactly
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: 1777
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: Can you count pieces in a zone?

Postby Rindis » May 23rd, 2014, 3:39 pm

I'm at work right now, so I can't fiddle around. >.< But, will this work if a piece is created or deleted in the zone that's being counted? (That second case especially seems dodgy.)
User avatar
Rindis
 
Posts: 196
Joined: December 22nd, 2007, 12:49 am

Re: Can you count pieces in a zone?

Postby Tim M » May 23rd, 2014, 3:58 pm

when created yes (it should) as for second you might need a trigger case for that but that should be straightforward: Trigger - subtract 1GP - Delete Piece
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: 1777
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: Can you count pieces in a zone?

Postby grouchysmurf » May 23rd, 2014, 5:30 pm

Wow.
User avatar
grouchysmurf
 
Posts: 129
Joined: August 9th, 2011, 7:48 pm

Re: Can you count pieces in a zone?

Postby Rindis » May 24th, 2014, 4:28 am

Well, I looked over the sample module. Tried adapting it to my module... and can't get it to work. :(

Here's my current module:
http://www.rindis.com/F&E%202.0.vmod

There is a second map window: Klingon Home Fleet. There is a counter that represents the contents of that window on the map (Ships & Units > Klingons > Markers > Fleets). The stack viewer is set up to report a bunch of information when hovering over units on the main map (use anything in the Klingon section other than the one counter under 'Fast Ships' to test) . The goal is to get the fleet counter to report in the stack viewer the stats of everything contained in that map.

Right now, I'm just testing with the second statistic listed: SE (all the others will correctly give a '?' when you hover over the fleet marker). There is a global property set up for this (KHFSE), and the fleet marker's 'SE' value is set to that. If I change the global property's base value, the marker's reporting follows suit, so I know that part is working.

In the 'Ship' prototype I've set up a couple of traits that should adjust the SE value when moving a ship into the map. But I can't get that part to work. Can someone tell me what I've missed?
User avatar
Rindis
 
Posts: 196
Joined: December 22nd, 2007, 12:49 am

Re: Can you count pieces in a zone?

Postby Rindis » June 7th, 2014, 5:05 pm

Rindis wrote:Well, I looked over the sample module. Tried adapting it to my module... and can't get it to work. :(

Here's my current module:
http://www.rindis.com/F&E%202.0.vmod

There is a second map window: Klingon Home Fleet. There is a counter that represents the contents of that window on the map (Ships & Units > Klingons > Markers > Fleets). The stack viewer is set up to report a bunch of information when hovering over units on the main map (use anything in the Klingon section other than the one counter under 'Fast Ships' to test) . The goal is to get the fleet counter to report in the stack viewer the stats of everything contained in that map.

Right now, I'm just testing with the second statistic listed: SE (all the others will correctly give a '?' when you hover over the fleet marker). There is a global property set up for this (KHFSE), and the fleet marker's 'SE' value is set to that. If I change the global property's base value, the marker's reporting follows suit, so I know that part is working.

In the 'Ship' prototype I've set up a couple of traits that should adjust the SE value when moving a ship into the map. But I can't get that part to work. Can someone tell me what I've missed?

I don't suppose anyone could look this over? I really am mystified at what isn't working.
User avatar
Rindis
 
Posts: 196
Joined: December 22nd, 2007, 12:49 am

Re: Can you count pieces in a zone?

Postby grouchysmurf » June 8th, 2014, 8:02 pm

I d/led the module but I don't know what exactly I am looking at.
User avatar
grouchysmurf
 
Posts: 129
Joined: August 9th, 2011, 7:48 pm

Re: Can you count pieces in a zone?

Postby Rindis » June 11th, 2014, 3:26 pm

grouchysmurf wrote:I d/led the module but I don't know what exactly I am looking at.

I tried to point you towards the relevant parts, but lets try a little more detail:

First there's the global property, KHFSE, which is in the usual place (Global Properties).

Then there's the traits that try to change that global property when something moves into a particular map. These are in the 'Ship' prototype (near the top of the Game Piece Prototype Definitions), which applies to almost all the ships (counters) in the module.

Then there's the counter that is supposed to use the KHFSE global property, the Klingon Home Fleet marker. Physically, this is found by hitting the 'Ships' button, selecting 'Klingons', and selecting 'Markers' under that. In the edit view, it's at Ships & Units > Klingons > Markers > Fleets.

To see it in action, start a new game, select a map, pull out the Home Fleet marker onto the map and a couple counters from 'Ships' under the same submenu that got you to the fleet markers. Hover over one of the ships and you'll see the stack viewer come up, which will have a tag something like "1202: 1 (1 SE): 12-12". Those are all stats from the counter, and if you hover over a stack, you'll get the combined total of the stack. If you hover over the fleet marker, you'll get something like "0804: ? (0 SE): ?-?". Only the SE is defined (by the global property), so the others are question marks.

Next to the Ships button is the "K Home Fleet" button. This opens a separate map, and is a holding box for all the forces that fleet marker represents. (It is "Klingon Home Fleet [Map Window]" in the edit view.) The properties in the Ships prototype should trigger when a ship is put or created in that window.

That last seems to be what isn't working. Since the fleet marker has its 'SE' property defined, it's reading the Global Property. But that number doesn't change when fiddling with the fleet box, so the triggers in the ship prototype aren't going off.
User avatar
Rindis
 
Posts: 196
Joined: December 22nd, 2007, 12:49 am

Next

Return to Module Design

Who is online

Users browsing this forum: No registered users and 2 guests