song¶
What kind of run this is (practice, a fight, a replay, someone watching), how far the song is, and who's singing right now. Read only.
How to use it
Read only. For a script that should only run in some modes there's also the only key of the
event header: only = "fight" / only = "practice".
Time, beat, step and BPM are the built-in values time, beat, step, bpm.
Psych: songLength, getSongPosition(), mustHitSection, isStoryMode · Kade: songPos
Example code¶
-- The camera moves only in fights; practice stays calm.
function onBeat(b)
if song.mode == "fight" then
camera.yaw = b % 2 == 0 ? 2 : -2
end
end
Properties¶
| Property | Kind | Default | |
|---|---|---|---|
| song.fight | switch, read | false |
Whether this is a fight - your own, or one you watch from inside. |
| song.mode | choice, read | "practice" |
"practice", "fight", "replay" (a replay of a fight) or "watch" (watching a fight … |
| song.practice | switch, read | true |
Whether this is practice (the Retro TV). |
| song.replay | switch, read | false |
Whether this is a replay. |
| song.length | number, read | 0 |
The song's length in ms. |
| song.progress | number, read | 0 |
How far it is: 0 at the start, 1 at the end. |
| song.singer | text, read | "none" |
Who sings right now, from the chart's notes within a beat: "player", "opponent", … |
| song.side | text, read | "player" |
The chart side YOU play: "player" (the Boyfriend part) or "opponent". boyfriend / … |
| song.canHeal | switch, read | false |
Whether setHealth / addHealth do something here: only in a … |
song.fight¶
switch song.fight = false
Whether this is a fight - your own, or one you watch from inside.
song.mode¶
choice song.mode = "practice"
"practice", "fight", "replay" (a replay of a fight) or "watch" (watching a fight from inside).
One of: "practice", "fight", "replay", "watch".
song.practice¶
switch song.practice = true
Whether this is practice (the Retro TV).
song.replay¶
switch song.replay = false
Whether this is a replay.
song.length¶
number song.length = 0
The song's length in ms.
song.progress¶
number song.progress = 0
How far it is: 0 at the start, 1 at the end.
song.singer¶
text song.singer = "none"
Who sings right now, from the chart's notes within a beat: "player", "opponent", "both" or "none".
song.side¶
text song.side = "player"
The chart side YOU play: "player" (the Boyfriend part) or "opponent". boyfriend / dad follow it.
song.canHeal¶
switch song.canHeal = false
Whether setHealth / addHealth do something here: only in a fight you play.