Problems with complex conditions

HI to all,

It often happens that different conditions such as: RANGE = ~ 1 | 2 && ASP = ~ 6 | 7 | 8 && CH = ~ 1 | 2 | 3 | 4 | 5 | 6 have to be analyzed . Unfortunately, the evaluation of all conditions requires a large number of trigger actions, one for each condition.
In the past I have tried several workarounds in order to try to reduce the large number of trigger actions, but none have worked, most likely because I don’t know the correct syntax to do this.
I have tried to define a marker for each condition, e.g. Cond1 = RANGE = ~ 1 | 2 && ASP = ~ 6 | 7 | 8 && CH = ~ 1 | 2 | 3 | 4 | 5 | 6, and so on, but I cannot in any way evaluate if the condition is true or false, in how much, in all the different attempts at syntactic forms, I always get a syntax error.

Thanks in advance to anyone who has an idea on how to solve this problem, otherwise I’ll have to resign myself to having dozens of trigger actions to evaluate.

Cheers. :question:

I’m not entirely sure what you’re trying to do there, but assuming you’re trying to check that RANGE is 1 or 2, ASP is in the range 6 to 8, and CH is in the range 1 to 6, this expression should check all of that: {(RANGE == 1 || RANGE == 2) && (ASP >= 6 && ASP <= 8) && (CH >= 1 && CH <= 6)}

Hello Jrwatts, thank you for your reply.

What I want do to is to try to use a more simple condition in a trigger action using markers like Cond1 = xxx, Cond2 = yyy, and so on.
I tried to put in the trigger action the following syntax : $Cond1$ || $Cond2$ || … || $Condn$ that is a simpler form instead of using long string of conditions like RANGE = ~ 1 | 2 && ASP = ~ 6 | 7 | 8 && CH = ~ 1 | 2 | 3 | 4 | 5 | 6 and so on.

Unfortunately it doesn’t work properly.

I’m asking what I’m doing wrong.

Cheers. :frowning:

Panter 2010

Hmm, I’m not sure why that isn’t working, then. The only thing I’m wondering about is if you are allowed to have a space between “=” and “~”; have you tried without the space (=~), instead?

Can you share an example module showing what you’re trying to do?

‘= ~’ will definitely not work.

HI Brent.

Very strange. I’m still using version 3.2.17 of Vassal and “=~” (without the blank within the two symbols) is working well.

My problem is another.

Be well.

Panther 2010.

Yes indeed. Could you just confirm whether in your module with the problem, you are using =~ (no blank) or = ~ (with blank)?

Are the examples you showed earlier that we have been using to investigate the problem the actual text cut and pasted from your module, or examples mis-typed from memory?

Thanks.

Hello Brent and Jrwatts,

first of all, thank you for your kind response to my question.
Well, it is worth trying to clarify what I am doing.
Be patient: English is not my mother tongue and I find it difficult to express myself clearly in that language, especially in matters of a technical nature.

I simulated tables (like a CRT, for instance) in order to automate as much as possible the modules I’m working on. Everything works perfectly. The problem lies in the large number of trigger actions needed for the simulation.
In the present case, I have defined three variables: RANGE (the distance between two hexagons on the map), ASP (a differential between the forces of the units involved) and CH (the value of a random chit that varies between 0 and 9).

For example, the condition: RANGE =~1|2 && ASP =~3|4|5 && CH =~1|2|3 (I just removed the blanks introduced by copy & paste) represents the case where RANGE is between 1 and 2, ASP between 3 and 5 and CH between 1 and 3.

Unfortunately, 28 trigger actions are needed to simulate the entire table.
The problem I was working on is trying to drastically reduce the number of trigger actions needed.

To this end, I defined 28 markers, one for each condition to be evaluated in a trigger action, such as:
ASTA2 = “= ~1|2 && ASP =~ 3|4|5 && CH =~ 1|2|3” (without the ").

After numerous unsuccessful attempts, I inserted a single condition in the trigger action with the following syntax:
$ASTA1$ || $ASTA2$ || … || $ASTA28$.

This kind of syntax didn’t work initially, so I asked about the Vassal forum.

A strange thing happened yesterday: I just rewrote the trigger action from scratch, without making any changes and now it works!

Things like this have already happened in the past: it was enough to rewrite the condition and things began to work properly. Perhaps while typing I pressed some key which, although not clearly visible, still modified the condition string and Vassal interpreted it in a different way. I do not know.

In any case, even this problem has finally been solved!

Before I forget, I have another question to ask: I am currently still using Vassal version 3.2.17, but yesterday I downloaded the latest version released, 3.4.3.

In order to learn how to use it better, I would like to know if there is a documentation that describes in detail the changes made and gives some examples on how to use the new features that have been introduced after the version I currently use.

I thank in advance anyone who wants to give me explanations on the matter.

Panther 2010. :smiley:

Release notes outlines the new features… vassalengine.org/wiki/VASSAL … ease_Notes (thank Brian / Cattlesquat, I think).

Also, from the expression builder (available from global, dynamic and calculated property traits), you will find new some new functions available.

Hello marktb1961,

many thanks for the link.

I will try the new Vassal version soon.

Be well.

Panther 2010 :slight_smile: