How To Identify Invisible Units

Is there another method of identifying Invisible Counters other than changing the units Opaqueness? In a module I’m creating I want the counters invisible until revealed, and I don’t want the players looking at pale washed out counters, so I’m looking for alternatives to indicate whether they are hidden or revealed.

Does anyone know of other methods are hiding/revealing counters and how one knows what state it is in?

Layers and dynamic properties… you can have them displayed however you want then… completely visible to the owning player, with perhaps a small marker of some kind to indicate it’s currently invisible to others… or hidden to everybody until requested, then revealed to all or just the owning player… or whatever really.

The invisible part for an owning player hiding it from others is with an empty mask (view when masked: no image; display style: inset); turning off both report moves and centering on opponent’s moves.

If invisible to everyone at start, then just a no image or completely clear piece with layers.

OK so if I’m following this… I need to bind a layer (graphic) to a dynamic property (such as invisible). Let me ask a dumb question, when I set the default Invisible attribute, what property name does it set for that counter and can I simply use that? Then I assume that Layers will allow me to bind that property to a new graphic? Are there any default graphics options, such as highlighting a visible counter, or appending a border around it, or a label to it that says “VISIBLE!”?

Currently in my module the owning player can’t distinguish between visible and invisible counters because the default Invisible option only allow opaqueness and I set to 100% (so that hidden counters don’t look washed out); therefore, both states look the same. Too bad the Invisible default doesn’t offer more choices, perhaps that could be added to the VASSAL engine backlog of new capabilities.

It’s easy. Just add Layer trait with the single image represented your invisibility marker. Place it above Invisible trait. Then assign it the same Activate Layer Key as in Invisible Keyboard Command. That is all.

Sounds easy. Is there a module you know of that I can look at as an example?

I don’t know of any default graphics, I’m sorry. And maybe this can be done cleaner than I have it, but here’s what I was thinking… so we aren’t using the default invisible trait at all - that’s completely scratched… so for the owning player to control an invisible counter now, the empty mask (detailed above) becomes your invisible trait.

First though - near the top of the list, underneath Basic Piece - you’d want your layers (we’ll call it: invisibility). Say you want to go with an asterisk graphic in one corner of the piece to indicate it’s currently hidden. So your base image (the Basic Piece trait) will be the default image (no need to make a separate layer for it)… you want “always active” checked and “levels follow expression value” (expression: invisible), level 1 = 0. You want to two layers. You want image 1 to be: no image (for not hidden and just the default base piece), and for image 2 you would add an image of your asterisk or whatever (…and you may need to fiddle with the offset values near the top to properly place it over the piece where you want it). So… when the “invisible” dynamic property is set to 1, the piece will indicate that it’s hidden with that asterisk layer… when it’s set to 0, then only the basic image will show.

Now make your dynamic property (invisible)… it’s numeric, 0-1, current value 0 (you can set it to 1 to place your asterisk properly, but it should be set to 0 - or visible - at start). New command: no menu (clear), key command: nowhidden, type: set directly, new value: 1. Second new command: no menu (clear), key command: cancelhidden, type: set directly, new value: 0.

Now add 2 Trigger Actions… one with a property match of ObscuredToOthers=true, watch for: CTRL M (or whatever you have your mask trait set to), perform: nowhidden… the other with a property match of ObscuredToOthers!=true, watch for: CTRL M (or whatever you have your mask trait set to), perform: cancelhidden.

Then your empty mask at the bottom of this traits list.

That should work, I think, but if I got the ObscuredToOthers triggers firing a step behind, then just switch them around… but I think that will trigger 'em properly.

You can always add reports too (Such and Such piece is now hidden/revealed), etc.

Hope this makes sense.

Yeah… Nelud’s sounds like it might be (a lot) easier! I guess with that one the invisibility transparency can be set to 100%.

This is test module invis.vmod. See the logic in: Main Map → stack [At-Start Stack] → unit [Single piece]

Thanks guys, I’ll look into this. I’m so new to creating VASSAL modules that I’m running into stuff that everyone else has probably already solved. From a playability standpoint, I know exactly how I want this module to behave, but lack the technical experience of knowing the details on accomplishing it. Your help and assistance is making the development process much easier, thanks.

I took a look at this and it might be more complicated in my module. I’m using the Layers to flip between degraded states on the playing pieces. It appears that there can be only one Layer per counter defined and I don’t see how it can be defined for multiple purposes, such as having one CTRL-D key flip between the degraded counter states, and a CTRL-I that allows it to make it invisible to all other players while marking it to the owning player that it is now invisible.

Is there a way to get Layers serve a dual purpose? Or are there other ways to “tag” a counter to indicate that it is visible or invisible, meaning it could be as simple as adding text along its border whenever it accidentally becomes invisible.

Perhaps another way is that they are always invisible, which would do the trick. How would one make their entire OOB invisible as a default setting? Perhaps if Invisible had some “property” that could just be set in the counter Prototype.

Sounds like you want two separate layers, which is great. I haven’t checked out Nelud’s test mod, but use that idea above (or underneath in trait order) your completely separate degraded layer. Use different layer names, triggers, etc.

BTW, if you don’t have an image to use to mark invisibility, you can use a Text Label linked to your invisibility layer. The label - say you want “Hidden” written over the piece - would appear when it’s invisible, using $<layer_name>_Name$ as its text. I can elaborate.

Thanks. It’s good to here that you can create more than one Layer. I assumed you could, but on my first try it just dropped me into the editor for the existing layer. I’ll give this another try. I like the idea of the text label, which I’ll probably have as VISIBLE and if I could have it blinking I would. There’s nothing worse in a double-blind game than not knowing your opponent can see your pieces. So I’m trying to make this module fool-proof. I definitely appreciate the help figuring this out.

So there’s a slight hiccup with the text layer set-up, that being an empty (no image) layer won’t activate (at least w/o a Menu Command). By this I mean if you take the image out of Nelud’s invisible layer idea, then the trigger you used for invisibility trait will no longer activate that layer (or wouldn’t for me when I ran a quick check). Not sure if that’s by design or a bug.

Easily fixed though… just change your invisible layer to ALWAYS ACTIVE and LOOP THRU LEVELS (both checked). On Increase Level, leave the menu command blank and put your Invisible trait trigger as the Increase Level key (CTRL I, if using the invisible trait’s default trigger key). Now you want 2 levels for this layer (so you probably need to add one level). Both levels (Image 1 and Image 2) should have (No Image) and “Double-click here to add a new image” in their image spaces to the left. Finally, as you want the visible units to be the ones highlighted, select Image 1 and write VISIBLE in Image 1’s Level Name area. For Image 2 (the second level), keep its Level Name completely empty.

Now add a new Text Label trait to the unit. In its Text space you want to write this:


Replace the <layer_name> portion of that with the name of your invisible layer trait that you just worked on. What this does is print whatever the assigned name is for the level that layer is currently at. Since the layer starts at level 1 (which you assigned VISIBLE as its level name), that will be printed over the unit at the start. When you trigger the invisible trait, that layer will advance to level 2, which has no name… so nothing will be written. When you trigger invisible off, since the invisible layer loops levels, it’ll go back to level 1… etc…

You’ll need to tweak the font size and offset positioning as you want it. I don’t know if there’s a way to make it flash. I’d start with 30 bold font size, “Center” all four positioning/justification settings, and maybe like a bright green color. Oh, clear the Menu Command space, which is unneeded.

Hope I explained this well, but feel free to ask for clarification. And use the Layer trait’s help button too btw. The help button in vassal is amazingly helpful.