Can you count pieces in a zone?

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.

not easily :slight_smile: 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

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.

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

This is pretty much something I’ve been wanting to do for ages, and would love anything that gets me there. :slight_smile:

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.

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.

Here’s a quick proof of concept: db.tt/TRyJCwHF

thats it exactly

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.)

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

Wow.

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

Here’s my current module:
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.

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.

Sorry it’s taken me so long to poke around with this. You have it all set up just fine except for the crucial component–the MovedOnMap named keystroke that is prompting your Trigger is not occurring. The place where you need to set it–the very lowest setting in the map properties of the Klingon Home Fleet map–is empty.

You need to put MovedOnMap there (and also in the settings for the Main Map, since you want the reverse to work when ships move from that window back onto the Main Map).

Ah ha!

Yep, that worked. Put in the command for moving out, and that worked too. Creating into the box works fine.

Now… how to get ‘delete’ to work? It would seem like the thing to do is to create a trigger action where {CurrentZone==“Klingon Home Fleet”}, and watch for CTRL D (delete), but I’m getting very odd results. I have reporting echoing all the moves to the chat box, and once that’s in place, the reporting looks normal, except when I delete a piece in the fleet box.

At that point, the reporting says it was deleted from its previous location (if I create directly in the box and then delete the location is blank/empty). And, the SE count does not go down. It does not seem to matter if the trigger is above or below the delete in trait order.

I would try making a Trigger where the menu text is “Delete” and the keystroke is Ctrl-D, but have the Trigger do the Report of the deletion, then any required adjustment of the Global Property, and finally the actual Delete trait (with some named keystroke and no menu text).

That fixed global property. However, the reporting is still saying that the unit was deleted from its previous location: If I create a ship in 1004, move it into the Klingon Home Fleet, and then delete it, I get the message, “* C7 deleted in 1004”.

Also, since I want it to only modify the KHFSE property when its being deleted from in the Klingon Home Fleet, it would seem to me that I need to limit the trigger to when “{CurrentZone==“Klingon Home Fleet”}”, but then I have a delete that can’t work on the main map (also, keep in mind this will be far from the only fleet box…).

I tried a trigger that is always valid that fires off commands to a set of other triggers that are conditional, so they can manipulate the correct properties for the actual situation, and then fire off the delete trait, but I can’t get the initial trigger to ever be valid…

Okay, re-built the delete triggers completely… And now the menu entry is always valid, but the delete itself doesn’t happen from the Home Fleet map. It does work from the main map (each case is handled by a different secondary trigger). However, the main map version has the same reporting error as before; the Klingon Home Fleet map doesn’t delete, but the reporting is correct…