Create account / Log in

Looking for Guidance

Topics related to Vassal game modules.

Moderators: Tim M, uckelman

Re: Looking for Guidance

Postby rrvs » April 18th, 2017, 1:54 pm

Yeah, it can be. It should be somewhat fun though too hopefully. Don't worry about having a lot of this just done manually, btw, especially for a first version. Manually moving masked cards to the board to be revealed from there once all the cards have been placed works well too.

quiksilver3865 wrote:Is there a way to check the current players sides in the game? These cardstatus values would be used to move the cards, but they depend on the player side.

Do you mean the total # playing, or which specific sides/colors aren't being used? Can I ask where the cards are being placed? As I recall they're side by side, but is there specific spots for red's cards, for example? So there might be a gap in the layout if say Green is not being used? Or are they just placed side by side in an area, side/color notwithstanding.
rrvs
 
Posts: 175
Joined: May 20th, 2016, 1:17 pm

Re: Looking for Guidance

Postby quiksilver3865 » April 18th, 2017, 2:34 pm

It is definitely fun, slightly frustrating sometimes, but fun. Yeah, that's a good point, it can be manual at first.

To answer your question, I meant which sides are being used. Card placement is not associated with a side. I currently have a Marker trait called Value for each card. The Primary cards will have their Values compared and be placed in sequential order on the board, regardless of player side. For example, if Red, Blue, and Black are playing, they choose Primary cards of Values 10, 12, and 5 respectively. The lowest card (Black) would be placed in location 1, Red's 10 would be placed in location 2, and Blue's 12 in location 3.

Basically, the lowest card will be sent to a specific location with the other cards evenly spaced horizontally after it.

I might be over thinking this. Could I make a function that looks for any card labelled Primary (IF?), then send the lowest Value (Compare?) to a location and then iterates, with position incrementing, until no cards remain? This would eliminate the need to worry about which sides are playing and extra variables of PlayerSide_Primary.
quiksilver3865
 
Posts: 32
Joined: March 29th, 2017, 7:28 pm

Re: Looking for Guidance

Postby quiksilver3865 » April 18th, 2017, 5:01 pm

I actually found a good example of this on page 78 of the designer guide. Now I am thinking that I could send all the Primary cards to a hidden Primary deck and then deal them out as I mentioned above using a created Grid. Compared to the example I would need to make sure the hidden deck has Re-shuffle Never, and ensure the cards end up in numerical order.

I have also done a lot more reading of the designers guide. Things are making a little more sense. Correct me if I'm wrong, but it appears that this program operates mostly on keyboard inputs. If I need a button to do multiple things, I need to create separate "actions" for those multiple things (with different keyboard inputs), and the button simply executes those inputs.
quiksilver3865
 
Posts: 32
Joined: March 29th, 2017, 7:28 pm

Re: Looking for Guidance

Postby rrvs » April 18th, 2017, 9:23 pm

How about this... a gkc is sent to any card marked primary that has a value of 0 (or whatever's lowest). That card is sent to "location 1" + x (x is a numerical global that's currently 0 -- you'd use adv options in Send to Location trait: additional x offset = 100 (or whatever) times $yournumericalXglobal$). Then a gkc is sent to any card marked primary that has a value of 1... same thing: to location 1 + x. Then a gkc is sent to any card marked primary that has a value of 2... same thing: to location 1 +x. Now in the cards' prototype, if a card is sent via this command then it first incrementally adds 1 to your x global... so the third card sent would go to "location 1" + 100 pixels to the right times 2. The twelve or so gkc's can be housed (in the appropriate order) in a single multi-action button to be pressed when everyone's ready. The cards' set global trait (increments 1) and send to location trait (location 1 + x) can both have the same gkc that is sent to them (I think this might answer your last question). Try it first with the send to location trait below in trait order (your original "location 1" location might need to be -100 pixels to the left, depending on how the extras added).

The sent gkc can be written key command too. Not sure if that's worded correctly by me, as it's all still new to me really, but what I mean is instead of "CTRL C" being to sent to the cards, it can be "RunPrimaryCards" instead... and the RunPrimaryCards can trigger both the set global trait to raise the x value by 1, and the send to location trait too. Hope I understood your question okay.

This may have problems I'm not seeing at the moment... it's just off the top of my head... and might need work if two players can have the same value card. There's a chance though if 2 cards were the same value it'd add the additional x value to the second of 'em anyway, but depends on how it's run. I can't imagine it working perfectly if 3 or 4 players all had the same card value, but maybe. Anyway, try it if you think it might work for you.

There's newer more advance property expressions now, not detailed in the designer's guide. Not sure if they're in the online wiki, but under the Calculated Property trait, click Help then Expression Builder.
rrvs
 
Posts: 175
Joined: May 20th, 2016, 1:17 pm

Re: Looking for Guidance

Postby quiksilver3865 » April 20th, 2017, 1:46 pm

Right now I'm wading in from the stairs rather than jumping into the deep end haha. I have successfully adapted the example from the guide to draw a hand from the discard pile. As in the example, I have an irregular grid with a property that is incremented for each card drawn. The cards are drawn into their respective locations every time. I also added a trigger action that resets the property when the discard pile is empty. It works beautifully and I'm rather proud of myself :D

Now that I have gotten that set up, I'm going to attempt to combine those ideas with your suggestions, to get the "reveal" portion set up. I may keep my "ready" button idea, but only use it for the report. Once all players are ready, anyone can click the main toolbar button to reveal the cards on the main board.

It is entirely possible that two (or more) players could have the same value, though somewhat unlikely. That thought had not crossed my mind until now.

Progress!
quiksilver3865
 
Posts: 32
Joined: March 29th, 2017, 7:28 pm

Re: Looking for Guidance

Postby rrvs » April 21st, 2017, 12:13 pm

Cool! I couldn't find that example (pg 78?), but whatever works, definitely.
rrvs
 
Posts: 175
Joined: May 20th, 2016, 1:17 pm

Re: Looking for Guidance

Postby quiksilver3865 » April 21st, 2017, 3:04 pm

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!
quiksilver3865
 
Posts: 32
Joined: March 29th, 2017, 7:28 pm

Re: Looking for Guidance

Postby rrvs » April 22nd, 2017, 12:00 pm

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). :D
rrvs
 
Posts: 175
Joined: May 20th, 2016, 1:17 pm

Re: Looking for Guidance

Postby rrvs » April 22nd, 2017, 12:27 pm

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...
rrvs
 
Posts: 175
Joined: May 20th, 2016, 1:17 pm

Re: Looking for Guidance

Postby quiksilver3865 » April 22nd, 2017, 6:24 pm

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!
quiksilver3865
 
Posts: 32
Joined: March 29th, 2017, 7:28 pm

Re: Looking for Guidance

Postby rrvs » April 23rd, 2017, 1:38 pm

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... :D. 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.
rrvs
 
Posts: 175
Joined: May 20th, 2016, 1:17 pm

Re: Looking for Guidance

Postby quiksilver3865 » April 23rd, 2017, 8:11 pm

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.
quiksilver3865
 
Posts: 32
Joined: March 29th, 2017, 7:28 pm

Re: Looking for Guidance

Postby rrvs » April 23rd, 2017, 9:07 pm

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!
rrvs
 
Posts: 175
Joined: May 20th, 2016, 1:17 pm

Re: Looking for Guidance

Postby rrvs » April 24th, 2017, 1:26 pm

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.
rrvs
 
Posts: 175
Joined: May 20th, 2016, 1:17 pm

Re: Looking for Guidance

Postby quiksilver3865 » April 24th, 2017, 5:28 pm

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.
quiksilver3865
 
Posts: 32
Joined: March 29th, 2017, 7:28 pm

PreviousNext

Return to Module General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron