Create account / Log in

Moving pieces onto map and triggers

Issues with the Vassal engine.

Moderators: uckelman, Tim M

Moving pieces onto map and triggers

Postby JoelCFC25 » September 18th, 2012, 1:51 pm

FAO Brent or Joel...

The most-requested feature addition to my Here I Stand and Virgin Queen modules has been automated score tracking. Maybe I'm trying something that is stretching the limits of what VASSAL 3 can do, but here goes...

I am employing the map-level feature that applies a key command to all units ending movement on a map. In these games, players have square control markers (SCMs) that are always either on a player's personal display card or on the map. Every time an SCM moves from the display card to the map to denote control of a newly-acquired space, the player's score increases. When an SCM comes off the map and goes back to the display card, the player's score decreases. Each SCM contains 2 triggers: one that fires when the CurrentBoard is the map AND the OldBoard is the player card, the other one is the reverse. When the property match is satisfied, a Global Key Command is applied to the player's Victory Point (VP) score marker incrementing or decrementing his global property by the appropriate amount and moving the VP marker on the track.

In testing, this almost always works just fine. However, sometimes the messages that accompany these commands come out 2 or 3 times instead of just once, an indication that the triggered command has occurred multiple times. The conditions under which this improperly doubled or tripled score adjustment occurs are neither predictable nor repeatable. That is, if I see the glitch and then use the Undo feature and repeat the drag of the SCM from one window to the other, the next time the score correctly adjusts just once.

I have not tried this module using 3.2 beta, which is something that just occurred to me. I'll do that today. I'd really like to release these modules with this feature, I think it would be a huge improvement--but if it's unpredictably glitchy I'll need to scrap it.

Here is a link to the module, if anyone is able to replicate this issue and perhaps diagnose it: http://dl.dropbox.com/u/18916235/Virgin ... 1.6VP.vmod

1. Start the module
2. Choose either the Campaign or Tournament Scenario
3. Open the Power Cards display.
4. Optionally, open the Weddings/VP window where the VP track is to see the VP markers move
5. Drag an SCM belonging to any power from the Power Cards display to the main map. Repeat this dragging in either direction until you get the glitch.
JoelCFC25
 
Posts: 730
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: Moving pieces onto map and triggers

Postby JoelCFC25 » September 18th, 2012, 2:36 pm

To clarify some things, I'm on a Windows 7 system and using VASSAL 3.1.20 with an up to date 64-bit Java. Another user is on a Linux box using 64-bit Java and can't seem to replicate this despite dozens of attempts...
JoelCFC25
 
Posts: 730
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: Moving pieces onto map and triggers

Postby JoelCFC25 » September 18th, 2012, 3:23 pm

Same behavior (still totally unpredictable) in 3.2 build 8355.
JoelCFC25
 
Posts: 730
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: Moving pieces onto map and triggers

Postby Tim M » September 18th, 2012, 4:09 pm

Andean Abyss has a similar set up where moving counters about the map causes a tally that is kept for those specific counters to be adjusted based on location. This sounds similar to what you are trying to do although not identical. Also, I did create a similar setup in one of Rob Doane's modules (Guilford - I think it was) where the score was tracked on a totally different map.

Between these two modules, how they do their tracking, I think you should be able to fix your duplication issue.

Usually what is needed is an independent true/false property toggle embedded, that insures that duplicate firing does not occur during the sequence
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: 1816
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: Moving pieces onto map and triggers

Postby JoelCFC25 » September 18th, 2012, 4:16 pm

Usually what is needed is an independent true/false property toggle embedded, that insures that duplicate firing does not occur during the sequence

I don't fully understand what this means in terms of implementation, but I'll download the Guilford module and poke around in it.
JoelCFC25
 
Posts: 730
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: Moving pieces onto map and triggers

Postby barbanera » September 18th, 2012, 7:27 pm

Just a guess but the double/triple hits you are experiencing at times might be due to the piece dragging not being clear cut and the piece not landing precisely but bouncing around a few times, albeit imperceptibly. I know that there is a check on OldMap but maybe that attribute doesn't fully update till the piece finishes movement completely.

If I understand correctly, your SCM's alternate between increasing and decreasing the VP total. In other words, there is no situation when they need to increase - or decrease - the score twice in a row.

If so, maybe you could add a couple GP's to store OldSCM_name and OldSCM_direction (=increase or decrease). Then add a check on the SCM's triggers to activate only when the SCM being played has a different name from the previously used one OR the same name but there is a request for a different direction of adjustment. The triggers themselves should take care of storing OldSCM_name and OldSCM_direction when successfully firing, with some Set Global Properties traits.
barbanera
 
Posts: 395
Joined: January 12th, 2012, 2:27 pm

Re: Moving pieces onto map and triggers

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

If I understand correctly, your SCM's alternate between increasing and decreasing the VP total. In other words, there is no situation when they need to increase - or decrease - the score twice in a row.

Yep, that's right. A single SCM moving onto the map or off of the map adjusts a player's score once--never more or less than once.
JoelCFC25
 
Posts: 730
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: Moving pieces onto map and triggers

Postby barbanera » September 18th, 2012, 7:47 pm

JoelCFC25 wrote:
If I understand correctly, your SCM's alternate between increasing and decreasing the VP total. In other words, there is no situation when they need to increase - or decrease - the score twice in a row.

Yep, that's right. A single SCM moving onto the map or off of the map adjusts a player's score once--never more or less than once.


Ok, so the solution I proposed might work then.
barbanera
 
Posts: 395
Joined: January 12th, 2012, 2:27 pm

Re: Moving pieces onto map and triggers

Postby Brent Easton » September 18th, 2012, 9:31 pm

I can't seem to get this to happen on my Windows 7 64 bit machine. I have Java version 1.6.0_23.

What do you mean by 'Up to date' Java? are you using Java 7? Can you try installing Java 6 (1.6) and see if it still happens. There have been a number of funnies with Java 7, this could possibly be another.
User avatar
Brent Easton
 
Posts: 3170
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: Moving pieces onto map and triggers

Postby Brent Easton » September 18th, 2012, 9:49 pm

Ok, Well, I have managed to get some strange behaviour, but not when moving a single SCM marker, only when selecting and moving two at once.

Your scheme for moving the VP markers is so complex, it is difficult to see whether there might be a problem in there somewhere. You could try a simpler scheme where you maintain the VP count in a Global Property, set the VP track up as an irregular grid with a region for each number, and use the 'Send to Location - Named Region' option to move the VP counter around.
User avatar
Brent Easton
 
Posts: 3170
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: Moving pieces onto map and triggers

Postby Tim M » September 18th, 2012, 11:30 pm

I can fix this

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

Ok, Well, I have managed to get some strange behaviour, but not when moving
a single SCM marker, only when selecting and moving two at once.

Your scheme for moving the VP markers is so complex, it is difficult to see
whether there might be a problem in there somewhere. You could try a simpler
scheme where you maintain the VP count in a Global Property, set the VP
track up as an irregular grid with a region for each number, and use the
'Send to Location - Named Region' option to move the VP counter around.

_______________________________________________
Read this topic online here:
viewtopic.php?p=36127#p36127
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: 1816
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: Moving pieces onto map and triggers

Postby JoelCFC25 » September 19th, 2012, 1:13 am

Sorry, I tried to be exhaustive with the pertinent info and slipped up. On the Windows 7 box I have 64-bit Java 1.6 update 35 installed, that's what I meant by current (I've seen enough in other threads to dissuade me from using Java 7).

Each power's VP total is already maintained in a Global Property. The sequence of events is as follows:

1. Drag an SCM from the power card to the main map (or vice versa) and the key command applying to all units ending movement on map is received
2. This executes one of two triggers based on the property match (if the OldBoard was the Power Cards or the Main Map)
3. Trigger sends a GKC to the power's VP marker
4. VP marker does a Set Global Property to increment/decrement the VP Global Property by the correct amount
5. VP marker executes a Send to Location to move itself to the new correct location on the track

I haven't ever tried moving 2 or more SCMs simultaneously, as that should never occur in the game.
JoelCFC25
 
Posts: 730
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: Moving pieces onto map and triggers

Postby Brent Easton » September 19th, 2012, 1:29 am

You have the same setup as me and I have not been able to get it to fail.
User avatar
Brent Easton
 
Posts: 3170
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: Moving pieces onto map and triggers

Postby Tim M » September 19th, 2012, 1:55 am

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:
viewtopic.php?p=36133#p36133
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: 1816
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: Moving pieces onto map and triggers

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

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

Next

Return to Technical Support & Bugs

Who is online

Users browsing this forum: No registered users and 3 guests