Moving pieces onto map and triggers

What’s wrong with my proposed fix, anyway? Just make sure the triggers don’t fire if the piece name and direction is the same as the latest stored SCM’s names and direction…

Unless it’s the GCK itself firing multiple times by itself, for unknown reasons, that should cure it…

I’m trying your idea today.

Unfortunately the method of using a variable to store the name of the previous map and checking against that doesn’t work. Somehow the GKC sent to the VP marker that tells it to increment/decrement the VP Global Property is only sometimes occurring more than once. I’m stumped.

Of the previous map? My suggestion was to store the name of the previous SMC itself, assuming they have an unique BasicName. If the latter is not the case then store their PieceId but careful that won’t work if they came from the same game piece palette slot. In that case you gotta make sure they get an unique id (use a Dynamic Property called ID or something) when drawn from the palette (use a global property to keep track of all SMCs drawn). Moreover, you should also store the direction (increase or decrease) requested by the previous SMC.

Do you mean you are sure it’s the GCK itself misteriously duplicating himself while the trigger invoked to run it is only firing once? That sounds very surprising, if so. Make sure by adding a report action on the triggers…?

These square control markers all have the same BasicName–it didn’t occur to me to give them different names, they are all functionally identical. They aren’t in any palette at all, so never get drawn from one. They are items in At-Start Stacks.

I’ll pop a Report in to see if it’s the Trigger that’s actually firing 2+ times. I guess it would have to be.

If so, and if it’s confirmed that it’s the trigger firing 2+ times as most likely, then no need to assign different names but do try storing the PieceId and “direction” of the last SMC used and make a check vs those in the SMC triggers.

Storing and checking the old map only won’t work. You need to make sure your triggers can discern if the current SMC is not the same as the latest used before or, if it is, that the direction (increase/decrease score) is not the same.

Check the IRC channel. The problem is in the VP Markers and its prototype.

You inadvertently create a loop that sometimes fire

I’m not sure how there is a loop. What you suggested in the chat was that the Trigger on the VP Marker that listens for Alt-Ctrl-Shift-V is triggering Alt-Ctrl-Shift-R…but there is a property match expression on this, so it only happens when the piece is not in the VP Track zone. I put this in here to return VP markers to the player’s current score if someone tried dragging it off the track entirely.

Alt-Ctrl-Shift-R is making the VP marker to go to whatever the current score is. That’s supposed to happen either after the Global Property is incremented/decremented, or if the player manually moves it off the track. It should not be triggered by movement of the marker within the zone of the VP Track.

barbanera, I may not be understanding the implication of why you think storing the direction of the last SCM’s move is important, but to be clear: movement of SCMs does not necessarily alternate between to/from the map. It’s entirely possible that there would be 2 or more consecutive movements of SCMs from the Power Cards to the map.

Very interesting–i put in a test Report Action on the Trigger that is set off by movement between the boards. Played around until I saw a doubled score adjustment, but the test message only came up once. It’s obviously the key commands that the triggers fire (Ctrl-K does a Ctrl-1/Ctrl-2/Ctrl-3–depending on whose marker it is–if increasing the score, Alt-K does Alt-1/Alt-2/Alt-3 if decreasing the score) that are being repeated somehow.

Here,

Make a mod copy and try with this buildfile.I’ve made a few slight changes and it no longer jumps extra spaces on the VP track for me like it did before as you described. See if it still jumps for you

Thanks–I think I spotted all the changes you made. I still got the glitch though, eventually.

Dude, one more attempt at making myself clear:

  1. Update your CTRL-K property check in the SCM’s trigger as follows: && PieceId != $SCMold_id$ || && SCMold_direction != increase

  2. Update your ALT-K property check in the SCM’s trigger as follows: && PieceId != $SCMold_id$ || && SCMold_direction != decrease

  3. if SCM 1 is the first ever moved to increase the score, you will end up with the global properties SCMold_id and SCMold_direction storing “1” and “increase”, say (have your CTRL-1/2/3 or ALT-1/2/3 do the storing);

  4. if SCM 1 itself is moved again to decrease the score, the property check will pass, as the direction is different from the stored one;

  5. if SCM 1 itself was instead moved again to increase the score, be it in a later phase of the game or by the rogue double/triple instances you are getting on your Mac, then the property check will NOT pass, as the id and direction are BOTH the same as the stored ones;

  6. if SCM 2 is instead moved to either increase or decrease the score, the property check will pass, as the id is different from the stored one.

That’s what I meant. If, however, the trigger nicely fires only once while the gck’s fire more times as your report trait seems to suggest… than I dunno what’s going on.

Sure you got everything? I still can’t get it to glitch. I could all the
time before, but I can’t with this build, and Im sitting here moving pieces
back n forth like crazy

All triggers should be active instead of passive
Inc/dec trigger replaced with 6 unique triggers
Set VP GP has own set of keys - not same as GKC relay key
STL goes to region not stack

-----Original Message-----
From: messages-bounces@vassalengine.org
[mailto:messages-bounces@vassalengine.org] On Behalf Of JoelCFC25
Sent: Wednesday, September 19, 2012 2:19 PM
To: messages@vassalengine.org
Subject: Re: [messages] [Technical Support & Bugs] Moving pieces onto map
and triggers

Thanks–I think I spotted all the changes you made. I still got the glitch
though, eventually.


Read this topic online here:
https://forum.vassalengine.org/t/moving-pieces-onto-map-and-triggers/5284/28

I copied the module and dropped your buildFile in to replace the existing one. Only took me like a dozen moves to get the glitch.

barbanera, sorry about my inability to follow you. I’ll give it a shot. Thanks for your patience.

barbanera’s method did not work. I inserted some more Report Action traits for debugging. When I get the doubled/tripled score adjustment, I see the correct values for the PieceId of last moved key and the direction of the last key move. I also see that Ctrl-K or Alt-K, the things fired by the Trigger and sent to the player’s VP marker, are firing only once–i.e., I see something like this:

  • Ottoman score: 13 VP
  • Ottoman score: 15 VP
  • ** TEST message ** Ctrl-K / Alt-K fired by trigger
  • ** TEST message ** Stored PieceID = 4462, Stored move dir = increase

I moved the SCM once, the score increased twice, but the Report Action traits bound to my test messages each occurred once. It’s gotta be the Alt/Ctrl 1-2-3 commands that are repeating somehow once initiated by the Ctrl-K/Alt-K GKC.

Can you post a link to the latest version of this (or the test) module. I am now darn curious to see with my own eyes those darn Alt/ctrl 1-2-3 firing twice. Just crazy! ;)

Ok give this build a try. This is a different setup. The SCM perform the setting and the VP markers perform getting only. We split the process between the pieces instead of putting everything on the VP marker

Sweet. This looks awfully close to working. I did one get doubled message at one point:

  • England score: 2 VP
  • England score: 2 VP
  • Testing: Ottoman = 2, Spain = 0, England = 2, France = 4, HRE = 4, Protestant = 0

…but crucially, it was only the report, not an incorrect doubled increase of the score. I still want to put back in the ability to set a player’s score by drag-and-drop of the VP marker (in case it gets off somehow), but that’ll be easy to add back in. I’ll extend this method to all the bonus VP pieces and it should be all set. Thanks a million for the help!

Cool.

Yeah that report was just for testing although I did think it is a nice summary
for everyone to see when score changes, what the score is and they may not have
VP window open :slight_smile: You could probably spruce it up accordingly of course…


From: JoelCFC25 jkoepp@yahoo.com
To: messages@vassalengine.org
Sent: Thu, September 20, 2012 11:31:05 AM
Subject: Re: [messages] [Technical Support & Bugs] Moving pieces onto map and
triggers

Sweet. This looks awfully close to working. I did one get doubled
message at one point:

  • England score: 2 VP
  • England score: 2 VP
  • Testing: Ottoman = 2, Spain = 0, England = 2, France = 4, HRE = 4,
    Protestant = 0

…but crucially, it was only the report, not an incorrect doubled
increase of the score. I still want to put back in the ability to set a
player’s score by drag-and-drop of the VP marker (in case it gets off
somehow), but that’ll be easy to add back in. I’ll extend this method to
all the bonus VP pieces and it should be all set. Thanks a million for
the help!


Read this topic online here:
https://forum.vassalengine.org/t/moving-pieces-onto-map-and-triggers/5284/35


messages mailing list
messages@vassalengine.org
vassalengine.org/mailman/listinfo/messages