Tutorials:Conditionals

StepMania allows for the use of conditional metrics, which allows you to check for things such as the current song or the checking the date.

General Things
For those not familiar with conditional metrics, this may seem confusing.

In order to use these, you need to have a  line in your BGAnimation.ini (StepMania 3.9) or a   attribute in your default.xml/default.lua (StepMania 4.0, 5.0/sm-ssc). Alternatively, in StepMania 4, you can check conditionals inside of a function.

Usage
Generally, you want to check if something is true, false, or a certain value. StepMania uses Lua for the scripting in both versions, although the implementation in 3.9 is more rudimentary.

Putting it Together
Now that you know the operators, you can look below to see what conditions you can check. Remember to always put after the Conditional Name, as these are functions.

StepMania 3.9
This will check if the current month is December, January, or February:

This will check if the current song's full title equals "MEI -for X-":

This will check if the best grade is an AAA or better AND if the current second is past 29:

StepMania 5.0/sm-ssc
In the Lua-based theming system, you are expected to abuse functions to provide conditional behavior, though the Condition line is still possible (albeit deprecated). The rarely used BeginCommand can hold conditionals in a function: The code above replicates the  conditional from 3.9.