Author Topic: Command to make player play music, which does not use GUI  (Read 1810 times)

I know Item_Boombox already exists. ( https://forum.blockland.us/index.php?topic=278054.0 )
What I need is a command that uses an argument after said command to set which music, with no GUI at all.
For example, "/pmusic peaceful" would cause the player to play the Peaceful music on loop. A command without an argument would stop the music.
I need this specifically to use in tandem with a server command keybind mod to quickly change player music on the fly. The reason as to why I need all this is complicated and not important.

I imagine this would be very simple to do with code, but the problem is that I'm not very familiar with torquescript. I don't know what that would look like.
My first thought was to reference script_advancelight ( https://forum.blockland.us/index.php?topic=82651.0 ) and edit item_boombox, which also uses an argument involving the UI name of the item to set it, rather than a GUI.
So could someone with more experience than I help me out with this?


"No GUI"

brother what
? he literally explained exactly how it was going to work.

will look into it
(and oh hey, this is the one I put together in the first place lol)

edit: what should the command be?  or should it just overwrite the existing command
or should it be "/boombox <music>" to set music, "/boombox" to disable music, "/boombox" opens the GUI if no music is playing?
« Last Edit: October 21, 2017, 09:49:55 AM by phflack »

Thanks! The help is appreciated.

will look into it
(and oh hey, this is the one I put together in the first place lol)

edit: what should the command be?  or should it just overwrite the existing command
or should it be "/boombox <music>" to set music, "/boombox" to disable music, "/boombox" opens the GUI if no music is playing?

"/boombox <music>" to set music, and "/boombox" to either disable or open the gui, and "/boombox none" to disable. Since the mod I'm using just lets you bind any chat command, the second part doesn't matter too much to me- typing time isn't an issue. But it'd probably be more convenient for general release if you used "/boombox" to open gui and "/boombox none" to disable.
Sorry if that was a late reply btw!

added a bit to it
if you have after school special, but are trying to play after the duck, you'll need to use a script/console: commandToServer('boombox', "after the duck");
otherwise it works by matching the music datablock ID (in case you have access to it), full song name (chat command will only enter the first word), or if that fails, looks for a first word match
/boombox was left alone, just added /boombox <song>, none/0 stops music

https://leopard.hosting/dl/cffbn/Item_BoomBox.zip

added a bit to it
if you have after school special, but are trying to play after the duck, you'll need to use a script/console: commandToServer('boombox', "after the duck");
otherwise it works by matching the music datablock ID (in case you have access to it), full song name (chat command will only enter the first word), or if that fails, looks for a first word match
/boombox was left alone, just added /boombox <song>, none/0 stops music

https://leopard.hosting/dl/cffbn/Item_BoomBox.zip
Thank you kindly!