Tabletop Simulator

Tabletop Simulator

评价数不足
Music Player Extension
2
   
奖励
收藏
已收藏
取消收藏
Type: Game
Complexity: Low Complexity
文件大小
发表于
更新日期
83.421 KB
2020 年 1 月 2 日 上午 10:59
8 月 4 日 下午 12:29
8 项改动说明 ( 查看 )

订阅以下载
Music Player Extension

描述
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!
热门讨论 查看全部(1)
3
7 月 31 日 下午 1:35
The music player doesn't work in multiplayer games
VultureX
33 条留言
ViklasTheMad 8 月 10 日 下午 9:11 
This newest update has changed things in the best way. We had another session today, with all hands on deck, and we had no problems at all. Thank you so much for the hard work, I love this extension so much already, and even more so now that it's running smoothly for me in my game :)
VultureX  [作者] 8 月 4 日 下午 12:44 
I've pushed an update that prevents the playlist from being unloaded. It also displays an error message in the chat window for all players to see if something goes wrong with a song. Make sure that if you click the 'About' button, v1.4.0 appears in the text window. I hope this helps!
VultureX  [作者] 7 月 30 日 下午 1:22 
Okay I have an update for you. I did a lot of debugging and testing in multiplayer environment and I was able to reproduce your issue. I put my findings and a workaround in a discussion thread here: https://psteamcommunity.yuanyoumao.com/workshop/filedetails/discussion/1957457372/591778249679380628/
ViklasTheMad 7 月 27 日 下午 7:05 
Thanks! I really appreciate this :)
VultureX  [作者] 7 月 27 日 下午 12:04 
Thank you for the detailed description! I suspect that this bug has something to do with the built-in TTS music player, which I'm not able to change :steamsad:
However, I could take a look at some auto-retry behavior to see if this bug can be circumvented by just trying again. It's possible that new players can't load the audio clip immediately, which may cause playback to fail for everyone. Adding this workaround will take some time and it will be a fix that I'm not able to test myself, but I'm willing to give it a shot :D: I'll keep you posted. :steamthumbsup:
ViklasTheMad 7 月 25 日 下午 5:34 
(Continued from previous comment)

We tried different combinations of players to test this, and with every combination of 2-5 players that has me as the host, the extension ran fine. As soon as we would add that 6th player, however, it would begin to fail.

I don't know if any of this helps, but I am hoping that knowing what causes the issue could lead to a solution. Looking forward to hearing back on this.

As a side note, the game room is saved after every session, as this is a weekly TTRPG.
ViklasTheMad 7 月 25 日 下午 5:33 
So, I wasn't able to get it on video, but I was able to re-create the issue and test some things.

When we started our game, there were only 5 players (myself included) in the room on TTS. Everything was running fine at that time with the music player extension, no issues. This ruled out my first theory, that it was a ping/connection issue caused by geographical distance, as I am in the US midwest, and one of our players that was present is in Poland.

When our late-comer joined (who is in the SW US I might add), making for 6 players in the room, the extension began to struggle and at times fail when attempting to load the next song. It seems player count is the key.
ViklasTheMad 7 月 16 日 上午 10:29 
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  [作者] 7 月 16 日 上午 8:41 
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  [作者] 7 月 10 日 上午 2:22 
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 ^^'