Including Chart Window in a Pre-Defined Setup

I’m developing a module which has 4 scenarios. Each scenario uses a different map with at-start pieces. Each map also has a related Chart Window (which includes both charts and maps unique to a given map).

My question is how can I ‘package up’ each map along with its associated Chart Window so that on selection at start-up only the selected map and accompanying chart window is displayed and accessible to the user? There doesn’t appear to be any way to do this using Pre-Defined Setups unless I’m missing something. Any help would be appreciated.

P.S. I have spent some time looking through the forum topics but have not found an answer to this question so far!

You can certainly hide those maps and chart windows from players - by devising a front end set up structure, likely mediated through global properties. There will need to be some kind of trigger system that hides/shows only the map that you want displayed.

Have you tried anything like that yet?

PS Nice to see that modified C&C Napoleonics British Rifles as your avatar!

I know of two ways to do this, and I doubt you will like either.

First one. I expand on what Mark said. Create two separate hidden Chart windows. How do you make them hidden? Leave the command and icon fields blank but still give it a command to activate. You will need a unique command for each because if you don’t (e.g. alt-C), the command will open both. I suggest you define command strings instead of command keys to prevent accidental opening of these windows.

You will probably need a module-level GKC. It won’t directly open a chart, but it sends a GKC to a piece (a proxy) who handles it. The piece knows which window to open, and it does it via a hot key trait.

Second one. You make a gigantic piece that sits in a normal window. You create a Layer trait. You make two big images that each contain a chart. You stick them in the piece, one or both in the Layer trait, depending on how you want to do it. You display the correct chart by showing a Layer trait level.

Thanks for the reply and your suggestion. I hadn’t thought of that approach. I will have to dig a bit deeper and do some experimentation to see how this might work.

As far as the avatar is concerned, I’m a fan of both C&C Napoleonics and the Bernard Cornwell Sharpe series of books so I thought I would combine them together!

Thank you shilinski for adding to Mark’s suggestion. I think I understand both approaches you mention for solving this. I will attempt to implement the first suggestion (as it seems less contrived than the second approach). My problem may be getting the actual implementation right however! I have used Global Key Commands, but not at the module level before. Also I will need some way of identifying which map the user selected during start-up.

Define a module a la

Now when you load the module and start a new game, you will be prompted for a board for the map Main and a board for map Charts. Choose one of the boards for each map (A or B for Main, C or D for Charts).

When the module has started up, place your pieces as needed. Then say FileSave game … and save the setup as say AC.vsav. Repeat for all the set-ups you want.

Now re-open the module in the editor, and add to the module

Now save the module.

Next time you open the module, you will be prompted for a set-up. If you choose New..., then you will again be prompted for choices of boards for each of the maps.

If you choose the setup AB, then the AB.vsav will be read from the module, and the boards will have been chosen - including any other set-up you may have done.

If you choose the setup BD, then the BD.vsav is read instead, and the board and other set-up done by that save.

Yours,
Christian

Thanks Christian for your very detailed process and explanation, and for all the replies by others on this thread so far. All contributions have been very helpful and hopefully will point me in the right direction. It’s great to be able to pick the brains of others who understand Vassal module design a lot better than me! Regards, Rob.

Thank you Mark, Stan and Christian for your replies. I have now got this to work thanks mainly to Christian’s suggestions, however I have one remaining problem which I am struggling to fix.

Of the four map boards, three use a horizontal hex grain and one uses a vertical hex grain, so depending on the selected board, piece rotation to face a side (not corner) needs to be adjusted according to the hex grain. I have a Game Piece Prototype called ‘Rotation’ which uses 12 as the number of allowable facings along with Trigger Actions to rotate pieces (clock & anti-clock) by two steps at a time, with the initial rotation position incremented by 1 if the board grain is horizontal. This worked fine when I had each board in a separate map window, but now the four boards are in the same map window and I am struggling to make the Vassal engine aware of the currently selected board so that the correct starting rotation offset can be applied.

Any suggestions on how to overcome this problem would be greatly appreciated. I’m so close to getting this module sorted!

If I understand you correctly, but please correct me if I’m wrong, you have

  • Boards A, B, and C have horizontal “columns” (in Vassal parlance)
  • Boards D has vertical “columns” (in Vassal parlance)
  • For different scenarios,
    • you choose different boards among these 4 boards.
    • you set-up pieces on the chosen boards according to the scenario.
    • you then save the set-up to a .vsav which you put back in the module as a Predefined Setup

Now, your challenge is, that when you set-up pieces on some of the boards, they need to be turned 90° to fit the grain of the board.

To do that, you simply rotate (or any other change, like flipping, annotations, etc.) the pieces you put on the board before you save the set-up to the .vsav file.

Incidentally, a similar strategy can be used with pieces in an At-Start Stack. Open the At-Start Stack editor, choose Reposition Stack. In the window that pops up you can rotate and otherwise change the state of the pieces. This is because the pieces added in an At-Start Stack are really not the same pieces as those added in a Game Piece Palette - they are their own pieces with their own state.

If this is not what you want to accomplish, then perhaps you could make your module available so that we may better help.

Also, remember to mark the answer that best resolves your problem - it helps others find the solution to their problems.

Yours,
Christian

Hi Christian.

Thanks for replying so quickly. My solution was to create a second ‘Can Rotate’ trait in the Game Piece Prototype with just a Keystroke Command (using an obscure key combination) to rotate the piece directly by 30 degrees, then I used this in the setup of pieces for the vertical hex grain board to adjust them so that they then rotate correctly following the saving of the scenario. This works fine, so problem solved! Thanks for your help. I have marked your original reply as solving the problem that I opened this thread with.

Regards,

Rob