I will try to explain this problem as easy as i can.
I have, let's say, a Counter 1, Counter 2 and an Activ object. In the start of the frame Counter 1 and Counter 2 is set to a random value from 1 to 5. If the value of Counter 1 hits 2 or 5 and Counter 2 hits 2 or 4 the activ object should be destroyed.
Now, I could make a long list of conditions: "Counter 1=2 and Counter 2=2", "Counter 1=5 and Counter 2=2" etc. etc... But I don't want that long list, I want a short and easy way to make this work. So, this would be my question:
Is there a condition that may look like this: "Counter 1=2 or 5 and Counter 2=2 or 4">Destroy Activ object 1? The OR-statement doesn't work like this I've noticed, but there have to be an other way. Please help!
Here we use a flag value for each possible 'or' (so if we want '1 or 6', we would have 2 flags. One for if it's 1, and one for if it's 6). We then have an event for each of those flags. They go this way:
counter1 = 1
..Turn flag 0 ON
counter1 = 2
..Turn flag 1 ON
Then we do another event to do the OR command:
Flag Object: OR flags 0 to 1
..[insert actions here]
This basically checks if flag 0 is ON, *or* if flag 1 is ON (or both).
Since this uses several events, you may wonder why you don't just do an event for each choice. Well the reason is that this keeps all your actions in one place.
To illustrate, imagine if we have events to check if the counter = 1 or 3, and set a string object to 'yes'.
counter = 1
...Print: "yes"
counter = 3
...Print: "yes"
But now, suppose I wanna change that to say "flopsy bunnies"
I have to change BOTH events.
But if we did this:
counter = 1
...Flag 0 ON
counter = 3
...Flag 1 ON
Flag Object: OR flags 0 to 1
...Print: "yes"
We have three events instead of two, but if we wanna make changes, we only need to change the last event. Hopefully you'll see how this is much simpler to alter and update.
This is the closest to what you want. This is all within one event. The downside is that - as far as I know - it only compares numbers. So the following would need the first method:
Player's name = 'Fred' OR 'Nancy'
Object1 is visible OR Object2 is visible
Those kinda things would need to be done with the first method.
Thank you for your reply...
There is only one thing - I can't figure out how to use the Cunning object. Perhaps I'm an idiot, perhaps it's a strange tool, I don't know
Cunning Object will only compare numbers. So you can use it with a counter value, an object's coordinates, etc. Anything that's a number.
When you go to insert a condition using Cunning Object, the menu of conditions pops up with the following options:
OR comparisons (A sub-menu with the following conditions)
--OR comparison ( = )
--OR comparison ( < )
--OR comparison ( > )
--OR comparison ( <= )
--OR comparison ( >= )
--OR comparison ( <> )
End OR
Any of those 'OR comparison...' conditions require two values. Think of it like this:
'if A = B...'
Here we have two obvious values: A and B. It's the same with Cunning, except it calls them 'first number' and 'second number'.
The little symbol in brackets ( = ), ( < ), ( <> ), etc, just represents the kind of thing you want to check for. Here is a basic list of what they do:
( = ) If A is equal to B
( < ) If A is less than B
( > ) If A is more than B
( <= ) If A is less than or equal to B
( >= ) If A is more than or equal to B
( <> ) If A is different to B
The way you do an OR comparison is by putting more than one of these conditions in the same event. You then finish it with an END OR condition.
Here's an example. At the start of the level, it generates a random number between 0 and 10. If the counter = 2 or 4, or it's greater than 5, then we play a little sound.
Start Of Frame
-- Counter: Set value to random(10)
Start Of Frame
+Cunning Object: Value("counter") = 2
+Cunning Object: Value("counter") = 4
+Cunning Object: Value("counter") > 5
+Cunning Object: END OR
-- Sound: Play sound 'YAY.wav'
D'you see how that works? It helps if you think of it in a certain way.
Don't think of it as 'if counter = 2, 4, or is more than 5'
Think of it like this:
'if counter = 2' OR
'if counter = 4' OR
'if counter > 5'
Then you'll understand how we lay one comparison on top of another. Then all you need to remember is to have an END OR at the bottom.
I hope that helps, just ask again if there's anything you still don't understand