Go to content

Main menu:

Immediate Conditions in Multimedia Fusion 2 and Clickteam Fusion

Last Updated: September 10th, 2013
Installing Multimedia Fusion 2 or Clickteam Fusion is extremely straightforward process. Go through the installer file and within minutes you'll start software development. For those who want some help through the installation process, below is a small quick guide on how to install Multimedia Fusion 2 and Clickteam Fusion.

Quick Links:
Background Knowledge

Ever wondered how MMFusion and other programs read their code? Programming languages, similar to natural languages such as English, Arabic, and Japanese, are read in a certain way. English, for example, reads from left to right and then top to bottom, while Arabic is read from right to left and top to bottom, while some Japanese text is read only from top to bottom! This idea applies to programming languages. The output from Multimedia Fusion 2 is some form of C++, Java, Javascript, or Flash; all of which are read from left to right then top to bottom. So it makes sense that MMFusion applies this concept in the Event Editor. The Event Editor and Event List Editor are read from top to bottom. The frames per second of the application is the maximum number of event frames MMFusion executes within one realtime second. A key question that comes to mind is what the definition of an event frame is. In MMFusion, an event frame occurs after MMFusion processes all of the regular events in the Event Editor.

Now you know that an event frame happens after all the events in the Event Editor execute. What happens though if you need to execute a series of actions within one frame, such as find the number of enemies with full HP? In these scenarios, you will use immediate events such as fastloops or ForEach loops. This guide will explain immediate events, the uses of fastloops and ForEach loops, and special properties of immediate events.

Immediate Events

Immediate conditions, also called triggered events, are not checked every frame. Specific actions need to occur before these conditions trigger such as a collision between two objects (for this reason, immediate conditions cannot be negated. When this trigger happens, MMFusion pauses Event Editor and looks for any immediate events that match the trigger event. If any of these conditions match, the event(s) execute like normal conditions. If none match or all the checks have finished, MMFusion will resume where it left off in the event loop.

The Fastloop condition
Varios examples of MMF2 Events
Examples of immediate conditions and regular conditions
Did You Know
Did you Know?

As previously mentioned, fastloops are a special type of immediate condition. Fastloops are primarily used to:

  • Perform numerous calculations within one frame

  • Group, organize, streamline, and clarify code

  • Create callable functions within MMFusion

The concept of fastloops is simple:

  1. You manually create and call a fastloop a specified amount of times

  2. When MMFusion calls the fastloop, MMFusion immediately searches for all events that have the called fastloop name

  3. If any events are found, MMFusion tries to execute the event

  4. After a given number of iterations, either you manually end the fastloop or MMFusion end it

  5. MMFusion resumes where it left off in the Event Editor

Quick Tip

Order fastloops and ForEach loops into groups based on their name or function. Keep these groups deactivated until you need them. By using this technique, the application perform faster!

Example of using group manipulation to increase performance

ForEach Loops

One of the most troubling issues with fastloops is fastloops have a hard time with object selection and object iteration. Fastloops do not naturally iterate through object instances. To do iteration, you used to have to spread a value (lets say ID) through the objects, run a fastloop X amount of times, compare this ID to the index of the fastloop, and hope that the object selection goes perfect. A lot of work just to iterate through some objects right? Now, this can be done with the ForEach Loop.

The ForEach Loop can be considered a specialized form of the fastloop used primarily for object iteration. It works in the same manner as regular fastloops with one major difference; the ForEach loop will take any objects in the current 
MMFusion object selection, and iterate through them with no need of complicated spread values or order-perfect condition manipulation.

As a bonus, you can add individual objects to groups which can then be used for your purposes. In Multimedia Fusion 2, you need to use the ForEach Loop extension to use ForEach loops. With introduction of Clickteam Fusion, this extension was natively integrated into the program

Ending Remarks

So we now know about immediate conditions, fastloops, and ForEach loops. Now what? The example file located in the introduction contains numerous examples of the uses, advantages, and disadvantages of these three concepts. Take a deep thorough look through each frame to find out how immediate conditions, fastloops, and ForEach loops are used.

Rate This Tutorial
Vote: 5.0/5
If you have read this tutorial, rate it from poor (1) to average (3) to great (5)!
Back to content | Back to main menu