Templates:

What are templates?

You use Templates to modify event lines.

How do I declare a template?

Like with Events, just add "Template" followed by the name you wish to give it (in the following example it's "blank") and finally "{}" to the script.

Template blank {}

The following shows each property set to its default value.

Template blank {
   template { << [s]; }
   start = "";
   end = "";
   linemode = 0; // sl (single line).
   pause = "";
   flags = None;
   clip = null;
   pos = null;
}

You can also pass parameters to templates allowing you to use the same template with different values.

Template notblank (param1, param2) {
   template = [param1][s][param2];
}

Parameters are used just like the other tags and as such should be given unique names. Their values are set when the template is called (usually in Run).

  -template (Template)
  -start (Start Tags)
  -end (End Tags)
  -linemode (Line Mode)
  -pause (Pause Tags)
  -flags (Flags)
  -clip (Clipping)
  -pos (Position)



template (Template)

The template property specifies the template to apply to each syllable.

Use:

template = <String>;
template { << <String>; }

Example: (Using the first 3 syllables of the line "{\k28}ka{\k33}ze {\k44}ga {\k22}i{\k23}ro {\k26}ni {\k22}na{\k23}t{\k67}te" with a default Event.)

"{\bord1}{\t(" + [0] + "," + [0] + ",\bord3)}" + [s] = {\bord1\bord3}ka{\bord1}{\t(280,280,\bord3)}ze {\bord1}{\t(610,610,\bord3)}ga

The two MASS tags used in this basic example are "[s]" and "[<integer>]". You may have noticed I surrounded normal text with quotes. This is to ensure the parser doesn't mistake any brackets and such as part of the script or other tags.

start (Start Tags)

The start tags property specifies a string to add at the start of the line.

Use:

start = <String>;
start { << <String>; }

end (End Tags)

The end tags property specifies a string to add at the end of the line.

Use:

end = <String>;
end { << <String>; }

linemode (Line Mode)

The line mode property specifies the way the script should divide a line up.

Use:

linemode = <Integer> {0, 1, 2};
linemode = <String> {sl, lps, lpc};

sl = single line
lps = line per syllable
lpc = line per character

When the line mode is set to "0" or "sl" all syllables will be on the same line. When the line mode is set to "1" or "lps", each syllable will get its own line allowing you to have horizontal grow effects without moving the other syllables. And when the line mode is set to "2" or "lpc" each individual character gets its own line.

Examples: (Using the first 3 syllables of the line "{\k28}ka{\k33}ze {\k44}ga {\k22}i{\k23}ro {\k26}ni {\k22}na{\k23}t{\k67}te" with a default Event.)

sl:
Line = kaze ga

lps: 
Line = ka
Line = ze 
Line = ga

lps:
Line = k
Line = a
Line = z
Line = e
Line = g
Line = a

pause (Pause Tags)

The pause tags property specifies what to do when there is a pause in the timings. A pause being a timing with no syllable such as the first timing in "{\k30}{\k28}ka". If in single line mode the pause string will be added to the line; otherwise it will just read the tags and execute any methods found.

Use:

pause = <String>;
pause { << <String>; }

flags (Flags)

The flags property specifies certain attributes and condtions to consider when processing the template.

Use:

flags = 0 / flags = none; // Normal state; no flags are set.
flags = 1 / flags = removetags; // Removes all ASS tags except karaoke tags from the line.
flags = 2 / flags = removespecial; // Removes all special characters from the line. Special characters are "\N", "\n", and "\h".

You can set more then one flag by seperating them with an "|".

Example:

flags = removetags | removespecial;

clip (Clipping)

The clipping property specifies the name of the clip object to apply to the template.

Use:

clip = <String>;

pos (Position)

The position property specifies the name of the position object to apply to the template.

Use:

pos = <String>;