# Bad behavior in activating layers in 3.2.3

**URL:** https://forum.vassalengine.org/t/bad-behavior-in-activating-layers-in-3-2-3/5870
**Category:** Technical Support & Bugs
**Created:** [March 31, 2013, 3:18pm UTC](https://forum.vassalengine.org/t/bad-behavior-in-activating-layers-in-3-2-3/5870 "2013-03-31T15:18:15Z")
**Posts on this page:** 9
**Page:** 2

<div class="post-metadata">

### Author: ![Tim\_M](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/tim_m/32/2_2.png) [@Tim\_M](https://forum.vassalengine.org/u/Tim_M)
#### Post date: [April 19, 2013, 1:44pm UTC](https://forum.vassalengine.org/t/bad-behavior-in-activating-layers-in-3-2-3/5870/21 "2013-04-19T13:44:42Z")

</div>

Nevermind - I missed the key command field totally duh!

* * *

From: Timothy Mccarron [timothy.mccarron@sbcglobal.net](mailto:timothy.mccarron@sbcglobal.net)  
To: The mailing list for VASSAL [messages@vassalengine.org](mailto:messages@vassalengine.org)  
Sent: Fri, April 19, 2013 8:43:15 AM  
Subject: Re: [messages] [Technical Support & Bugs] Bad behavior in activating  
layers in 3.2.3

Ok, I follow what you are saying but one thing does not fit (or maybe wont fit  
later on)

You say to use reset to a negative to deactivate the layer / or keep it from  
activating, but I seem to recall that when we went through and got layer  
redesigned to work with properties you also allowed for layers to understand  
negative numbers.

Although in this instance we are not following a property with -ve values, what  
is going to happen to layer that follows a property with -ve values.

Hmm, trying to answer this it seems I found something else looking at the 3.2.4  
layer interface. So I can follow an expression but I can also leave the layer  
inactive - how would I activate it? - nowhere to enter a command to do that.  
Also you cannot reset a layer that is following an expression which makes sense  
then, just that the Always active? state does not

I am not sure what should be done here, compared with the past

* * *

From: Brent Easton [b.easton@exemail.com.au](mailto:b.easton@exemail.com.au)  
To: [messages@vassalengine.org](mailto:messages@vassalengine.org)  
Sent: Fri, April 19, 2013 5:33:33 AM  
Subject: Re: [messages] [Technical Support & Bugs] Bad behavior in activating  
layers in 3.2.3

Ok, I think I have finally got to the bottom of this.

The Activation command is working correctly in 3.2.4. The culprit is the  
Reset command that is being issued to the counters as part of a Trigger  
that activates the counters in CC:E. This is why Combat Commander  
appears to be the only module affected.

It turns out that the Reset command has always been ‘broken’, up until  
3.2.4 when it was ‘fixed’ as part of my changes to fix bug 3700. Try  
this in 3.1:- Add a Reset to Level 1 to a counter with Layer. Do the  
Reset command and the counter Activates on to layer 1. Now do an  
Activate command to deactivate the layer and the Activate command has no  
effect. Do it again and the layer de-activates. Sound familiar? This is  
basically bug 3700 being caused by the Reset command.  
Both the manual and designers guide say this of the Reset command:

_Specifies a keyboard command that resets the Layer to a specified  
level. **This does not automatically activate the Layer**._

I’m not sure where this came from, but the Reset command does, and  
always has, automatically activated the layer if you sepecify a positive  
level number. If you specify a negative level number, then the layer is  
deactivated and set to the level number (i.e. Reset to -2 says move to  
level 2 and force deactivate the layer). It is quite clear from the code  
that this is how it supposed to work. So when CC:E trys to activate a  
counter, it is telling it to Reset to level 1 and Activate, immediately  
before issuing the Activate command which toggles the activation back  
off again. In 3.1, the bug in reset caused the first activation after a  
reset to be ignored, which meant that it appeared to work and masked the  
bug in the module.

The solution for CC:E is to change the Reset command in the Aon Layer in  
the Activate Routine prototype from Reset to layer 1 to Reset to layer  
-1.

With the introduction of Named Key Strokes in 3.2, the Layer trait was  
extensively re-written and if I had done it properly, CC:E would have  
broken with the first 3.2 release and we would have seen this much  
sooner.  
I have also just about finished reworking the Refresh Counters option to  
work correctly on modules containing older saved games as setups. The  
problem occurs where these games where originally built before Game  
Piece id’s existed and have never been allocated one, so no link exists  
back to the palette slot they came from. I am adding an option to search  
for a palette slot based on the counter name. This should make it  
possible to then refresh these older save games (and all games started  
using them) with the Refresh Counters command.

I hope that all makes sense.

Brent.

* * *

Read this topic online here:  
[https://forum.vassalengine.org/t/bad-behavior-in-activating-layers-in-3-2-3/5870/19](https://forum.vassalengine.org/t/bad-behavior-in-activating-layers-in-3-2-3/5870/19)

---

<div class="post-metadata">

### Author: ![Brent\_Easton](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/brent_easton/32/10_2.png) [@Brent\_Easton](https://forum.vassalengine.org/u/Brent_Easton)
#### Post date: [April 19, 2013, 10:06pm UTC](https://forum.vassalengine.org/t/bad-behavior-in-activating-layers-in-3-2-3/5870/22 "2013-04-19T22:06:13Z")

</div>

> [@](#):
>
> You say to use reset to a negative to deactivate the layer / or keep it from  
> activating, but I seem to recall that when we went through and got layer  
> redesigned to work with properties you also allowed for layers to understand  
> negative numbers.

Using negative numbers when following a property only has meaning where you also use the 'Level 1 = ’ option to specify a that level 1 is greater than 1. Negative numbers in the following property will then be adjusted relative to that value. So if Level 1 = 5 and the property value is -2, then level 3 will be displayed.

If the follow property value causes the actual level to be displayed to be less than 1, then level 1 will be displayed.

---

<div class="post-metadata">

### Author: ![sithstalker](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@sithstalker](https://forum.vassalengine.org/u/sithstalker)
#### Post date: [April 20, 2013, 3:21am UTC](https://forum.vassalengine.org/t/bad-behavior-in-activating-layers-in-3-2-3/5870/23 "2013-04-20T03:21:31Z")

</div>

I just tried a quick “fire” order and still didn’t get the green box around the firing unit when activated. There was a green line around the photo on the order card when played, but not around the unit when I activated it?

---

<div class="post-metadata">

### Author: ![Brent\_Easton](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/brent_easton/32/10_2.png) [@Brent\_Easton](https://forum.vassalengine.org/u/Brent_Easton)
#### Post date: [April 20, 2013, 3:49am UTC](https://forum.vassalengine.org/t/bad-behavior-in-activating-layers-in-3-2-3/5870/24 "2013-04-20T03:49:32Z")

</div>

You will need a new version of the CC:E module for this to work.

---

<div class="post-metadata">

### Author: ![sithstalker](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@sithstalker](https://forum.vassalengine.org/u/sithstalker)
#### Post date: [April 20, 2013, 2:45pm UTC](https://forum.vassalengine.org/t/bad-behavior-in-activating-layers-in-3-2-3/5870/25 "2013-04-20T14:45:41Z")

</div>

I reinstalled the only available module (January 2012) to no avail. Is there going to be a corrected module for this problem, or some kind of patch?

---

<div class="post-metadata">

### Author: ![Tim\_M](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/tim_m/32/2_2.png) [@Tim\_M](https://forum.vassalengine.org/u/Tim_M)
#### Post date: [April 20, 2013, 5:12pm UTC](https://forum.vassalengine.org/t/bad-behavior-in-activating-layers-in-3-2-3/5870/26 "2013-04-20T17:12:45Z")

</div>

The easy fix for now is to use Vassal 3.2.2 or lower.  
The corrected module will come out with the next extension “Fall of the  
West” which is in progress awaiting product release

-----Original Message-----  
From: messages [[mailto:messages-bounces@vassalengine.org](mailto:messages-bounces@vassalengine.org)] On Behalf Of  
sithstalker  
Sent: Saturday, April 20, 2013 9:46 AM  
To: [messages@vassalengine.org](mailto:messages@vassalengine.org)  
Subject: Re: [messages] [Technical Support & Bugs] Bad behavior in  
activating layers in 3.2.3

I reinstalled the only available module (January 2012) to no avail. Is there  
going to be a corrected module for this problem, or some kind of patch?

* * *

Read this topic online here:  
[https://forum.vassalengine.org/t/bad-behavior-in-activating-layers-in-3-2-3/5870/25](https://forum.vassalengine.org/t/bad-behavior-in-activating-layers-in-3-2-3/5870/25)

---

<div class="post-metadata">

### Author: ![sithstalker](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@sithstalker](https://forum.vassalengine.org/u/sithstalker)
#### Post date: [April 21, 2013, 3:38am UTC](https://forum.vassalengine.org/t/bad-behavior-in-activating-layers-in-3-2-3/5870/27 "2013-04-21T03:38:45Z")

</div>

Tim…thanks. I reinstalled 3.2.2 and CC:E works fine again. I appreciate your help.

---

<div class="post-metadata">

### Author: ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)
#### Post date: [April 23, 2013, 2:27pm UTC](https://forum.vassalengine.org/t/bad-behavior-in-activating-layers-in-3-2-3/5870/28 "2013-04-23T14:27:17Z")

</div>

Thus spake Brent Easton:

> Ok, I think I have finally got to the bottom of this.
> 
> The Activation command is working correctly in 3.2.4. The culprit is the  
> Reset command that is being issued to the counters as part of a Trigger  
> that activates the counters in CC:E. This is why Combat Commander  
> appears to be the only module affected.

Is the upshot that there’s nothing further to do with Bug 9700, then?  
I.e., we’re no longer waiting for a fix for it before releasing 3.2.5?

–  
J.

---

<div class="post-metadata">

### Author: ![Brent\_Easton](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/brent_easton/32/10_2.png) [@Brent\_Easton](https://forum.vassalengine.org/u/Brent_Easton)
#### Post date: [April 23, 2013, 9:21pm UTC](https://forum.vassalengine.org/t/bad-behavior-in-activating-layers-in-3-2-3/5870/29 "2013-04-23T21:21:24Z")

</div>

On 24/04/2013 12:27 AM, Joel Uckelman wrote:

> Thus spake Brent Easton:
> 
> > Ok, I think I have finally got to the bottom of this.
> > 
> > The Activation command is working correctly in 3.2.4. The culprit is the  
> > Reset command that is being issued to the counters as part of a Trigger  
> > that activates the counters in CC:E. This is why Combat Commander  
> > appears to be the only module affected.  
> > Is the upshot that there’s nothing further to do with Bug 9700, then?  
> > I.e., we’re no longer waiting for a fix for it before releasing 3.2.5?

Yes, that is correct. Just the p2p stuff.

–

* * *

Brent Easton  
Analyst/Programmer  
University of Western Sydney  
Email: [b.easton@exemail.com.au](mailto:b.easton@exemail.com.au)

[Previous page](https://forum.vassalengine.org/t/bad-behavior-in-activating-layers-in-3-2-3/5870.md?page=1)
