Building an expression for GKC

I cannot get this to work.

OOS_Active==false&&rev_Active==true&&CurrentMap!=China FiF||CW FiF||France FiF||German FiF||Italy FiF||Japan FiF||USA FiF Mini Map||USA FiF AmiF Map||USSR FiF||Minors FiF||STDProdCircle||ModSTDProd

Basically an EOT unflip of all units that are not OOS (out of supply) and is currently flipped but don’t flip any units on the stated maps.

I’ve tried “map name”, (map name), $map name$ and !~

Using “map name” gets the green tick but has no effect on ignoring flipped units on those maps.

Vassal Guru’s guidance would be greatly appreciated.

On the right side of your CurrentMap “multi-doesn’t-equal” comparison, you need the tilde instead of the equals, and single pipes, not double pipes.

CurrentMap!~China FiF|CW FiF|France FiF|German FiF|Italy FiF|…and so on

With much hope he tried the solution. Alas, alack no go.

OOS_Active==false&&rev_Active==true&&CurrentMap!~“China FiF”|“CW FiF”|“France FiF”|“German FiF”|“Italy FiF”|“Japan FiF”|“USA FiF Mini Map”|“USA FiF AmiF Map”|“USSR FiF”|“Minors FiF”|“STDProdCircle”|“ModSTDProd” got the green tick.

Removed the “”, and no green tick

Bad Data in Module: Expression evaluation error Expression={OOS_Active==false&&rev_Active==true&&CurrentMap!~China FiF|CW FiF|France FiF|German FiF|Italy FiF|Japan FiF|USA FiF Mini Map|USA FiF AmiF Map|USSR FiF|Minors FiF|STDProdCircle|ModSTDProd}, Error=

  • Bad Data in Module: Expression evaluation error Expression={OOS_Active==false&&rev_Active==true&&CurrentMap!~“China FiF”|“CW FiF”|“France FiF”|“German FiF”|“Italy FiF”|“Japan FiF”|“USA FiF Mini Map”|“USA FiF AmiF Map”|“USSR FiF”|“Minors FiF”|“STDProdCircle”|“ModSTDProd”}, Error= inline evaluation of: ``_xyzzy=_plugh();’’ internal Error: Unimplemented binary String operator

Could it be that one or maps are incorrectly named? Perhaps I should remove spaces in the names?

Sorry, I should have made clear that I was posting in “old” style format. If you are doing Beanshell style, you probably can’t have each of the values enclosed in quotes–rather, one opening quote and one closing quote all the way at the end.

e.g:

CurrentMap!~“China FiF|CW FiF|France FiF|German FiF|Italy FiF|Japan FiF|USA FiF Mini Map|USA FiF AmiF Map|USSR FiF|Minors FiF|STDProdCircle|ModSTDProd”}

JoelCFC25, I would like to thanks for your persistence with me. Very much appreciated.

Your suggestions came to no avail.

I tried each separately.

Believe it or not the following actually worked:

OOS_Active==false&&rev_Active==true&&CurrentMap!=“China FiF”&&CurrentMap!=“CW FiF”&&CurrentMap!=“France FiF”&&CurrentMap!=“German FiF”&&CurrentMap!=“Italy FiF”&&CurrentMap!=“Japan FiF”&&CurrentMap!=“USA FiF Mini Map”&&CurrentMap!=“USA FiF AmiF Map”&&CurrentMap!=“USSR FiF”&&CurrentMap!=“Minors FiF”&&CurrentMap!=“Mod STD Prod”&&CurrentMap!=“STD Prod Circle”

A mouth watering expression is it not! Note I did get the last two map names wrong.

I did try a lot of permutations, using |,||, !~, !=,"" for each map, “” at start and end only.

Perhaps my tired old brain fails to see where or how this can be simplified and still work. Notwithstanding this though, I’ll run with the solution that works

Again many thanks for the help. :smiley:

I’m going to just fess up that I’ve never had much luck with the ~= and !~ in beanshell expressions, there’s some special trick that I’ve just never found.

HOWEVER, the following works great for me:
{ GetProperty(“NotThesePlaces”).contains(GetProperty(“CurrentMap”)) == false }

Where NotThesePlaces is a GlobalProperty that I’ve preset to contain e.g. “China FiF CW FiF France FiF German FiF …” etc etc.

Brian

In reviewing where I’ve successfully employed !~ in the past, it’s possible that it only works in OLD style expression evaluation, not Beanshell-style. Just over the weekend I was doing something in the Root module and couldn’t get !~ to work until I reverted to the old way.

So putting it all back together, that would be:

OOS_Active=false&&rev_Active=true&&CurrentMap!~China FiF|CW FiF|France FiF|German FiF|Italy FiF|…continues to end.

No curly braces anywhere.

Well it’s good to know I’m at least sane :smiley:

Then I thought, why the hell am I doing all those exclusions? When I could just have 5 inclusions - the maps where I want the unflip command to apply (5). Thus the following:

{OOS_Active==“false” && rev_Active==“true” && CurrentMap==“World Maps”||CurrentMap==“AmericasCE”||CurrentMap==“Americas AiF”||CurrentMap==“Africa”||CurrentMap==“Scandinavia”}

Yes, I appreciate all the help, but I just could not get them to work.

Gotta love the the differing ways and means within Vassal to get something done.