Moving pieces onto map and triggers

You have the same setup as me and I have not been able to get it to fail.

It may seem retarded, but expand the expression and add your Maps, make the
expression ironclad - be sure.
The boards are not on the same map. Sometimes the pme neglects this I have
found (why I have no idea), same with Map/board setups

-----Original Message-----
From: messages-bounces@vassalengine.org
[mailto:messages-bounces@vassalengine.org] On Behalf Of Brent Easton
Sent: Tuesday, September 18, 2012 8:29 PM
To: messages@vassalengine.org
Subject: Re: [messages] [Technical Support & Bugs] Moving pieces onto map
and triggers

You have the same setup as me and I have not been able to get it to fail.


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

Thanks, I’ll try that tomorrow! At least it’s encouraging that no one can seem to replicate this. I have been testing on my iMac (OS 10.7.4, 64-bit Java 1.6u35) and just now got a tripled score adjustment when moving a French SCM to the map.

Actually I tried fleshing out the PME just now to specify CurrentMap, CurrentBoard, OldMap, and OldBoard. I still get the occasional doubled or tripled score adjustment, at least on my Mac here. Grrr. Am I this big of a klutz at dragging and dropping things?

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.