Reporting a Property from the Global Key Command window

Is it possible to report a property if it’s listed in the Report Format window of the Global Key Command window?

I can’t make it work. Unless you need the details, I’m positive the property Blue CVP is updating correctly. I just can’t figure out how to make the value of the Blue CVP property appear in the message bar.

Here’s my GKC window:

[attachment=1]GKC.jpg[/attachment]

Here’s the result in the message bar after clicking the GKC button a bunch of times:

[attachment=0]Window.jpg[/attachment]

The Blue CVP value for this example is confirmed to be 2.

I would like the GKC to report “Blue CVP: 2” in the message bar when the GKC button is pressed.

Thanks for your help.

One thing I would avoid is spaces in variables. Have you tried renaming the variable BlueCVP and using the report format of

Blue CVP: $BlueCVP$

What you’re doing appears to be correct but I’ve never used spaces in a variable so I’m thinking that may be a problem.

Thanks but I did try that and it didn’t work. I agree with you that properties should probably not have spaces just to avoid any issues spaces can cause.

I went back and renamed the GP to BlueCVP:

[attachment=2]GKCWindow.jpg[/attachment]

I didn’t mention this before but to ensure the BlueCVP property is updating correctly, I tagged it to a playing piece. Using the exact same property syntax, the playing piece updates and reports correctly.

[attachment=1]PieceWindow.jpg[/attachment]

And though I can use the playing piece report action to report BlueCVP in the message bar, I’d; one, prefer to delete this piece; and two, it takes two clicks of the GKC to update the message window to the correct value after an update. In the example message window (one click of the GKC yields two lines of report messages), you can see that the GKC does not report the value of BlueCVP and that the playing piece report action initially reported BlueCVP to be 0 after it was updated to 2. The second click of the GKC still does not report the value of BlueCVP through the GKC but does reflect the correct value of BlueCVP as reported through the playing piece report action trait.

[attachment=0]MessageWindow.jpg[/attachment]

I’m wondering if the placement of the BlueCVP property is an issue. It’s defined within a Zone on the Casualties map. Here’s the DropBox shortcut to the module if you’d care to have a look:

dropbox.com/s/1p5yzelaidrhf … .vmod?dl=0

Only the Blue Zone and Allied and Blue CVP pieces are updated. Ignore the Red Zone and Axis piece. To replicate the issue, place an allied piece in the blue zone of the Casualties map and click the GKC button.

Thanks very much!

Al

I looked at the mod and I’m not sure exactly what you want to do but it seems that what you’ve developed is overly complicated for what appears to be a simple task. Could you provide some details about how this is supposed to work and maybe I can come up with something a bit more simplistic.

Couple questions:

Do you need the button? In other words, is there a reason the reporting can’t be done automatically when things change or does this report need to be reported only as specific times?

Is it used simply to see the total value of the pieces? If that’s the case, you can simply place a display at the top of the box with the current total value of the pieces and it will update automatically whenever things change.

Anyway, I don’t think what you have is going to work as I can’t figure it out so there’s probably some broken logic in there.

I do tend to over engineer :slight_smile: You’ve got me thinking of other options.

The intent is to sum the CVP value of units placed on the Blue Zone of the Casualties map and have that sum reported in the message window each time a change is made or when a player requests it. If a unit is moved to the Blue Zone the value increases, if it is deleted it decreases, if it clones it increases, if it moves off the Blue Zone it decreases, if the piece CVP value is updated it increases/decreases as appropriate.

I’ll work on this but I do welcome suggestions. For some weird reason, I enjoy trying to figure this stuff out.

But I’m still curious as to the GKC report format; it should call up a GP correct?

And the proper syntax of that property is $properyname$ ?

Thanks again for your help.

Yes, that’s true. However, unless you have a specific reason for containing a GP in a zone, you should just create it as a module level GP. That way, it can be addressed from anywhere without restrictions. If you contain your GP’s in zones, then you need to have whatever trigger you’re using to create that report specifically aimed at that zone in some fashion.

You might try this. In the Casualties map properties, add a transparent At-Stark Stack at the top …make it say 100x50. Call the piece Value Display

In the “Text” box, have it display Blue CVP: $BlueCVP$. This will automatically display the current value of BlueCVP.

Also, add a Trigger Action to execute on the command UpdateValues You’ll see why later.

Now go to your Causalities Map properties and add a command like CVPSwitch under “Key Command to apply to all units ending movement on this map”

On your pieces, set a Trigger Action with the Keyboard Command CVPSwitch. Under Perform These Keystrokes, have it execute the command Update. Now, every time a piece is moved on the map, the Update trigger will be set off.

Add a Global Key Command trait with keyboard command Update and the Global Key command of UpdateValues. Matching Properties would be CurrentMap = Casualties && BasicName = Value Display.

As noted above, a trigger action on the display piece will now receive this trigger. I’ll let you figure it out from there but basically you want that trigger to send out a command to all pieces to increment the GP BlueCVP …first by resetting it to zero and then having each piece add its value to it.

If you get it right, anytime you move a piece, it will update. When you remove a piece, it may NOT update but simply moving one of the existing pieces will update again. If you like, you can even place a right-click menu item on the display to have it Update manually.

Hope that helps.

It does help thank you. I can make the CVP value update automatically. At the piece level, I can make $BlueCVP$ report in the message window. I’d like to have a GKC option and it takes two clicks of the GKC to do update to the correct value but it does work.

What I can’t do however is make the GKC by itself report the updated CVP value in the message window. I’ve even dumbed down the module to just the BlueCVP GP, a playing piece that will modify the BlueCVP GP, and a GKC that fires the piece to do so. Still $BlueCVP$ in the GKC report window does not generate anything in the message window. Either $BlueCVP$ is the wrong syntax or the GKC report window will only recognize the default properties in its pull down window.

Maybe I’m misunderstanding the purpose of the GKC report feature.

Update…

I got it to work :slight_smile:

Not sure what I did different than last night but the GP $BlueCVP$ will update and report in the message window as generated from the report window of the GKC.

To recap, I defined the GP BlueCVP at the module level. Initially I defined BlueCVP at the Zone level and that did not work.

I added a GKC at the map level that updates and reports BlueCVP when clicked. The correct syntax in the GKC report window is $BlueCVP$

All pieces that affect the value of BlueCVP are fired by the map level GKC to update the module level BlueCVP GP.

I added the suggestion to update the BlueCVP GP automatically when a piece is moved to the map. The message window report only gets fired when the GKC is clicked.

Thanks again for all your help!