How to re-randomise a layer until != a specific layer?

So I have this object with 5 layers.

An action button with keypress A
A trigger for key A with {_Active==false} causes 2 key presses - B to activate the layer, C to randomise it.
Various other triggers all activate depending on the layer result, using {
_Level==1} {*_Level==2} triggers etc. and that all works fine.

All I want to do is have another trigger that re-randomizes the layer if the first button press results in a layer that matches the active PlayerSide - each layer represents a character and if the character is the same as the player it is no good.

However, every combination triggers and calculated properties using GetProperty(PlayerSide) and _Level== triggers that I’ve tried either results in infinite loops or nothing happening and I’m confused. Specifically, triggers using the condition {GetProperty(PlayerSide)==&&_Level==*} seem to always activate, regardless of the initial layer result.

Say the PlayerSide is Adam, the layer property is called player and the layer that is also Adam is Level 1:
A trigger that performs key press C that only activates when properties match {GetProperty(PlayerSide)==Adam&&player_Level==1} and key C is pressed (ie the Action button is pressed) surely should activate only when the PlayerSide is Adam and and Level 1 is randomised?

Any help?

Your problem might be some missing quotes around the player side names:
try {(PlayerSide==“Adam” && player_Level==1) || … }

Without quotes, Adam is believed to be a variable and is evaluated as 0.
(there are no quotes in the “native” syntax, without braces: PlayerSide = Adam && player_Level = 1)

I tried the trigger condition with quotes and it works! Thanks for the tip! Until now I’d been using “” for {} conditions, but only because the names had spaces in them. I hadn’t realised it was always required.

The syntax of expressions inside the {} is (almost) EXACTLY the same as the Java Programming language, so you can look up a basic Java tutorial for ideas. All Strings must be within double quotes. Variable name must be either unquoted, or if they have a space in them, use GetProperty(“variable name with spaces”).