First Foray into Global Properties

I want to be able to place an information counter on top of various other counters during the course of a game turn.

At the end of the turn all the information counters that were placed will all be removed.

Can I design a single piece and then have some method of deleting/removing them all from the map simultaneously?

Check out the global key command. You can delete all pieces that match a particular property by calling their individual delete commands.

  • M.

2009/4/2 MikeR <messages@forums.vassalengine.org (messages@forums.vassalengine.org)>

Post generated using Mail2Forum (mail2forum.com)

Yep. That’ll do it.

To expound on that, give each of your Information counters a Marker trait and a Delete or Return to Deck trait depending on whether you wish to delete them or return them to a counter pool somewhere. You can also put both traits in a Prototype and apply the prototype to all your information counters.

Then have a Global Key Command somewhere that sends the key command to trigger the deletion or return with the property match of…

CurrentMap = [map where the counter are located] && [Marker Name] = [Marker Trait]

For example, if you’re map is named MainMap and your Marker is named CounterType = Information, your property match would be:

CurrentMap = MainMap && CounterType = Information

I’m still having trouble here.

OK, I have a counter called ‘Pin’ that is placed on other counters to show that they can no longer move or fire.

At the end of the player’s turn, all ‘Pin’ counters are removed from the Map.

The counter name is ‘Pinned’

It has the following Traits;

  1. Marker:

Marker property Name: isPinned
Marker property Value: true

  1. Delete

Now, do I add a Global Key Command as a trait to the ‘Pinned’ counter, or do I set up a Global Key Command somewhere else?

The global key command belongs to the whole module. Right-click on the module at the top of the hierarchy and add a global key command to delete all pieces with the marker property isPinned. Take a look at the help for global key command.

  • M.

2009/4/2 MikeR <messages@forums.vassalengine.org (messages@forums.vassalengine.org)>

Post generated using Mail2Forum (mail2forum.com)

You probably want to have some sort of button that’s clicked when the turn ends. In the button’s properties, you’ll want to add the following traits

Action Button
Invoke Key Command - CTRL B

Global Key Command
Keyboard Command - CTRL B
Global Key Command - CTRL D
Matching Properties - CurrentMap = [MapName] && isPinned = true
Apply to All Pieces

The keys I’m using here or for the example only and you can change the key commands. I’m also assuming in this example that the Delete trait you have on your counters is using a CTRL D

So, what happens here is, when you click the button, it triggers a CTRL B.
The Global Key Command accepts the CTRL B and fires a CTRL D to all counters on the main map where isPinned = true.

Note that the order I’ve listed the traits above need to be reversed in your button traits as traits are executed from the bottom up.

Thanks very much for the help. I have now succeeded in removing the pin counters across the map using a Global Command as per your instructions.

My next task is to use a similar command to restore all units (which have layers) to the original layer at the end of the turn.

Much appreciate the help.

I’m attempting to do something similar here, but I’m having some problems. I have a demoralization marker that has two levels (1 and 2). It’s one piece, with two images/levels in it.

If something is at level 2, I want to move it to level 1; if it’s at level 1, I want to delete it. I assume I need to come up with two separate global key commands here.

For matching properties, I have “Level_Name=DM-CP2” (the name of the second level), but that isn’t working. Is there a way to indicate which level of the piece is showing?

Thanks.

*********** REPLY SEPARATOR ***********

On 29/06/2009 at 6:59 PM cartwright wrote:

There is, it’s in the reference manual and its not Level_Name, but there is an easier way to do this.

Make your demoralization marker 3 levels instead of 2, make it Always active and not looping.

Make level 1 a transparent counter the same size as the marker
Make level 2 your level 1 demoralization counter
Make level 3 your level 2 demoralization counter

Now you don’t have to worry what level is showing. Just issue the Decrease level command to all counters and all level 2’s will go down to Level 1’s, all Level 1’s will go down to the transparent level and dissappear and all transparent levels will not be affected because they are the bottom level.

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Could this cause issues with using lots of RAM if I have hundreds of transparent counters floating around and never being deleted? Is there a way to select pieces on the basis of which level is showing? Even if that’s more work upfront, I think I’d prefer to do it that way, rather than have numbers of transparent markers still around.

Sorry, I envisaged that the Demoralized images would be part of a Layer trait attached to all counters via a prototype, rather than it being a seperate counter,

A Layer defines a number of Properties. In the name of the properties, <layer_name> is the name of the overall Layer as specified in the top field of the properties.

<layer_name>_Image returns the name of the currently-active level’s image file
<layer_name>_Name returns the name of the currently-active level
<layer_name>_Level returns the number of the current level
<layer_name>_Active returns true if the Layer is active, false otherwise

EXAMPLE: A Layer named Manpower that is active and showing level 4 defined with image Man04.gif and name (strength 4) would have the following properties:

Manpower_Image = Man04.gif
Manpower_Name = (strength 4)
Manpower_Level = 4
Manpower_Active = true

These properties could be used in a Global Key Command to automatically remove all counters whose manpower was zero.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thanks for the help, Brent. I’m working through the documentation and trying to figure this out, but I keep running into a wall. I’m working on the Guns of August module. In GOA, DM markers placed during attacks aren’t removed at the end of the phasing player’s turn, while DM markers placed during defense are. Yet there’s only one DM counter, which makes it very confusing. So what I’m trying to do is have a single DM counter with two layers–one to indicate step 2 (DM’d during attack) and one to indicate step 1 (DM’d during defense). At the end of the phasing player’s turn, the step 1 disappear and the step 2 go to step 1.

Or at least that’s the idea.

The marker is named Demoralized-CP. The layer is m-Demoralized-CP. Image 1 (level 1) is m-Demoralized-CP, with level name is DM-CP. Image 2 (level 2) is m-Demoralized-CP2, with the level name is DM-CP2.

I’m trying to set the global key command to decrease (CTRL W) on all level 2s. But I can’t seem to get this to work properly. In the global key command/matching properties, I’ve tried:

m-Demoralized-CP_Level = 2 (and made the hotkey CTRL-W). That doesn’t do anything.

I’ve tried:
m-Demoralized-CP_Name = DM-CP2. That doesn’t work, either.

Any suggestions on what I’m doing wrong? I’m certainly overlooking something simple here. As always, thanks in advance.