Create account / Log in

Set Global Property

Issues with the Vassal engine.

Moderators: uckelman, Tim M

Set Global Property

Postby DasherM » October 1st, 2020, 11:44 am

When I use this command I get the following error:
Bad Data in Module: Aide de Camp [Set Global Property - Turn] - Unable to locate Global Property in Named Map. Property Expression=[{gp_Turn}], Property Name=0].

I have tried with the default "Current Zone/Current Map/Module" and I have not decoded how to use the expression builder to enter the correct property when select the non default value.

Global Property is in the Global Properties folder

I am not sure what I am doing wrong.

Thanks

Mark
DasherM
 
Posts: 3
Joined: October 1st, 2020, 11:38 am

Re: Set Global Property

Postby marktb1961 » October 2nd, 2020, 7:42 am

How are you specifying the Global Property in the Set Global Property trait ?
Platform used:
Vassal 3.4.10
MacOS Big Sur
iMac (27", mid-2020)
User avatar
marktb1961
 
Posts: 335
Joined: October 4th, 2018, 2:36 pm
Location: Liverpool, England

Re: Set Global Property

Postby DasherM » October 2nd, 2020, 12:00 pm

Here are the setting:
[Global Properties]
gp_Phase
initial value: 0
It is numeric
Min value 0
Max value 8
It is wrap around
----
Set Global Property (which is part of a piece in an At-Start Stack)

Global Property Name {gp_Phase}
Located Property ... Current Zone/Current Map/Module
It is numeric
Min value 0
Max value 8
It is wrap
Key Command CTRL+P
Type Increment numeric value
Increment by 1


----
I have not change any other setting for this action; I an not sure if I now need to set a switch in map or somewhere.

Thanks

Mark
DasherM
 
Posts: 3
Joined: October 1st, 2020, 11:38 am

Re: Set Global Property

Postby marktb1961 » October 5th, 2020, 6:37 am

Ok... try putting quotes around the property name, thus {“gp _Phase”}

Curly braces invokes the beanshell expression parser and that works differently from legacy mode as to how property names are handled. Without the quotes, vassal is trying to find a property with the name of whatever the content of gp_Phase is. In hindsight, I can see this from the original error message where you intended the property name to be gp_Turn, which had a value of zero (0). Vassal was looking for a property with a name “0”.

Hope this helps,

Mark
Platform used:
Vassal 3.4.10
MacOS Big Sur
iMac (27", mid-2020)
User avatar
marktb1961
 
Posts: 335
Joined: October 4th, 2018, 2:36 pm
Location: Liverpool, England

Re: Set Global Property

Postby DasherM » October 31st, 2020, 12:20 pm

Mark
Sorry for the delay. I went on the trip and got Covid. Was in quarantine, etc. Finally back to normal. Your suggestion of {"name"} worked. Thank you sir.

vr

Mark
DasherM
 
Posts: 3
Joined: October 1st, 2020, 11:38 am

Re: Set Global Property

Postby marktb1961 » October 31st, 2020, 6:40 pm

Glad I could help but more so that you have recovered.
Platform used:
Vassal 3.4.10
MacOS Big Sur
iMac (27", mid-2020)
User avatar
marktb1961
 
Posts: 335
Joined: October 4th, 2018, 2:36 pm
Location: Liverpool, England


Return to Technical Support & Bugs

Who is online

Users browsing this forum: Google [Bot] and 6 guests