OpenITG

OpenITG is a derivative build of StepMania 4.0 CVS, 06-19-2005 (also called "StepMania 3.95"). The theming engine is extended somewhat from 3.95's, the details of which are covered here.

Overview
For the most part, OpenITG's theming engine is identical to StepMania 3.95's, and any themes meant for 3.95 will run on OpenITG without modification. However, OpenITG offers several functional extensions over 3.95, including In The Groove's diagnostics calls and some new metrics.

LUA Globals
A global LUA boolean, OPENITG, has been defined as of alpha 7. This can be used to safely wrap OpenITG-specific LUA in a 3.95 theme.

As of beta 1, an additional LUA global number, OPENITG_VERSION, is defined. The version code for beta 1 is 101. Versions earlier than beta 1 do not have an OPENITG_VERSION defined.

LUA object functions
These functions are additional LUA bindings in addition to StepMania 3.95's regular bindings. The build introducing each binding is listed in italics.

General functions

 * (alpha 7) IsUsingMemoryCard(pn) - introduced in alpha 7. Returns true if the given PlayerNumber is using a memory card.
 * (beta 1) SecondsToMMSS(number) - returns a string in MMSS format, e.g. 135 -> "02:15".
 * (beta 1) SecondsToHHMMSS(number) - returns a string in HHMMSS format, e.g. 7825 -> "02:10:25".
 * (beta 1) SecondsToMSSMsMs(number) - returns a string in MMSSmm format, e.g. 389.34 -> "6:29.34".

Actor functions

 * (beta 2) addcommand(name, cmd) - adds 'cmd' command using 'name' name. Pretty simple, yeah?

Course functions

 * (beta 1) GetCourseDir - returns the directory of the course file.

Game functions

 * (beta 2) GetName - gets the name of the given game.

GameState functions

 * (beta 1) DelayedGameCommand(command) - applies the command on the next Update. Required for theme switching.
 * (beta 2) GetCurrentGame - gets a reference to the currently running game.

HighScore functions

 * (beta 2) GetName - gets the name entered for the high score.
 * (beta 2) GetScore - gets the (DDR-style) score for the high score entry.
 * (beta 2) GetPercentDP - gets the dance point percentage for the entry.
 * (beta 2) GetDate - gets a string corresponding to the date the high score was achieved.
 * (beta 2) GetSurvivalSeconds - gets the gameplay time for the high score.
 * (beta 2) IsFillInMarker - returns true if the score name matches the fill-in marker.

HighScoreList functions

 * (beta 2) GetHighScores - returns a table containing the high scores in the given list.

PlayerStageStats functions

 * (beta 2) GetCurrentCombo - returns the current combo.
 * (beta 2) GetScore - returns the (DDR-style) score.
 * (beta 2) GetTapNoteScores(tns) - returns the amount of notes judged 'tns' (TNS_MARVELOUS, etc).
 * (beta 2) GetHoldNoteScores(hns) - returns the amount of holds judged 'hns' (HNS_OK, etc).
 * (beta 2) GetCurrentLife - gets the current life percentage (0..1).
 * (beta 2) GetActualDancePoints - returns the amount of dance points currently obtained.
 * (beta 2) GetPossibleDancePoints - returns the amount of dance points available for the song/course.
 * (beta 2) GetPercentDancePoints - returns GetActualDancePoints / GetPossibleDancePoints.
 * (beta 2) GetPlayedSteps - returns a table containing all the Steps that have been played.
 * (beta 2) GetPossibleSteps - returns a table containing all Steps that were queued to play (for courses).

RadarValues functions

 * (beta 1) GetValue(category) - returns the value of the given category ("RADAR_CATEGORY_TAPS", "RADAR_CATEGORY_ROLLS", etc.)

Song functions

 * (beta 1) IsLong - returns true if the song takes two stages, but not three, to play.
 * (beta 1) IsMarathon - returns true if the song takes three stages to play.
 * (beta 1) IsCustomSong - returns true if the song has been loaded from a user profile.
 * (beta 1) GetGroupName - returns a string containing the name of the group the song is in.
 * (beta 1) MusicLengthSeconds - returns a float value with the length of the song.

StatsManager functions

 * (beta 2) - GetPlayedStageStats(idx) - returns the stage stats from the stage 'idx' ago, e.g. 1 returns one stage before current.

Steps functions

 * (beta 1) GetRadarValues - returns the RadarValues object that the Steps uses

Trail functions

 * (beta 1) GetRadarValues - returns the RadarValues object that the Trail uses

ThemeManager functions

 * (beta 1) GetCurLanguage - returns a string containing the current language
 * (beta 1) GetCurThemeName - returns a string containing the current theme's name
 * (beta 1) GetThemeNames - returns a table with all the themes that ThemeManager can see.

Diagnostic LUA functions
These functions are used primarily in ScreenArcadeDiagnostics with In The Groove 2. All functions are available as of alpha 3.

General functions

 * (alpha 3) GetProductName - returns a string with the product's name and version.
 * (alpha 3) GetUptime - returns the time since start, in HH:MM:SS string format.
 * (alpha 3) GetIP - returns the computer's IP and netmask (not yet implemented in Windows)
 * (alpha 3) GetRevision - returns the revision value set in Data/patch/patch.xml.

Statistics functions

 * (alpha 3) GetNumCrashLogs - returns the number of crashlogs that have been written.
 * (alpha 3) GetNumMachineScores - returns the number of scores (all songs, all play modes) in the machine's profile.
 * (alpha 3) GetNumMachineEdits - returns the number of edit files in the machine's profile.

Arcade-specific functions

 * (alpha 3) HubIsConnected - returns whether or not a USB hub is connected to the computer.
 * (alpha 3) GetSerialNumber - returns the serial number on the arcade dongle.
 * (alpha 3) GetNumIOErrors - returns the number of I/O errors registered by ITGIO's input driver.
 * (alpha 3) GetInputType - returns, in string format, which arcade I/O driver is loaded ("ITGIO" or "PIUIO").
 * Note: In OpenITG, if neither is loaded, this is set to "Home".

CodeDetector

 * (beta 1.1) OptionsListOpen1/OptionsListOpen2 - opens the OptionsList, if enabled, on ScreenSelectMusic
 * (beta 1.1) LinkedMenuSwitch1/LinkedMenuSwitch2 - switches between linked menus, such as on ScreenUserPacks.

Combo

 * (beta 1) MissComboCommand - command played on the Combo graphic whenever a miss combo occurs.

ScreenGameplay

 * (alpha 7) CompareScores'' - sets whether the below commands are played or not. By default, this is set using a LUA script.
 * (alpha 7) ScoreP1AheadCommand - command played on Player 1's ScoreDisplay when they have a better score.
 * (alpha 7) ScoreP2AheadCommand - same as above, but for Player 2.
 * (alpha 7) ScoreP1BehindCommand - command played on Player 2's ScoreDisplay when they have a worse score.
 * (alpha 7) ScoreP1BehindCommand - same as above, but for Player 2.

Note:
 * These metrics are not played unless there are two players, for obvious reasons.
 * If both players are tied, then the "Ahead" command is played on both players' ScoreDisplays.

ScreenSelectMusic

 * (beta 1) UseOptionsList - sets whether the OptionsList is used to select modifiers or not.