Requested page is not yet translated to the selected language (ไทย). Showing English version.

Storyboard scripting variables

You can strings of text, up to a whole line, as variables for use elsewhere in an .osb file (note that the value can't change during the gameplay, so for those with software experience, think of it more like a constant). .osu files do not support this.


The declaration of variables occurs in the separate [Variables] section of the .osb, located at the top of the file:


You can use the variable in your code by typing the name (left hand side of the declaration, including the $) in your code. For instance, with the above declarations, this:


is treated as this:



Note that variables are carried over when saving in the Beatmap Editor, but all instances of the variable's value will be replaced with the variable. Therefore, you shouldn't make variable too short or general, e.g.:


// ...


Saving will replace the "12"s in colour specification with "$number_of_loops".