At start stack pieces will not stack properly unless they are moved first?

I am making a module from scratch using 3.6.7 with a large number of at start stack pieces.

I experimented with adding layers to the module for different classes of pieces (fortresses, units, and markers), but quickly undid the changes. Now, the pieces are acting glitchy. For some specific units that set up at the start, if I move unit A onto unit B, they stack properly, but if I move unit B onto unit A, they do not. By “they do not” I mean that unit A does not appear when I do the mouse-over and unit A does not move with unit B if I select the stack and drag the stack. Somehow, A is not getting the message to stack with B when B is dragged on top of it. However, if I drag A onto B, not only does A stack properly with B but A behaves properly from then on (e.g. if I separate them and drag B onto A, they form a stack, A is visible in the mouse-over, A moves with the stack if I select and drag it, and so forth).

With this problem still unresolved, I decided to delete the property “do not stack” from the fortress prototype, because I wanted the players to be able to see the strength of a fortress using a mouse-over. However, some of the fortresses are acting exactly like the unit A I described in the previous paragraph.

Note that not all units of the same type and not all fortresses exhibit the same behavior. Most of them behave as they are supposed to. There is no rhyme or reason to which ones behave improperly – i.e. it’s not all HQ units or all infantry units or all German units or anything like that.

Any suggestions would be appreciated. Thanks.

Sounds like a fair amount of editing/testing cycles. When doing testing to see your changes, are you loading any predefined setups that might be in the module, or starting from a truly blank game (i.e., no predefined setup loaded)?

I solved the problem. I had originally positioned the stacks with “use grid location” turned on. I turned it off, and then for the problem stacks, I went into the reposition window, dragged the unit a few pixels, and pressed the snap to grid button. For the problem stacks, I noticed that this changed the location (as expressed in pixels along the X and Y axes) by one pixel.

So the problem is that the location in pixels derived by entering the location of the stack using the grid location does not always match the location in pixels derived by pressing the snap to grid button inside the reposition window. The latter seems to be the correct one; the former may be off by one pixel in some cases.

I hope the above makes sense.