Commands and Exports — Dance Machine | Quasar Store | Quasar Store
Documentation
Commands and Exports
Every Dance Machine command — /dancecreator, /dancemusic and the debug tools — plus the server exports for reading songs, machines, records and the global ranking.
Dance Machine registers two admin commands. Players need none: they open a machine with E or the target option.
Command
Permission
Description
/dancecreator
Config.Creator.permission
Opens the admin panel on the Machines tab: place, edit, teleport to and delete machines. The name is Config.Creator.command.
/dancemusic
Config.Music.permission
Opens the admin panel on the Music tab: generate, edit and remove songs. The name is Config.Music.command.
Both permissions default to the ACE command.dancecreator — see Installation for how to grant it. The server checks it again whenever a machine is saved or removed and whenever a song is edited or removed, not only when the panel opens.
How another resource reads Dance Machine — a leaderboard board in your arcade, a Discord bot that posts records, a tournament script. All of them are server-side; there are no client exports.
GetSongCatalog
Every song the server loaded, generated or not, sorted by name.
lua
local songs = exports['qs-dancemachine']:GetSongCatalog()
for _, song inipairs(songs) doprint(song.id, song.name, song.artist, song.bpm, song.duration, song.hasBeatmap)
for _, diff inipairs(song.difficulties) do-- diff.id = 'easy' | 'normal' | 'hard', diff.level = 1-20 stars,-- diff.notes = note count, diff.enabled = offered to playersendend
Only songs with hasBeatmap = true appear on the machines. Each entry also carries file, playStart, playEnd and preview.
GetMachines
Every machine on the server, keyed by id.
lua
local machines = exports['qs-dancemachine']:GetMachines()
for id, m inpairs(machines) do-- m.coords = { x, y, z }, m.heading, m.label,-- m.players = 1 | 2, m.price, m.paymentMethod = 'money' | 'bank',-- m.allowedModes = { 'solo', 'duo', 'versus' } or nil for all,-- m.managed = the owning resource (e.g. 'qs-arcades') or nilend
A machine's id comes from its position, so moving it in the creator gives it a new id.
GetRecords
The server record and the top list of one song on one difficulty. The song id is its file or folder name, as in GetSongCatalog.
lua
local rec = exports['qs-dancemachine']:GetRecords('Neon_Horizon', 'hard')
if rec.serverBest thenprint(('%s holds the record: %d points, %.1f%%, grade %s'):format(
rec.serverBest.name, rec.serverBest.score, rec.serverBest.accuracy, rec.serverBest.grade))
endfor rank, row inipairs(rec.top) do-- row.name, row.score, row.accuracy, row.max_combo, row.gradeend
top holds Config.Leaderboard.topLimit rows. serverBest is the whole score row, including the judgment counts ( … ) and , or when nobody has played it yet.
GetGlobalTop
The server-wide ranking players see in Settings → Ranking.
What the server finds in songs/ right now, without loading anything. Handy to check a file is seen before restarting.
lua
local res = exports['qs-dancemachine']:listSongs()
if res.ok thenfor id, entry inpairs(res.songs) doprint(id, entry.file) -- e.g. 'my_track', 'my_track/song.mp3'endelseprint('cannot read songs/:', res.error)
end
Arcade cabinets
GetManagedMachines() lists, read-only, the machines another resource owns, with how many players can currently see each one.
CreateManagedMachine, RemoveManagedMachine and SetManagedVisible are how Arcade Creator places its cabinets. They only answer calls from qs-arcades; any other resource gets { ok = false, error = 'not_allowed' }.
Whenever the server refuses something — a full machine, a missing permission, not enough money — it answers with a locale key such as notify.machine_full, not a sentence, so each player reads it in the server's language. The keys and what they mean are listed in Common Errors; the wording lives in locales/.
Mouse wheel
Field of view.
TAB
/dancecam: keep this angle and go to the next. /danceplace…: switch which dancer you move.