Create account / Log in

Moving pieces onto map and triggers

Issues with the Vassal engine.

Moderators: Tim M, uckelman

Re: Moving pieces onto map and triggers

Postby JoelCFC25 » September 19th, 2012, 2:45 am

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?
JoelCFC25
 
Posts: 589
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: Moving pieces onto map and triggers

Postby barbanera » September 19th, 2012, 10:57 am

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..
barbanera
 
Posts: 377
Joined: January 12th, 2012, 2:27 pm

Re: Moving pieces onto map and triggers

Postby JoelCFC25 » September 19th, 2012, 2:03 pm

I'm trying your idea today.
JoelCFC25
 
Posts: 589
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: Moving pieces onto map and triggers

Postby JoelCFC25 » September 19th, 2012, 4:40 pm

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.
JoelCFC25
 
Posts: 589
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: Moving pieces onto map and triggers

Postby barbanera » September 19th, 2012, 5:12 pm

JoelCFC25 wrote:Unfortunately the method of using a variable to store the name of the previous map and checking against that doesn't work.


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.

JoelCFC25 wrote: 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.


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..?
barbanera
 
Posts: 377
Joined: January 12th, 2012, 2:27 pm

Re: Moving pieces onto map and triggers

Postby JoelCFC25 » September 19th, 2012, 5:56 pm

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.


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.
JoelCFC25
 
Posts: 589
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: Moving pieces onto map and triggers

Postby barbanera » September 19th, 2012, 6:04 pm

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.
barbanera
 
Posts: 377
Joined: January 12th, 2012, 2:27 pm

Re: Moving pieces onto map and triggers

Postby Tim M » September 19th, 2012, 6:17 pm

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

You inadvertently create a loop that sometimes fire
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1777
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: Moving pieces onto map and triggers

Postby JoelCFC25 » September 19th, 2012, 6:23 pm

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.
JoelCFC25
 
Posts: 589
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: Moving pieces onto map and triggers

Postby JoelCFC25 » September 19th, 2012, 6:32 pm

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.
JoelCFC25
 
Posts: 589
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: Moving pieces onto map and triggers

Postby JoelCFC25 » September 19th, 2012, 6:42 pm

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.
JoelCFC25
 
Posts: 589
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: Moving pieces onto map and triggers

Postby Tim M » September 19th, 2012, 7:09 pm

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
Attachments
VQbuildFile.zip
(70.48 KiB) Downloaded 142 times
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1777
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: Moving pieces onto map and triggers

Postby JoelCFC25 » September 19th, 2012, 7:18 pm

Thanks--I think I spotted all the changes you made. I still got the glitch though, eventually.
JoelCFC25
 
Posts: 589
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: Moving pieces onto map and triggers

Postby barbanera » September 19th, 2012, 7:34 pm

JoelCFC25 wrote: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.


Dude, one more attempt at making myself clear:

1) Update your CTRL-K property check in the SCM's trigger as follows: <previous stuff> && PieceId != $SCMold_id$ || <previous stuff> && SCMold_direction != increase

2) Update your ALT-K property check in the SCM's trigger as follows: <previous stuff> && PieceId != $SCMold_id$ || <previous stuff> && 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.
barbanera
 
Posts: 377
Joined: January 12th, 2012, 2:27 pm

Re: Moving pieces onto map and triggers

Postby Tim M » September 19th, 2012, 7:44 pm

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:
viewtopic.php?p=36154#p36154
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1777
Joined: December 8th, 2007, 12:22 pm
Location: Earth

PreviousNext

Return to Technical Support & Bugs

Who is online

Users browsing this forum: No registered users and 3 guests