The global key command has a field call “range,” and I have found zero or little documentation about it. Ir asks for a number, but what are the units? I thought pixels, but my tests suggests that’s wrong.
I need to know if a small unit is atop a large landscape tile. I’ve used mats in the past to quickly do this, but in my present case a mat introduces other behavior I don’t want. An alternative would be that the small unit sends a GKC to the big tile via name and range=0 or whatever range needs to be. The big tile would respond “you are atop me.” It should work especially if I knew what range was. Any other ideas?
Does anyone have a link to a comprehensive list of piece properties?
Here’s a prior thread of yours that got a response, but unclear how it ended up working out for you at that time. The discussion didn’t proceed very far.
I am getting so old that I don’t remember stuff. I forgot I asked it before, and yes, the answer was what I needed. Thanks for leading me by the hand out of the maze.
The range attribute is indeed a number between 0 and ∞. Exactly how it is to be understood depends on where the owning piece is.
If the piece is in some Zone - or similar - that defines a metric, then that metric is used.
Hex and Rectangular Grids introduces a metric, and the range is given as a number of “steps”.
If the piece is not in some place with a metric - e.g., part of a Map or Board with no Hex and Rectangular Grid , or in a zone - or similar - with an Irregular Grid, then the range is measured in pixels.
The Mat ⇆ Mat Cargo relationship is great for things that are placed on top of a larger piece, and where those things are meant to move with the larger piece. However, a Mat is not stack-able, which means they are poorly suited for - say - units in a wargame.
What other undesirable consequences do you see when using the Mat ⇆ Mat Cargo relationship?
Another option would be to use mutual Attachment traits. That relationship allows to pieces to communicate very efficiently. If you want to know which tile a given piece is currently sitting on top of, then perhaps using a piece Global Key Commandtrait to fire a Set Piece Property in the tile - both with range 0 - so that the tile sets its name - or some other value - as a property in the instigating piece.
Also note the attribute Key Command to apply to all units ending movement on this map of a Map. The key can look for the current tile it is sitting on top of, and then Attachment to the tile, for example.
Note that Attachments and Mat ⇆ Mat Cargo are very different. Attachements does not imply that units are moved togehter, for example, and access to attached pieces’ properties etc. are fast.
The right solution depends very much on what it is you are trying to accomplish.
Remember to click-off the solution when one is made. That helps others to possibly find the solution to their problems. Only you, as OP, can do that.
Ha, so I replied twice to the same question without noticing. I’m just happy that the answers are somewhat consistent Looking back, I think I was a little wrong about the grid in a zone rather than on the board. If the grid is in a zone, I believe - but someone correct me if I’m wrong - then I believe that grid is used for the measurement.
A good idea before posing a question, is to search the forum (using the button) for related messages - e.g., “GKC Range”, or “Global Key Command Range”. Also, this kind of question should go in the Module Design sub-forum - which is for questions on designing modules, not the Technical Support & Bugs sub-forum which are for technical questions or bugs related to running Vassal (check the pinned comments in each sub-forum, as well as How to report problems).
Please remember to mark the solution to both this thread and your previous thread. That really helps others - and in this case yourself - find the solution to their problems. Only you, as OP, can do that.
Search? READ?! Why I can’t be bothered…Who do you think…I’m too important to…Harumph!!!
I find that I always have best intentions to write lucid, intelligent posts, and it seems I too often end up looking like a dope. I know what you all are saying. “What’s wrong with you? Did your mother drop you on your head as a baby? What?”
Man, this implementation of range seems like a real rat’s nest nightmare. If it were me, it would have been pixels, and you’ll eat what’s in front of you. I can see this albatross hanging over the author’s neck for the rest of his life–patching here, pasting there.
I always set it to zero, but I could see trying out say “3” for example. Then something wouldn’t work right, and I’d report it in the the forum. I picture the author’s shoulders slumping, and he’d be burying his face in his hands. Then he would vanish. A couple weeks later I’d get a postcard from Bora Bora. There he’d be under a palm tree and stretched out in a deck chair. He’d have a fruity umrella drink in one hand, and the other would be giving me the finger.
I have used mats successfully for this function in the past. In my current vmod, the game has large landscape tiles that form the map. In builder mode, a user builds a mission by arranging, rotating, and shifting landscape tiles and then placing other pieces atop them. He presses a “I’m done” when finished. This glues the tiles to the board, and all those build commands are gone. I use a technique I call “glass lids” to do this, but that’s another topic.
At first the mission builder would have to drag pieces from the piece palette to put atop the landscapes, but I thought it would be much more convenient if he could right-click any landscape and get the most common ones via the “place marker” trait. This worked, BUT there were problems. The new piece would be selected but so would all other new pieces and the landscape, so if I wanted to rotate my last piece, ALL would rotate including the landscape. If I moved one piece, ALL would move. This was not acceptable, so I dumped the mats.