Events

From FusionWiki

Jump to: navigation, search

Events are the most basic component of programming in Clickteam products. At the very least, an event contains one or more Conditions, and in order to be of any use, one or more Actions. These conditions and actions may or may not also use Expressions. As of Multimedia Fusion 2, they can also include OR statements.

Each line in a Click program is a single event, and multiple events can be collected into Groups, which may be nested and can be enabled or disabled at will. Although MMF does not currently provide a quick way of disabling individual events, it is still possible by inserting Never conditions (or other conditions that always evaluate to false) or by placing them into a disabled group.

Each event can be likened to an if-statement, and multiple conditions are ANDed unless OR statements are used. Therefore (assuming no OR statements), if at least one condition is false, the entire event is false and its actions will not be executed. A common optimization is to place conditions most likely to be false towards the top of an event to reduce the amount of code it might have run if it turns out to be false.

Contents

Conditions

Conditions are parts of an Event that determines if that event will even run at all. Conditions involve checking the state of objects or values, and make up most of the logic behind a program. There are two types of conditions: False and True .

False

False conditions are evaluated every frame. They must wait for MMF's runtime engine to get to them before they are checked.

True

True conditions (also called triggered or immediate) can break through the normal control flow of the program; basically, they happen immediately (of course, in top-to-bottom order). As they are always false until they are called specifically, it not only makes sense to put them at the top of an event, but it is often required (such as by "On Loop" conditions). As such, it is nonsensical to include more than one of these in a single event, unless they are separated by OR statements (though this is not recommended). In MMF2, they have red text by default, but only if they are at the top of an event.

Actions

Expressions

Personal tools