Tabletop Simulator

Tabletop Simulator

Not enough ratings
Music Player Extension
2
   
Award
Favorite
Favorited
Unfavorite
Assets: Scripting
Tags: Misc
File Size
Posted
Updated
78.064 KB
2 Jan, 2020 @ 10:59am
13 Nov, 2021 @ 3:49pm
6 Change Notes ( view )

Subscribe to download
Music Player Extension

Description
Many thanks for the awards! Those make me happy :D

This is meant to be an extension to the in-game Music Player.
All songs you want to add to playlists must have one of the following as url:
* a file path to a music file on your disk (this won't work in online games)
* a link to a Steam workshop file
* a direct link to a music file that's hosted elsewhere online.
Note: all music must be encoded in a TTS supported audio format, for example .mp3.

Tutorial videos:
* Creating a playlist - https://youtu.be/XSs5bRM3zIA

Note: By using the Music Player Extension the in-game Music Player's Shuffle, Loop, Previous song, Next Song and Play buttons will break. Use the Music Player Extension UI to control these settings. You must still use the in-game Music Player to mute and control volume or to skip ahead in a song. This functionality is not exposed to Lua so I cannot add this to the Music Player Extension UI.

Scripts are also located in MyScripts folder here:
https://github.com/VultureX/Tabletop-Simulator-Modding

New features:
- Create, play and edit multiple playlists.
- No custom assets required to import music.
- Restart currently playing song with a single button click
- Shuffle, looping and jump to song functionality

Known issues:
- TTS UI does not work when it is in the same place as the Music Player Extension UI.
Will not be fixed, this is a bug in TTS.
- Cannot control volume in Music Player Extension UI.
You can still control volume of the currently playing track with the volume slider in the in-game Music Player. Volume control was not exposed to Lua, so this can't be fixed.

Questions:
Q: Will a Unity asset make things better?
A: I've tried, but this imposes other severe limitations: The playlists would have to be of a fixed size due to limited exposed scripting capabilities. So I can't dynamically add and remove songs. This would make the mod unmaintainable, hard to extend and hard to use. All songs must also be part of the Unity asset, so you wouldn't be able to load from disk or from the web.

Q: Will you add a tablet to be able to play YouTube videos?
A: The tablet has severe limitations. It is not reliable in a multiplayer environment. Pausing a song would be (nearly) impossible and you can't skip ads. The interface is also difficult to use and unreliable so I will not include it in this tool.

Q: Can I transfer playlists between games?
A: Yes! Follow the following steps, assuming you have a game with a Music Player Extensions object with playlists already added:
___1. Right click the blue square that is the Music Player Extensions object
___2. Click copy
___3. Load a different game.
___4. Press Ctrl+V, the Music Player Extension from your previous game will be copied over and placed into the game.
___5. Save your current game.
___6. Reload the current game.
___7. Your music player with playlists is now copied!
26 Comments
ViklasTheMad 16 Jul @ 10:29am 
No, that's not the issue. I definitely have a playlist saved. Two, in fact. I load up one of them, it plays a song or two, then the readout says "no playlist loaded", as if it forgot what playlist was running. I have to manually reload the playlist (via the "Load Playlist" button), then it will play a couple songs and "forget" the playlist again.

I will record a video of it next time and share it so you can see what it does.
VultureX  [author] 16 Jul @ 8:41am 
Probably a silly question, but did you actually create a playlist? If so, maybe you forgot to save the game after creating a playlist? The game must be saved when you make changes to playlists.

You can check which playlists you have in the Music Player Extension UI:
* Click the 'Home' button to return to the main Music Player Extension menu.
* Click the 'Playlists' button
* In the text window on the right it should list your Playlists and the songs in each of them. Or it will print a message that says 'There are no playlists!'

To load an existing playlist:
* Click the 'Home' button to return to the main Music Player Extension menu.
* Click the second button in the menu, the Load <your playlist> button.
If there are no playlists the button will read 'Load Playlist' and when you click on it you'll get the 'There are no playlists!' message in the text window on the right.
VultureX  [author] 10 Jul @ 2:22am 
Okay that sucks :steamsad: I'm not able to reproduce it myself unfortunately (nor have I any idea what might cause it, it's been a while since I looked at this :D). If you have a video or a save game that I can use, maybe I could take another look ^^'
ViklasTheMad 9 Jul @ 6:55am 
No errors in the chat window. Not using the built-in music player. After a few songs, it just forgets a playlist is loaded.

The extension's UI says "No playlist loaded" after loading a song and playing it. But because it thinks there is no playlist loaded, it does not play the next song.
VultureX  [author] 8 Jul @ 1:41pm 
Hmm, I have no clue tbh :rshocked: Is there any error message in the console/chat window? Are you always using the Music Player Extension to play audio or do you also use the built-in Music Player? It's possible that it can't load or find certain songs in the list. If so, an error should show up in the chat window.
ViklasTheMad 6 Jul @ 7:40pm 
So, I don't know what could be causing this issue, but whenever I am working on a map for one of my games, the player works fine. But the second I load up that same saved room with the music player extension, after one or two songs it "forgets" what playlist is loaded and just stops.

Any idea what might be causing this?
VultureX  [author] 25 Jul, 2023 @ 1:15pm 
Hi Катюша, unfortunately I don't have any good recommendations for external sites. People often use Discord servers and plugins such as Kenku FM to have more flexible audio customization. I personally don't have experience with those tools so I can't tell you more :steamfacepalm:
F3RN 20 Jul, 2023 @ 4:42pm 
I suppose there is no way to play youtube or soundcloud. are there any websites you'd recommend for finding specific music encoded in the format that's allowed for the playlist?
Jimbo_D1 23 Oct, 2022 @ 10:55am 
got it, thank you so much
VultureX  [author] 21 Oct, 2022 @ 2:40pm 
Hi Jimbo_D1, it shouldn't be broken. I've quickly created a video for you to demonstrate how playlists are created to play songs. I hope this helps:
https://youtu.be/XSs5bRM3zIA