I know the general uses for the OR condition, but I've never really paid any attention to the difference between "OR(logical)" and "OR(filtered)". Can anyone clarify what they do, and how to take advantage of their differences? Maybe some examples?
Go into my head, then come back out and tell me I'm wrong.
Suppose Object_A overlaps an obstacle, but Object_B does not.
If you use a logical OR, then MMF2 deletes both Object_A and Object_B.
However, if you use a filtered OR, then MMF2 only deletes Object_A, because only the condition relating to Object_A is true.
If only Object_B overlaps an obstacle, then only Object_B is destroyed; If both overlap an obstacle, then both are destroyed.
The OR operators A new feature has appeared in Multimedia Fusion 2 since build 244 : the OR operators. The OR operators can simplify a lot your program of events by allowing you to group actions on a single line of events.
The OR operator must be inserted in the group of conditions of an event, like this :
+ Condition 1
+ Condition 2
+ Condition 3
+ Condition 4
+ Condition 5
Upon runtime, this group of events will be true when (Condition 1 and Condition 2) is true, OR Condition 3 is true OR (Condition 4 and Condition 5) is true. If any (or several of them) of these groups of conditions is true, the actions are executed. As you can see, the OR operator allows you to group actions in one line of event instead of being obliged to duplicate them on several lines.
Two kinds of OR
Multimedia Fusion 2 provides two kinds of OR operators, the filtered OR and the logical OR. They work differently and you should understand them before doing complex programming. The difference lays in the way the objects are selected by the conditions.
The Filtered OR operator
This is the operator you should use in most of the cases. Imagine the following conditions and actions :
+ Mouse is over object 1
+ Mouse is over object 2
- Destroy object 1
- Destroy object 2
If the mouse is over object 1, then object 1 is destroyed, but object 2 remains there. If the mouse is over object 2, object 2 is destroyed but object 1 remains there. The filtered OR operator explores all the conditions of the event, and marks all the objects as inspected. The objects contained in false condition are marked as well, but the action related to them will not occur. This is the reason why actions in a event with the filtered OR operator will only affect the objects selected in the conditions that are true.
The Logical OR operator
This operator does not mark the objects in false conditions. As the objects are not marked, the default behavior of Multimedia Fusion 2 when it encounters an action dealing with non-marked objects, is to affect ALL the occurences of the given objects. In our example, if we replace the filtered OR by a logical OR, you will have as a result :
If the mouse is over object 1, then both objects are destroyed, if the object is over object 2, then both objects are destroyed. Imagine mouse is over object 1, object 1 is selected. The actions are called. The Destroy object 1 action finds a selected object (the one under the mouse) and deletes it. The Destroy object 2 action find NO selected object: it destroys all the occurences of object 2.
Using either one of the OR operator is up to you, and it depends on the program you are making.
Pretty much - but if you used two separate events, then the actions would run twice if both conditions 2 and 3 were true. If you used an OR then they'd still only run once. You can imagine what would happen if you had an action adding to a counter or something.