Looking for Guidance

I found the deep end quickly haha. I will try to explain my idea in words and then I’ll provide the properties, key commands, etc. and hopefully you can point me in the right direction. I’m still struggling with how this program structures things. I am not sure if certain properties need to be at a module level, board level, or hand level, or if it matters. Watching for keystrokes is also very foreign.

At the bottom of pg 78 there is a section titled “Dealing Random Cards to a Board”. I successfully modified it to get the hand draw squared away. Property related to irregular grid is incremented, combined with Send to Location. I’m now trying to use a similar idea to execute the “reveal”, trying to add on the Value component. Here’s the idea: A button on the main map toolbar triggers all cards with “Primary” values (from all Player Hand windows) to be sent to 1 of 4 locations on the main board, in order. The order is determined by a Marker value property on each card called Value. I have a separate property called ValueCheck that loops from 0 - 99. When Value == ValueCheck, the card is sent to location 1 and the location value increments by 1. This way the next card will go to location 2 once Value == ValueCheck again. When the loop completes, all 4 (or less) cards should be on the main board in order from least to greatest. That’s my idea, but the execution was wrong some how, because literally nothing happens when the button is pressed. There is a couple second pause as if it’s executing the loop or something, but nothing else.

Here is the setup from the bottom up:

Irregular grid on main board with Regions 1 - 4, Global Properties on main board: PrimaryLocation (1-4) and ValueCheck (0-99)

All of these traits are housed in a Prototype called “Reveal” that is applied to all cards (traits in order from bottom to top):
-Trigger Action called Value Loop: Watches for CTRL P, Performs SHIFT I, Repeat keystrokes true, fixed number 99, perform ALT CTRL R when loop completes, create loop index property named ValueCheck start 0 increment 1

-GKC called Value Check: global key command SHIFT I, matching properties {Value == $ValueCheck$}

-Send to Location: keyboard command SHIFT I, region on selected map - main board, region name: $PrimaryLocation$

-Set Global Property: Property Name PrimaryLocation, named map - main board, 0-4, SHIFT I increment numeric value by 1

-Trigger Action called Reset Primary: watch for ALT CTRL R, perform CTRL V

-Set Global Property: CTRL V sets PrimaryLocation to 0

All ties to module level GKC with key command CTRL P, matching properties {$cardselect$ == Primary}

I feel like my idea/plan is solid, but I might have things in the wrong place or maybe missing something. I suppose I need to include something to reset the ValueCheck value, but that is minor. I have tried to include Report Actions to monitor where things go wrong, but nothing is reported, moved, or changed when I press the GKC. Any help is much appreciated!

Ah, found the example on a different page - I might have an old copy.

There’s a couple things that stand out immediately, so I’ll hit those and then take a closer look. One is you’ve got a global property called ValueCheck, as well as a loop (non-global) property of the same name. I’ll have to look at what you’re doing with those, but if you’re using the loop property as a global counter then that will need redoing.

Secondly, clear the “named map” space and then re-set the “Locate property starting in” section of your Set Global Property for PrimaryLocation as: Current Zone/CurrentMap/Module. Your limiting it to the main map might be correct, but I’ve never changed the default and never had a problem with it.

Lastly, you’re mixing the old expressions with the new ones. The $$ are not used in the newer expressions.
{Value==ValueCheck}
{cardselect == “Primary”}

I’ll need to pause there for a moment and then take another look at it. Coding is tough to follow sometimes (actually more than sometimes, at least for me). :smiley:

Just a quick add to the previous… if the trigger action with the (non-global) looping ValueCheck property is in the same prototype or trait window as where it is used (and it’s not used anywhere else), then try deleting the global property of it, make the other changes I listed above, and then try it.

I’ll have a closer look again at all of it as soon as I can anyway…

Here are the changes I made:
I deleted global property ValueCheck.
Changed Send to Location to “Current Zone”.
Moved PrimaryLocation to be a module level global, since it actually got far enough to give me an error message.
Result: Every card in the game (all decks, even sides not playing) except Primary cards were moved to location 4 in one giant stack.

I then went back and removed the dollar signs from the main GKC and the Value Check GKC, and tried again.
Result: Exact same.

I then went back and noticed your quotation marks around Primary. I added the quotes.
Result: Only the Primary cards were sent to the main board, but all in a stack at location 4.

I moved the Send to Location above the Set Global - Primary in the trait list.
Result: Primary cards all went to location 4, but they were in the correct order (highest on top).

They were sent there in the right order. This means that the only problem is the PrimaryLocation incrementing. I think it has something to do with the fact that it increments on SHIFT I (every loop increment) rather than only when a card is sent or Value = ValueCheck. As such, it is already at 4 when it reaches the lowest card (have been using Value 4 by chance).

Thank you again for all your help. I’m so close now!

Hm, I don’t understand the Send to Location change (from $PrimaryLocation$ to “Current Zone”). I’d think the latter would not send any cards anywhere, but you’re reporting they are moving.

I think one problem is that the trigger action and its ValueCheck looping is happening with each Primary card… it should just happen once. My suggestion is to make new copy (new version #) of your module to work on from here (so you have the current one to quickly fall back on if necessary), then try the following…


Add ValueCheck back as a global property (numeric 0-99). Right-click on it when done and add a change button to it (no button text, hotkey: runVC, increment by 1)

Clear the button text of your main toolbar gkc button that sends CTRL P (so like the previous, the button itself should not be visible in the main toolbar window) and then add a hotkey: runCP

Add an action button to main toolbar, button text: (the former text of the above gkc button that you cleared), send hotkeys: runVC and runCP, loop fixed: 99 times

Delete your old trigger action from the cards’ prototype. Add a new trigger action with matching properties: Value=$ValueCheck$&&cardselect=Primary. I prefer the old expressions but new should be: {Value==ValueCheck&&cardselect==“Primary”}. Probably best to stick with the new ones, but… :smiley:. No commands, watches: CTRL P, performs: sendcard1 and sendcard2, in that order.

delete the “Value Check” gkc in the prototype.

In the Set Global Property (PrimaryLocation), change SHIFT I to sendcard1

In Send to Location, change SHIFT I to sendcard2, region on selected map - main board, region name: $PrimaryLocation$

I won’t worry about re-setting those values right now… I probably missed something anyway… but try the above and see what happens. If it doesn’t work, try adding test Report Actions in the prototype to see what is triggering… like a Report Action that reports on CTRL P and prints: ValueCheck=$ValueCheck$, PrimaryLocation=$PrimaryLocation$, etc.

No luck. Made all the changes. The runVC loop works great, runs from 0 to 99 when I put in a report. Primary Location is never incremented and no cards are sent any where. I made a report action and it stays the same value for PrimaryLocation the whole loop.

What is the purpose of having a GKC with matching property set to {cardselect == “Primary”} and runCP hotkey? Shouldn’t the trigger action do all the work if it watches for runCP and has the matching properties as above?

I see the logic behind it all and it makes way more sense that I can name my own operations instead of being tied down to keyboard inputs. I just think the trigger action is the problem at this point.

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.