Create account / Log in

Expression grammar question

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

Expression grammar question

Postby skizelo » September 28th, 2017, 2:57 pm

I want a Trigger to fire only when a piece is in one of a number of areas and when the wrong player is clicking on it. at the moment my expression is
Code: Select all
LocationName==("a"||"b"||"c"||"d")&&PlayerSide!="Right Player"

and it doesn't like it. What do I need to do to tell it make it read there being many different acceptable locations? I suppose I could do
Code: Select all
LocationName=="a"&&PlayerSide!="Right Player"||LocationName=="b"...

but that can't be the right way.
skizelo
 
Posts: 17
Joined: July 6th, 2017, 11:37 am

Re: Expression grammar question

Postby Tim M » September 28th, 2017, 3:56 pm

I still write expressions the old way before the builder and let it do the conversion after. That being said to make it work I would have written:

LocationName = a && PlayerSide != Right Player || LocationName = b && PlayerSide != Right Player || LocationName = c && PlayerSide != Right Player || LocationName = d && PlayerSide != Right Player
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: Expression grammar question

Postby skizelo » September 28th, 2017, 8:22 pm

Exactly what I was trying to avoid but your way works and mine did not, so thanks!
skizelo
 
Posts: 17
Joined: July 6th, 2017, 11:37 am


Return to Module Design

Who is online

Users browsing this forum: No registered users and 3 guests