Run:

What is run?

Run is where you tell KM3 how to build your script using the objects you have declared.

How do I use run?

Add "Run" followed by "{}" to the script.

Run {}

To apply a Template to an Event, named "blank" and "main" respectively, add "main.blank();" inside run.

Run {
   main.blank();
}

If the Template takes parameters then add them between the brackets, seperated by a comma.

Run {
   main.blank(2.5, [cline]);
}

If you make this karaoke and open the script you will notice that all lines come one after another. To make the script easier to read you can add blank lines to the script by adding the "break()" member which is a method of Run.

Run {
   main.blank();
   break();
}

You can also tell KM3 to proccess members only if a condition is met using if statements. In the following example I will use a new Template named "effect".

Run {
   if ([style] == "Romanji") {
      main.effect();
      break();
   }
   else {
      main.blank();
   }
}

You can also call methods from within Run. If I had a Variable named "rnd" I could set its value before it is used.

Run {
   if ([style] == "Romanji") {
      rnd.set([r,2,4]);
      main.effect();
      break();
   }
   else {
      main.blank();
   }
}

An example script can be downloaded here.