Create account / Log in

Check what pieces are in a zone

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

Check what pieces are in a zone

Postby msoong » January 21st, 2021, 6:37 pm

Is there a way to query the global variables of a zone on a map and figure out what pieces are located in it?
msoong
 
Posts: 62
Joined: November 18th, 2015, 12:26 am

Re: Check what pieces are in a zone

Postby barbanera » January 22nd, 2021, 6:53 am

Not directly. You would have had to store/delete the names or ids of all pieces in a zone in one ore more GPs, whenever they moved in/out.

I suggest using a global key command on the piece who needs this information to call all other pieces in the zone or map to make themselves known.
barbanera
 
Posts: 470
Joined: January 12th, 2012, 2:27 pm

Re: Check what pieces are in a zone

Postby marktb1961 » January 30th, 2021, 6:13 pm

barbanera wrote:Not directly. You would have had to store/delete the names or ids of all pieces in a zone in one ore more GPs, whenever they moved in/out.

I suggest using a global key command on the piece who needs this information to call all other pieces in the zone or map to make themselves known.


Maybe I've misunderstood the OP's question but since early in v3.4.x, a Beanshell function Count() has been available that may suit the requirement. I've been using it myself to determine if certain pieces are at a certain location, including within zones.
Platform: Vassal 3.5.3, MacOS Big Sur on iMac (27", mid-2020)
User avatar
marktb1961
 
Posts: 445
Joined: October 4th, 2018, 2:36 pm
Location: Liverpool, England

Re: Check what pieces are in a zone

Postby barbanera » January 31st, 2021, 4:04 pm

Oh! Very nice, I had completely missed this new Count() function.
barbanera
 
Posts: 470
Joined: January 12th, 2012, 2:27 pm

Re: Check what pieces are in a zone

Postby msoong » February 17th, 2021, 7:12 pm

Thanks, will research how count() works
msoong
 
Posts: 62
Joined: November 18th, 2015, 12:26 am


Return to Module Design

Who is online

Users browsing this forum: No registered users and 2 guests