Looking for Guidance

If the markers aren’t limited, you can place them in a hidden Game Piece Palette and have them drawn directly to the relevant card via right-click Place Marker trait. Either way, the markers themselves would have a Does Not Stack trait, with the ignore map grid box checked. That and the higher map layer you mentioned will keep them moving freely above the cards.

If both card and marker are moving around though, then having the individual marker instead be a Layer trait on the card generally works better. Players wouldn’t be able to move them then of course, but if the ideal placement above the card depends on the type of card, you could always make different types of Layer traits (with different placements) depending on those card types.

I’ll need to go over the second post again a bit later, sorry. I know you definitely don’t want the $$ with the new code, but w/o (which you tried) looks okay to me. Anyway, it might be easier for me to go through it with test mod, so I’ll report back (and others are welcome to weigh in too, of course, if anything jumps out). Oh, btw, this probably isn’t the problem, but when using commands like CTRL P, be sure not to type them out or copy and paste 'em if that’s even possible (it’d of course be ctrl button P only).

I don’t understand sendcard3. I think I need to know how the secondary cards are played in the game. Are they handled at the same time as the Primary cards, and where are they placed (directly below each same side’s primary card)?

If they’re placed at the same time, then I’d suggest having the primary cards themselves send for the secondary cards when they hit the main board (using your “end movement” gkc that clears the selection layer). They can be sent to primary card’s exact location + whatever additional Y to set them below, for example.

Awesome, so I was just missing the Does Not Stack trait. It works great now. Just leaving it manual saves me a lot of work haha, since there are different variations to the cards. I had considered the Layer method.

No rush on figuring it out. Since the cards will not be in a particular side order (arranged by Value), my idea was to tie the Send action to the card being sent at that moment, or even send all the secondaries separately afterward. Either way I need some way to find/compare to the Primary card, which is why I have the Marker “CardSide”. Maybe there is a better solution.

I imitated the coding I have set up in the previous module you sent. It usually makes more sense when you see something.

I missed your reply because I was replying myself haha. The “sendcard3” was just continuing your naming conventions for the key commands. Hopefully, it is more apparent if you look at the uploaded module.

You are correct, they will be displayed directly under their respective Primary cards. Whether they are placed as part of the Primary placement loop or afterward/separately, is not important. To me, it makes more sense for the Primary cards to send for them, as you suggest. I would prefer that as well, so that all the cards are in place when the loop finishes and it is not two separate steps. The end movement command is a good idea to simply things.

Let me give an example that might help. Red, Blue, and Purple are playing. They choose Primary cards with Values 15, 10, and 20. The Secondary values are irrelevant. The order of the cards would be Blue 10, Red 15, and Purple 20 in locations 1, 2, and 3. We have this portion of the coding completed. Now to place the Secondary cards. The way I have the grid set up is: 1, 2, 3, 4 with 21, 22, 23, 24 directly under them. The question is: how do I tell the Blue Secondary card to Send to Location 21, the Red Secondary to 22, and the Purple Secondary to 23?

In my head, it should be as simple as: property match Marker from piece in location x (or piece just sent) and Send to location x + y.

Right. For your CardSide property, which is a good idea, you won’t want that Side value global. Vassal has its own PlayerSide property, but I’m not sure if it’s retained after all the primary cards are sent to the main board by one player. So I’d suggest keeping your CardSide idea and making it either a Marker trait or Dynamic Property trait (in all primary and secondary cards).

Use the Marker trait, CardSide=Blue, if all players have only their own cards to choose from (I don’t remember if this is true or not). You’d make a prototype for the blue player and put that marker in all the cards (primary and secondary) belonging to that player. But if any cards are mixed up among the players (so a particular primary type card, for example, may go to any player), then make CardSide a dynamic property instead and tie it to the same key command that handles the cardselect dynamic property. So you’d have dynamic property CardSide, no menu command, key command being the same one that cardselect uses, assign value directly: $PlayerSide$… so when Blue player chooses primary and secondary cards, they also make CardSide=Blue for both of those cards.

For sending the secondary cards… say Blue Primary card hits region 1 and gets sent your “ends movement” gkc from the board (I’ll call it: mainmapGKC). You want that to also trigger a GKC trait in the cards’ prototype – unless the card moves around the board later and you don’t want it firing every time, then you’d use a trigger action with an appropriate matching property to limit it to firing only once (LocationName=~1|2|3|4&&CurrentBoard!=$OldBoard$) – otherwise just have it fire the GKC trait directly.

So the GKC trait has no command name, keyboard command: mainmapGKC, gkc: sendSecondary, matching properties: CurrentBoard=~P1|P2|P3|P4&&CardSide=$CardSide$&&cardselect=Secondary [substituting P1 etc for your actual player board names of course].

Then the Send to Location in the secondary cards’ prototype will have no command name, keyboard command: sendSecondary, destination: Another counter selected by properties, property match: CurrentBoard=[TheNameOfYourMainMapBoard]&&LocationName=~1|2|3|4&&CardSide=$CardSide$, then check Adv Options too and additional Y offset: [difference between region 1 and region 21] times 1.

Hope that works.

All players can only choose their own cards, as you mentioned. CardSide is a Marker value that is in the Prototype for each individual player side (every Blue card has CardSide=Blue, etc.). The properties for selected Blue cards would be cardselect=Primary/Secondary and CardSide=Blue.

Your idea made a lot of sense to me. I created a GKC in the prototype (same place as all the Primary Send stuff) with keyboard command CTRL 3 (your mainmapGKC), and created the Send to Location. I do not see it being a problem so I avoided the trigger action for now. The first couple times I tried I got an infinite loop on the Secondary GKC. I have gotten a couple bad data errors, but mostly the card just doesn’t move.

I have tried all kind of variations of the matching properties. I started with CurrentBoard!=Gameboard (main map), then moved on to your syntax, only putting in the player board I was trying it on, then tried directly == with quotations. I have tried CardSide with and without $. I even tried $PlayerSide$ instead of $CardSide$. I added and removed quotation marks in different places. I initially tried my own Send to Location, but tried yours as well when it didn’t work.

I have tried everything and the card does not move.

Test these problems when you get 'em step by step. For example, with this one I’d start by deleting the gkc trait that is sent by the primary cards to the secondary cards (the one triggered by the CTRL 3 board command). Delete it - you don’t want it anymore. Now make a new one with one matching property only: cardselect==“Secondary”. So that has keyboard command CTRL 3 and sends gkc: sendSecondary.

Now ensure all prototyped secondary type cards are inactive (so none being cardselected as secondary). Then make a new test secondary card on Blue’s player window, but with no prototypes in it, adding only a Blue CardSide marker and the cardselect dynamic property already set to Secondary. Then add a report action in it set to trigger with sendSecondary, reporting something like “sendSecondary triggered”.

Run that. It should report with however many primary cards were sent (regardless of side). If it’s an infinte loop, then something’s causing your CTRL 3 board trigger to repeat. But hopefully if you ran 3 primary cards it reported 3 times.

Now add to the primary cards’ CTRL 3 triggered gkc trait, the matching property: cardselect==“Secondary”&&CardSide==CardSide. Run it again with a couple primary cards, but only one blue primary card. “sendSecondary triggered” should now only report once (if I have that new code right!).

When you do get this properly working, then add a Send to Location trait triggered by sendSecondary and have to move the test card to the main board somewhere. Run that. Then try fine tuning that to get it sent to the Blue Primary cards’ actual location (destination: Another counter selected by properties, property match: CurrentBoard=Gameboard&&LocationName=~1|2|3|4&&CardSide=$CardSide$. [I don’t know how to write out =~ expressions with the new code – so LocationName=~1|2|3|4 for example (other than to write it out four complete times instead and group all those in a parenthesis, so like (LocationName==1 || LocationName==2) etc – but there must be a shorter way), so I’ll have to use the old code on this one.]

Any problems along the way, double check that I didn’t make a mistake above, check for typos, and things like using the board name and not the map name, etc, etc. And then just keep adding… so get it sent below the blue primary next, then perhaps start moving these over the secondary cards’ actual prototype, and slowly get all the card sides working.

Let me know.

All right. Got it working…maybe haha, but it’s a start. I finally had some time to do more iterative testing. I basically started from scratch and slowly built as I tested. I ended up with the exact same structure as the Primary components. Currently:

Main “Reveal” action button runs additional hotkey (called it runCS)
Hotkey triggers module level gkc with properties {cardselect==“Secondary”}
Module gkc triggers a trigger action (maybe unnecessary?), which triggers a prototype level gkc
Prototype level GKC has matching properties {CardSide==$CardSide$} and triggers Send to Location
Send to location is set to map region {$PrimaryLocation$+20}

At this point, the Secondary card is sent to the first location. I will have to test it with multiple sides to see how that plays out. When I select multiple Secondary cards, all of them are sent to location 1, because it sends all Secondary cards with matching side. I will have to test more. It’s so close! Thank you again for all your help. I will let you know how it turns out.

I tested the game with multiple sides and it did not work. For some reason, the Primary portion would work fine if I only selected Primary cards. When I selected a Primary and Secondary from each side, every card in the game (all sides) was sent to the first Secondary location.

I then changed a few things around and got rid of the gkc I questioned above. I think I might have it working. I was trying to use your idea of “Another counter selected by properties” in the Send to Location action. As it stands, the Secondary card always appears on top of the Primary card. After a few tries, I went back into the Send to Location trait and realized there was no offset (even though I set one). I continuously closed and reopened the trait. Every time I checked the box, put in an offset, and hit ok, it reset back to no offset (advanced options unchecked). When I check the box, my offset settings are still retained (values are filled in correctly).

Any thoughts on this? All I need is to get this offset working and I think I’ve got it.

Sorry for the delay, yeah, it unchecks for me too, but the info inside still works. Make sure you still have a region for the card to go to (or it may snap up to the closest one available) and your Y difference is correct (probably like 500 or more, depending on card size).

Additional Y: 500 times 1

Looks like you were right. I made sure the “snap to grid” was checked and added a few more pixels to the offset and it works. Now, the secondary cards both (I am testing with two sides) go to location 21 (the correct location for the first secondary card). However, I get this message in the chat window:

Bad Data in Module: Expression evaluation error Expression={(CurrentBoard==“Gameboard”) && (LocationName==1||2||3||4) && (CardSide==$CardSide$)}, Error= inline evaluation of: ``_xyzzy=_plugh();’’ internal Error: Unimplemented binary String operator

This expression is the counter properties expression in the Send to Location trait. I was not sure what the binary string operator was referring to, so I deleted the quotation marks around gameboard. Without quotations, none of the secondary cards are sent anywhere. Does it have something to do with the location being an OR function and not a specific place?

I’m not sure how that’s properly written out with the newer expressions, sorry. Here’s the old expression if you don’t mind using it:

CurrentBoard=Gameboard&&LocationName=~1|2|3|4&&CardSide=$CardSide$

Hope that helps.

I tried the old expression and the secondary card does not move (I only tried with one side). I think the problem could be that the secondary is part of the loop. It might be better to either have a whole separate set of actions for sending the secondary cards, or add a trigger action for when a card is in location 1, 2, 3, or 4. If a trigger action had a matching property of one of those location names, the primary card could “pull” it’s secondary into place. Either way I would end up using the same send to location syntax, but maybe one of these ways will work.

Yes, I thought I’d mentioned that but maybe I didn’t or didn’t do so clearly. Sorry about that. But yeah the secondary actions should not be part of the loop; they should be triggered solely by the primary cards hitting the main board. CTRL 3 (board ‘end movement’ gkc) tells the primary card to send for its secondary card… the “Reveal” loop button is used solely for the primary cards.

And make sure the Send to Location in the secondary cards is below any markers in trait order. So below CardSide and the “secondary” designation (forget the name of that dynamic property at the moment).

I added a secondary card to the primary test mod. I only added one player color (blue) as I only had the one player board (P2) already made up. I only quickly tested it, and again only with the one player board, so any problems or questions when expanding it, feel free to let me know. Sorry again about not being clear re its trigger.

Thanks for throwing that together. Yours looks like it works no problem. I went through and copied everything. I changed the board names from P1, P2, etc. It still does not work. I honestly do not know what is wrong. I went through and made sure all of the trait orders matched. I literally copy and pasted your syntax for the send to location and gkc related to the secondary. The primary card works flawlessly. I’ve got all the resets programmed so I can run the Primary over and over again without issue. The secondary will still not even move though. Any suggestions as to how I could figure out where it is failing? This is getting slightly frustrating.

Out of curiosity couldn’t you clean up the code a little bit and say CurrentBoard!~Gameboard instead of CurrentBoard=~P1|P2|P3|P4 ?

Yeah, I hear you. Sometimes it’s like HAL’s just sitting there saying, “Sorry, Dave, I’m afraid that’s not it either.”

You said you changed your board names to P1 etc… double check it was a board name change and not the map name. Double check that any pieces already added to those boards (cards/decks, etc) belong to those new board names (via at-start stack properties or deck properties, etc).

Another thing I’d check again is instances of CTRL 3 (your map-based GKC)… make sure you’re using ctrl button 3 for the keyboard command (in the primary cards’ gkc trait that sends for the secondary cards) and not typing in CTRL 3. Then make sure it’s ctrl button 3 for the map too.

Then I’d add a test Report Action (reporting “primary cards”) triggered by CTRL 3 and add it to your primary cards, then add a test report action “secondary cards” triggered by sendSecondary and place that one in your secondary cards’ prototype. Run that. If the CTRL 3 trigger report action didn’t fire once for each primary card hitting the main map, then something’s wrong there. If it did, and the “sendSecondary” report action didn’t fire, then something’s wrong with the primary’s gkc trait that sends for them. If both fired, then something’s wrong with the secondary cards getting the message to move but not moving.

Hopefully that will narrow the problem down. You can also eliminate the matching properties on some of these traits and add 'em back in one by one.

And yeah you could use CurrentBoard!~Gameboard instead, or even remove that part altogether if it doesn’t matter.

Good luck!

I have only had a small amount of time to do some testing. I know that the CTRL 3’s are all control plus 3 and not typed, especially since the Primarys are working. Once I have time I am going to sit down and work step by step.

One problem I have had since the beginning is a lot of my Report Actions do not seem to work, and I do not know why. For example, if I put an Action using CTRL 3 like you suggested, nothing happens when I manually change the card or when the Primary transfer clears them. Does the report action need to be below cardselect in the trait list?

Another question along the same lines is: should all of the secondary actions occur below the primary actions in the trait list?

I don’t know why your Report Action is failing to trigger. It shouldn’t matter where it is in trait order, a RA watching for CTRL 3 should report that when it occurs. When you say this doesn’t happen when you manually change the card yourself, I presume you have a “cleared” cardselect status that operates on a key command of CTRL 3… so you manually trigger that yourself, successfully, but still the RA doesn’t note anything? I just don’t understand it, sorry.

I didn’t realize the primary and secondary cards would be the same cards, but don’t see any problems combining their traits, and don’t believe the trait order between the two would matter (apart from making sure the Send to Location to send secondary cards is below any markers, like CardSide).

I might try adding a few things to that test mod I’d used before just to see if we can figure this out.

All right. I think I got it working. I started from scratch and took it one step at a time. I got the card to send to a specific location on the main board, then I switched to “another counter” and used the specific “BasicName” of the Primary card to send it on top of the card (same location as Primary). At this point (fingers crossed), it seems to be working. I will just need to test it with multiple sides over the weekend.

The interesting thing that I discovered by starting extremely basic is that the changes I made to the Send to Location trait were not carried over to the game immediately. I would make a change, open a new game, and it wouldn’t work. I was at a point in the beginning where I was like “Ok, I KNOW this should be working”. I saved the module, closed it, reopened it, and it worked just fine. I have been doing that with every change at this point, just to be sure. I’m wondering if I had everything right at some point but I thought it wasn’t working.