Is it possible to make an expression like:
Yposition = A 'or' B
in the Expression Editor?
Is it possible to make an expression like:
Yposition = A 'or' B
in the Expression Editor?
Depends on what A or B is in your case.
If you mean 'Alterable Value A or [Object]', or 'Alterable Value B or [Object]', then yes.
Otherwise I don't know what you mean.










Yes, with some preparation you can do it easily.
First set a value to Random(2). It could be a counter or an alterable value.
Then you can use this value in the expression editor like this:
Yposition = (a * RandomValue) + (b * (1 - RandomValue))
You have now two possible scenarios:
If RandomValue was 0, the formula would produce b, as seen below:
Yposition = (a * 0) + (b * (1 - 0)) = b
If RandomValue was 1, the formula would produce a, as seen below:
Yposition = (a * 1) + (b * (1 - 1)) = a
To clarify:
I want 'something' to happen when ObjectAs Yposition = 50 or when ObjectAs Yposition = 100
I know of two ways to do this.
...
( Method 1 )
If ObjectAs Yposition = 50
--> 'something'
If ObjectAs Yposition = 100
--> 'something'
...
( Method 2 )
If ObjectAs Yposition = 50
OR ( logical )
If ObjectAs Yposition = 100
--> 'something'
...
But i am looking for a way to do this in 1 expression, like this:
If ObjectAs Yposition = 50 or 100
--> 'something'
...
Popcorn, your suggestion is interesting but i dont think it will work, since when i generate a random number 'something' will trigger 'only' if Y = A or 'only' if Y = B ( only 1 of the 2 possible scenarios will trigger )










But that was what you were asking for. So what you really want to do, is have one expression for if Y = A or B or C or D or even more alternatives?


King_Cool, there is no way to include an OR operator on a single condition. The only way, as you mentioned, is to create 2 separate events with identical actions or to add an OR (filtered) or OR (logical) to your event between your conditions. Hopefully this feature will be added in MMF3.
Yes, thats what i want to do
...
OK so i went ahead and used this method:
If ObjectAs Yposition = 50
OR ( logical )
If ObjectAs Yposition = 100
It works perfectly, but it also illustrates why im asking about this in the first place:
Its a big event, but the importaint thing is it works.
Y mod 50 == 0
Y > 0
Y <= 100
Actually I just checked and it is possible to do it, on the expression editor just go to misc and you can select Bit-wise OR and that's it.
or just write it OR
+ compare y position "Active" to a value -> equal -> Alterable Value A( "Active" ) or Alterable Value B( "Active" )

That is bit wise or, not logical or. It does a bitwise OR operation on the bits, it doesn't account for there being two different things you want to check against.
Working as fast as I can on Fusion 3