noob help please

Yes; use a GKC. ;-)

My point about the GKC was, your map is sending a keystroke to your piece, not the map itself. So you need to have something on the piece that listens to CTRL-SHIFT-1, not on the map. You can have the piece immediately fire a global hotkey to the map if you want, or you can have it fire a GKC to all the other pieces, whatever, but it needs to have something listening for CTRL-SHIFT-1. Here’s what I would do for your situation:

Map:
Key command to all pieces ending movement blah blah: Trigger

Card prototype:
Trigger Action: Sequence GoTo_FirstPosition/SetCalling/GKC_ToOthers_MoveRight/UnsetCalling
Keystroke: Trigger
When properties match: CurrentMap = $playerSide$ Hand && OldMap != $CurrentMap$
Perform these keystrokes:
GoTo_FirstPosition
SetCalling
GKC_ToOthers_MoveRight
UnsetCalling

Send To Location
Key command: GoTo_FirstPosition
Map:
Board:
X: 130 (or whatever)
Y: 130 (or whatever - better, define a named region using a, what ‘irregular grid’ on your board - then it’s more obvious where people should look to change this value)

Dynamic Property: calling
Default: false
Set value directly: ‘true’, SetCalling
Set value directly: ‘false’, UnsetCalling

Global Key Command
Keyboard command: GKC_ToOthers_MoveRight
Global key command: Trigger_MoveRight
Matching properties: calling != true

Move fixed distance
Keystroke: Trigger_MoveRight
Distance to the right: 255
UNCHECK Move entire stack


Substitute whatever keystrokes you want for any of the named keystrokes, if you want to keep using Vassal 3.1.x.  What the above should do is send any card newly moved to the player hand window to the coordinates specified, and then moves all other pieces right by 255 pixels.  There are some problems with this.  What prevents your players from moving cards around themselves?  They may find it very frustrating that their cards keep shifting to the right when they want them organized top to bottom, for example.  Beware the dark, dark path of automation!

-Seth

Thanks a ton Seth. You’re my hero.

I have quite a busy afternoon planned, so will play around with this later when I get a chance.

I know exactly what you mean about the automation issue. I think later perhaps I will rethink the whole system, I really just wanted to get rid of the auto-stacking problem before I start testing the game itself.

Thanks again

Well this is embarrassing. Turns out the player hand tends to behave pretty much how I wanted to by default. The cards I was using had the “Does not stack” trait, simply to avoid snapping to grid. I never realised that with that trait deleted the cards would spread out automatically if i changed my stacking options. That aside, I’ve learned a lot along the way and I’m getting a bit more ambitious!

I’m wondering if there’s a way to remove a ‘right click’ function from a list when a card is face down. Anyone know?

I have a card, which when right clicked has an option “Trade”, and the action works fine, however I only want the “Trade” effect to show up when the card is face-up (so players cant tell its tradable when face-down). Trade is a trigger btw.

I figured it might be something to do with the order of traits, specifically “Mask” and ‘Trade’, however the Mask trait is in one prototype, and the Trigger (Trade) is in another prototype. Changing the order of the two prototypes on the item just moves the position of “Trade” in the right click menu.

I also tried having the trigger only work when certain properties match, eg the card being face-up, but that just grays out the “Trade” option when the card is face-down, so it’s still obvious the card is tradable.

Sure. Mask includes a property called ObscuredToOthers, and this has a value of ‘true’ when the masked piece is face down. So add a Restrict Commands trait and set the property to ObscuredToOthers = true, and for the command to restrict, use the keyboard shortcut for Trade. (Make sure Restrict Commands is beneath the Trade and Mask commands in the list of traits.)

Perfect, thank you very much.

Soooo… I’m back :smiley:

Where on earth would I implement some basic property calculations in Vassal?

I have a deck, where the number of cards in the deck represents the player’s “Power” and I want the user to be able to ‘spend’ the Power (and refresh it).

I have a property expression counter on the deck, which displays the number of cards in the deck (ie Max Power). Then created a Global Property “Power” with default value = $PowerDeck_count$, but this just sets the initial value to "$PowerDeck_count$ in text form even when i try to make it numeric.

So I figured instead have a “PowerSpent” property, with inital value zero, which increments by 1 every time the “Spend Power” command is used (and resetting to 0 when the “Refresh Power” command used. Then just have the text label display “$PowerDeck_count$-$PowerSpent$ of $PowerDeck_count$” where it applies the minus function to the value returned. Thus if Power was at 10, and 1 was spent, the label would read “9 of 10”

I also tried to have the Global Command window perform calculations there for a further property, but it also just ignores my maths expressions

Mr. b0n3r,
This is pretty hard to do in Vassal 3.1. Vassal 3.2 includes support for mathematical expressions through its Beanshell support. In 3.1, to subtract one number from another, the only method I know of is to use a loop, decrementing both values until the one reaches zero.
What about your original idea, however?

  1. The correct property name is probably ‘PowerDeck_numPieces’.

  2. It may not be initialized before the ‘default value’ of your property is evaluated, so it may initially still show as text. Resetting it any time after startup should work, however.

    Also, I don’t know about anyone else but I feel like it would be better to see new questions in new threads, to make searching easier in the future. I realize I’m picking on you at random, as there have been a number of very long threads recently. I’m no etiquette expert, so I apologize if I’m just being silly.

-Seth

If you know that the result of the subtraction will be non-negative, another method would be to create an invisible piece and use Send to Location to move it to, say, (0,$FirstNumber$). In the Advanced Options, your Additional Y Offset would be -1 and the “times” value would be $SecondNumber$. Then have your invisible piece update a ‘Result’ global property with its CurrentY value. (You could also perform multiplication in this way.)

Negative results probably could be accommodated by using a bias on the Y coordinate, the negative of which you have already stored in another global property; for example, a ‘SubtractionBias’ GP that’s set to -10000. In this case, you would first do a Send to Location to (0,10000) with no advanced options, then perform a Move Fixed Distance of (0,$FirstNumber$) with the Advanced Options on the Y coordinate of -1 and $SecondNumber$ as described above. After setting your ‘Result’ GP equal to $CurrentY$, you would then de-bias it by Incrementing it by $SubtractionBias$.

But really, though, all of this is duck-tape abuse of the Vassal engine. Personally I’d rather be patient for the stable production release of 3.2 and just use BeanShell to do the math.