Looking for Guidance

Sorry it’s not working, but just have to keep at it. You’re right that I’d duplicated the {cardselect==“Primary”}, but shouldn’t matter. Actually, since I agree on the trigger action, I’d remove it from there right now, and then make sure the runCP CTRL P gkc is being sent to the correct four cards.

If so, then add 2 report actions set to trigger with sendcard1 and sendcard2 respectively and make sure those are firing. If those are firing then there’s no reason the Set Global Property isn’t firing. If those aren’t firing, double check the trigger action for any typos. If that checks out, then remove the matching property completely from the trigger action, and make sure it fires then. Once it fires with no matching property, put the matching property back in {Value==ValueCheck}. If it doesn’t fire with that back in, then double check both of those properties or rewrite it… Value=$ValueCheck$… maybe I have the new coding worded wrong.

Good luck!

If I’m not mistaken, I realized that the runCP (CTRL P sent) gkc could just use this as its matching property:

Value=$ValueCheck$&&cardselect=Primary

That drops the trigger action altogether, so switch the sendcard1 and sendcard2 commands (for Set Global Property and Send to Location) to CTRL P for both. There’s so much going on between each loop, it might really help to shorten it as much as possible.

If it still doesn’t work, change the ValueCheck change key to OFFrunVC and then change its initial value to a value of one of the four “cardselected” cards. Try that and see if it at least sends that one card okay w/o the looping process going on in the background.

I initially took off the cardselect=Primary from the gkc and it slowed the process down to a crawl for some reason, but no cards were moved. I had to wait a good minute or two for it to complete. I am not sure how to tell if the gkc is being sent to the correct cards.

I have double checked all of the spelling. I have gone back and changed the trigger to the “old” formatting. I have tried eliminating the cardselect=Primary from the trigger. I put in report actions for sendcard1 and sendcard2 and neither report anything.

I have tried all sorts of things and nothing seems to work. I have not had any cards move at all and the location does not increment. I might try going back to simple settings. Deconstruct everything (probably just remove hotkeys, not delete) until it is just send a Primary card to location 1 button. Then maybe create another global called ValueSet, which is just a constant set by me, and try sending Primary card with Value of 4,12, etc. to location 1. If I can get that to work reliably, it should be a small step to the increments.

I tried putting it together, thinking maybe something was getting lost in all the text… seems to work pretty good! Hope I did it as you initially envisioned it. Card 50 I placed in a hidden player window, as I wasn’t sure if sending commands to those was the problem. Anyway, it was a great idea you had for running it - hopefully this implements it.

Thank you so much for taking the time to make that. The solution (as usual) was quite simple. I changed the key command on the gkc to CTRL P. The hotkey from the button now activates the gkc with CTRL P key command. I tied CTRL P to the trigger action. I copy and pasted your property syntax into the gkc to make sure I didn’t mis-type anything, and took the “matching property” text out of the trigger action. I kept the “sendcard1” and “sendcard2” hotkeys as well.

Essentially all I did was add CTRL P to the gkc and trigger, along with changing some text. It works well now! I also added the “key command to apply to all units ending movement on this map” so that the label clears when the cards are sent. Thanks again for all your help. I am now going to test it over and over with different values, multiple sides, etc. to make sure I can’t break it haha.

I have one last, hopefully simple, question regarding pieces and probably layers. As I mentioned before, some cards will remain “active”, and have counters to mark how many times they have been used or how many turns they are in play. I currently have Markers called Card and Token. They are set in Game Piece Layers with Card above Token. I want the players to be able to drag the tokens and place them anywhere on the card face. Right now the token locks on top of the card in specific location. It is either in that specific location on the card face or off the card. Is there an easy way to remedy this so the Token movement/placement is unrestricted?

I thought I had the Secondary send set up correctly, but it turns out something is wrong. I think I just need to know the proper syntax. I set up the Secondary exactly like the Primary, using another gkc with hotkey “runCS”, which activates a trigger action that triggers a send to location, replacing CTRL P with CTRL S. The send to location is “sendcard3”. I set it up this way to have a different set of matching properties from the gkc.

I have a Marker called CardSide that denotes what side the card belongs to (maybe unnecessary?) for comparison. I was thinking I could send the card with cardselect=“Secondary” and CardSide equal to the previous card moved, but I am not sure how to articulate the second part. The Set Global Property, like the PrimaryLocation increment, changes to CardSide. The global is called SideCard, slightly confusing I know.

The gkc matching properties is {cardselect==“Secondary”&&CardSide==$SideCard$}, tried with and without dollar signs.

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).