Actions on player turn

So, I’m working on a module, that I figure to keep track of a bunch of derived values.

Fine enough, whip up a display where they can be shown, hook text labels up to them for display.

However, the values that control this can change a bunch during a turn, and the derived statistics are only evaluated/change at the start of that player’s turn.

Okay, set up a turn tracker, and have global triggers, one for each side, to go off at the start of each side’s turn.

Problem: Match Properties {Phase==“Move”} works; Match Properties {Side==“Black”} works. No variation of {Phase==“Move”&&Side==“Black”} works. (Does the turn tracker have this as a limitation? I can’t get anything other than a one-variable comparison to work here.)

Okay, set the trigger to fire at the start of every turn, then set up the piece that displays the value to only fire it’s calculation if the current turn is for the correct side.

And… I can’t get that to work either. I can verify the Global Hotkey fires. I can verify the Global Key Command hooked to it fires. But I can’t get the Trigger Action to go off (I added a Report Action to what it will fire: nothing happens), even if I don’t filter it for matching properties.

Current details:
Global Key Command (in the same map as the display pieces):
Key Command: ReCalc
Matching Properties: {Calculated==Yes} [possibly not needed here, since the scope of possible pieces should be small]
Hotkey: StartTurn [which is the command from the Global Hotkey]

On the actual Single Piece:
Trigger Action:
Watch for these Keystrokes: ReCalc
Perform these Keystrokes: B-Set; Test

Marker:
Calculated = Yes

Report Action:
Report on these keystrokes: ReCalc; Test

If I put a report on the Global Hotkey, I see it in the chat log. If I put one on the Global Key Command, I see it in the chat log. I just can’t get anything to report (or do anything else) in the piece itself.

Okay, looked it over again, and am through the problem, but I still don’t get some behavior.

First, I found that my Global Key Command wasn’t working. I re-did it at the true global level, instead of just on the map where all the pieces I wanted to receive it are.

That makes some sense. But I’m still having trouble with “Matching Properties”. If I have nothing there, it fires, if I have the Calculated==“Yes” property in, it does nothing.

And… I’ve got about a half-dozen rewrites as I keep finding things that do work, and don’t work, and still not solved. And I will be back with full documentation on the current mess when I have an hour or two to test it all another dozen times and write it down. >.<

So:

Turn tracker: Works (that’s easy enough)
Global Hotkey:

  • {Phase==“Move”} works at the start of every turn
    x {PlayerSide==“Black”} does not work (I thought I had that working…! >.< I keep having things I thought were working, and then I go back and they don’t. )
  • {Side==“Black”} [after renaming a component of the turntracker] works… So… is the entire chain of problems caused by using caps in the middle of variable names? Of all things?
  • {Playerside==“Black”} works. Yes, a lot of it is probably from naming conventions. ({Player-Side==“Black”} causes a Bad Data error… which makes some sense, but the Wiki really needs a highly visible guide on how Vassal’s going to react to all these variations.)

And now:

  • {Phase==“Move”&&Playerside==“Black”} works at the start of every black turn
  • {Phase==“Move”&&Playerside==“Red”} works at the start of every red turn

Reworking the downstream stuff… and the main sticking point lights up after I take a hyphen out of variable names. Note, that I’m using “BConvAttempts” and “BCurrAttempts”, so caps in the middle of the names don’t cause a problem here. And I’ve got variable names with hyphens elsewhere (as Global Properties), and those work (I can do a calculated property command on “B-ConvAttempts”, but a Dynamic Property that has a New Value of “{$B-ConvAttempts$}” failed while one that had a New Value of “{$BConvAttempts$}” (after appropriate renaming of the Calculated Property) works). >.<