Object Selection

From Mario Fan Games Galaxy Wiki
 Stub.png This article or section is in need of expansion.

Please add further information.

Object Selection (sometimes called Object Focus) is, like the name implies, a selection of objects. In the case of Clickteam products, it refers to the current group, if any, of objects that will be affected by an event's actions. It is a very important, though abstract, concept, and it is not always intuitive.

All conditions select some number of objects of a specific type. The default selection is ALL objects for each group with an action. Always is an example of an ALL selection. For example:

Always
--> OBJECT - Destroy

will destroy all instances of OBJECT. Other possible selection types are: ONE (only one), MANY (more than ONE, less than ALL), or NONE (zero). Multiple selection types may coexist in one event; MMF/TGF will ultimately use the most restrictive (fewest objects) type. For example:

Always (ALL)
+ X position of OBJECT > 0 (could be any of the four; assume it's MANY here)
+ Pick one of OBJECT (ONE) 
--> OBJECT - Destroy 

this event will only pick one of the objects, because that is the most restrictive condition. However, the other selection types still play a role; the position condition limits the objects that could be selected to those with an X position greater than 0 (the Always condition is technically pointless in this case).

As shown, when MMF/TGF reaches an event, it assumes an ALL selection; it is up to the programmer to narrow down the selection as needed. Similarly to how it assumes ALL, it will expand its selection to cover as many objects as possible as long as the selection still satisfies the most restrictive condition. The latter behavior is what usually causes annoyance in programmers, as it tends to make object instances ignore how closely they themselves follow the conditions, and instead follow the selected group as a whole. Objects referenced indirectly (ones with actions that have no conditions in the event) are also selected with ALL.

Though conditions are generally what sets the selection, there are a few actions that modify the selection, too. The most used and familiar of these is the Create Object action, which selects ONE object (the newly-created one) regardless of the previous selection. This new selection lasts until the event ends. Another is the Start Loop action, which causes MMF/TGF to forget the previous selection and revert back to ALL (ironically, fastloops are a common method of forcing MMF/TGF to select single objects).

NONE selection is also important, and is the default selection for objects that have no actions in a given event. It is also used in the case of a false event (when none of the objects satisfies their conditions). Of course, none of the objects will have their events run.

This concept is, again, extremely important; controlling object selection to perfection requires skill and effort, and can almost be called an art. It is crucial to applying certain traits to multiple object instances (such as gravity).

Qualifiers pose an interesting problem; as each qualifier is treated like a "virtual" object, all objects within that qualifier are considered instances, when that qualifier is referenced. As a result, completely different objects are considered the "same"; something that should affect only one of those objects could possibly affect all of them.