Skip to content

SongSelect

A rhythm game’s song select, with no code: the player moves up and down its songs’ cards (the entity’s children, in order, one for each of its Songs), left and right through the difficulties, hears each song as it’s picked out, and plays it with a press (or a click or a tap on its card); the song and difficulty are kept in the save data and Scene loads, where NoteLanes with a Saved Song and Saved Difficulty play them. What it says about the song picked out (its title, difficulty, notes, best score and grade) are outputs for texts to show.

Part of the Rhythm module: Rhythm games: lanes of notes from a chart (a table of beats and lanes) that scroll to a hit line in time with the music (NoteLanes), each press judged Perfect, Great, Good or Miss against the beat as the player hears it; and Create Note Lanes in the Entity menu, with a song and its chart at three difficulties; a SongSelect to pick a song and difficulty with its best score; and the Rhythm template, a whole rhythm game.

A song’s chart is the table named like it (Music/First Light.wav plays the First Light table), and its best score is the one the lanes kept under BestFrom (their Save Best As). Up and down (the arrows, W and S, the D-pad or the stick) move between the songs and left and right between the difficulties; Space, Enter or the gamepad’s A (its PlayActions) play; Esc, Backspace or B go Back. A click or tap on a card picks it out, and another on the one picked out plays it. Its Cursor is moved over the card picked out.

Works with: NoteLanes (play the song and difficulty picked (in its Scene)); Text (shows its Title, Difficulty, Notes, Best and Best Grade, and each card’s Grade:<song>)

Takes the player’s input only while it has focus (its Controllable): its Focus action hands it the input and takes it from everything else the same player plays.

In a network game, each machine keeps its own entity with this on it: it isn’t sent.

Each is listed as its key in the scene file and the MCP tools, then its kind of value, its default and what it does.

  • songs: lines of text: an array of strings, or one string with line breaks = []. The songs to pick from, in the order of its cards, e.g. “Music/First Light.wav”. Each one’s chart is the table named like it. (Songs, one per row, each a music file in Assets whose chart is the table named like it, e.g. “Music/First Light.wav” (the First Light table). The Inspector lists them a row each with the music picked from the project’s and says which table is each one’s chart.) (Field: its own editor: Songs.)
  • difficulties: lines of text: an array of strings, or one string with line breaks = [“Easy”,“Normal”,“Hard”]. The difficulties to pick from, easiest first: the names the charts’ Difficulty column uses. (Difficulties, one per row (or one, for a single name), as the charts’ Difficulty column names them, e.g. “Easy”, “Normal”, “Hard”. The Inspector picks from the difficulties the charts have.) (Field: its own editor: Difficulties.)
  • scene: text = null. The scene to load as a song is picked, e.g. “Play”: its Note Lanes play what was picked. (Names a scene.) (Field: a name.)
  • back: text = null. The scene Back (Esc, Backspace or the gamepad’s B) goes to, e.g. the title. Empty: Back does nothing here. (Names a scene.) (Field: a name.)
  • saveAs: text = “Song”. A name to keep the song picked under in the save data, e.g. “Song”: a Note Lanes’ Saved Song. (Names a name in the save data: this entity’s own, which other fields can name.) (Field: a name.)
  • saveDifficultyAs: text = “Difficulty”. A name to keep the difficulty picked under in the save data, e.g. “Difficulty”: a Note Lanes’ Saved Difficulty. (Names a name in the save data: this entity’s own, which other fields can name.) (Field: a name.)
  • bestFrom: text = “Best”. The name the lanes keep their best scores under (their Save Best As), to show each song’s best: “Best”. (Names a name in the save data.) (Field: a name.)
  • preview: true or false = true. Plays the song picked out, from PreviewFrom, over and over while it’s picked out. (Field: on or off.)
  • previewFrom: a number = 0. Seconds into each song its preview starts. (Field: a number.)
  • previewVolume: a number = 0.7. How loud the preview plays, 0 to 1, on top of the player’s music volume. (Field: a number.)
  • playActions: text = “Jump, Interact”. The input actions that play the song picked out, separated by commas: Jump is Space and the gamepad’s A, Interact Enter and E. (Names input actions: their names, separated by commas.) (Field: a name.)
  • clicks: true or false = true. A click or a tap on a card picks it out, and another on the card picked out plays it. (Field: on or off.)
  • controllable: true or false = true. Untick it to ignore the player’s keys, clicks and gamepad (its actions still work). Its Focus action ticks it and unticks it on everything else the player plays. (Field: on or off.)
  • delay: a number = 0.5. Seconds after a song is picked before its scene loads, to hear the pick. (Field: a number.)
  • cursor: text = “Cursor”. What’s moved over the card picked out, by name. (Names an entity.) (Field: an entity’s name.)
  • moveSound: text = null. A sound played as the song or difficulty picked out changes. (A sound in Assets, e.g. “Sounds/hit.wav”.) (Field: a sound.)
  • pickSound: text = null. A sound played as a song is played. (A sound in Assets, e.g. “Sounds/hit.wav”.) (Field: a sound.)
  • index: a whole number = 0. The song picked out, from 0. Set by the game (and as it starts, to the one saved last). (Field: a number.)
  • difficultyIndex: a whole number = 1. The difficulty picked out, from 0 (Easy). Set by the game. (Field: a number.)
  • picked: true or false = false. True once a song’s been picked to play: its scene loads after Delay. Set by the game. (Field: on or off.)
  • timer: a number = 0. Seconds until the song’s scene loads, once it’s been picked. Set by the game. (Field: a number.)

What anything can make it do with no code: a Trigger’s do when its message arrives, a Contraptions Wire’s input as its signal comes on, a script’s Game.Do(entity, “Name”).

  • Next. Picks out the next song down (round to the first after the last).
  • Previous. Picks out the song before (round to the last before the first).
  • NextDifficulty. Picks out the next difficulty, a step harder (stopping at the hardest).
  • PreviousDifficulty. Picks out the difficulty a step easier (stopping at the easiest).
  • Play. Plays the song picked out, at the difficulty picked out.
  • Pick (done with a name, its song: a trigger’s with). Picks out the song called song (its title or path) and plays it, as a click on its card twice does.
  • Focus. Gives its entity the player’s input: whatever there and inside it has focus, and everything else the same player plays loses it (a platformer’s player stops on the arrow keys while a board takes them).

What anything can read with no code: a Counter’s, Bar’s or Text’s output, a Contraptions Wire’s output as its signal; Text shows names too, the rest read numbers, true as 1.

  • Title (a name). The song picked out’s title: its file’s name (“First Light”), which its chart is named.
  • Difficulty (a name). The difficulty picked out: “Normal”.
  • Notes (a whole number). How many notes the song picked out has at the difficulty picked out.
  • Best (a whole number). The best score kept for the song picked out at the difficulty picked out (0 before it’s been played).
  • BestGrade (a name). The grade of that best score: “S”, “A”… (empty before it’s been played).
  • Grade (a name, read by a song after a colon, e.g. “Grade:First Light”). The grade of the best score kept for a song at the difficulty picked out, by its title or path: “Grade:First Light”, for a badge on its card. Empty before it’s been played.
  • BestScore (a whole number, read by a song after a colon, e.g. “BestScore:First Light”). The best score kept for a song at the difficulty picked out, by its title or path: “Best Score:First Light”.

Not saved with the scene; scripts read them, and entity_get shows them as live while the game plays.

  • title: text. The song picked out’s title: its file’s name (“First Light”), which its chart is named.
  • difficulty: text. The difficulty picked out: “Normal”.
  • notes: a whole number. How many notes the song picked out has at the difficulty picked out.
  • best: a whole number. The best score kept for the song picked out at the difficulty picked out (0 before it’s been played).
  • bestGrade: text. The grade of that best score: “S”, “A”… (empty before it’s been played).
  • titles: lines of text: an array of strings, or one string with line breaks. Its songs’ titles, one by one, in the order of its Songs.

Scripts use it as SongSelect: its methods, events and values that aren’t saved with the scene.