Wesnoth Music Player [Modification]

Discussion of all aspects of multiplayer development: unit balancing, map development, server development, and so forth.

Moderator: Forum Moderators

Post Reply
User avatar
Pentarctagon
Project Manager
Posts: 5564
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Wesnoth Music Player [Modification]

Post by Pentarctagon »

This add-on will play songs from Wesnoth core and, depending on what you have installed, from the add-ons UMC Music Book 1-12 as well as West's Chronicles I and II. To add any other songs, convert them to the .ogg format and drop them into *wesnoth directory*/data/core/music. You can listen to these songs once through, loop them, and create playlists that persist between scenarios. The UI also allows a small degree of customization.

This should be usable (as of some point in 1.13) as a Modification in Campaigns, Single Player, and Multiplayer.

The version for stable Wesnoth is updated until new features are added which are only available for the development version, at which point the stable version of the add-on will not receive any more updates, though fixes will be made if somebody reports a bug. The version uploaded to the development add-on server tracks the latest revision in Wesnoth's github repository, and I make no promises regarding proper functionality otherwise.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
ForestDragon
Posts: 1770
Joined: March 6th, 2014, 1:32 pm
Location: Ukraine

Re: Wesnoth Music Player [Modification]

Post by ForestDragon »

nice mod you made there, may i suggest, like a folder in the add-on itself called, maybe custom_music (because hacking into core isn't the kind of stuff most people are going to do)
My active add-ons: The Great Steppe Era,XP Bank,Alliances Mod,Pestilence,GSE+EoMa,Ogre Crusaders,Battle Royale,EoMaifier,Steppeifier,Hardcoreifier
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
User avatar
Pentarctagon
Project Manager
Posts: 5564
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Wesnoth Music Player [Modification]

Post by Pentarctagon »

It's not really hacking, it's just copy/pasting into the folder. Also as I understand it, updating an add-on will remove the existing add-on files/folders entirely, so it would remove the custom_music folder as well.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Re: Wesnoth Music Player [Modification]

Post by vghetto »

I couldn't get this to work, I kept getting errors

The first error happens when I don't have all UMC music books installed.

Code: Select all

20200416 00:47:04 error scripting/lua: ~add-ons/Wesnoth_Music_Player/GUI2/data/music_locations.lua:13: bad argument #-1 to 'read_file' (file not found)
stack traceback:
        [C]: in field 'read_file'
        ~add-ons/Wesnoth_Music_Player/GUI2/data/music_locations.lua:13: in main chunk
        [C]: in field 'dofile'
        lua/package.lua:53: in field 'require'
        ~add-ons/Wesnoth_Music_Player/GUI2/_gui2.lua:100: in main chunk
        [C]: in field 'dofile'
        lua/package.lua:53: in field 'require'
        [string "..."]:2: in local 'bytecode'
        lua/wml-tags.lua:272: in local 'cmd'
        lua/wml-utils.lua:145: in field 'handle_event_commands'
        lua/wml-flow.lua:6: in function <lua/wml-flow.lua:5>
So I commented out those folders in music_locations.lua, but then I got this error when I clicked on "Play a playlist" button.

Code: Select all

20200416 00:48:44 error scripting/lua: ...noth_Music_Player/GUI2/functions/playlists_and_songs.lua:17: attempt to index a nil value (field '?')
stack traceback:
        ...noth_Music_Player/GUI2/functions/playlists_and_songs.lua:17: in upvalue 'select_playlist'
        ...noth_Music_Player/GUI2/functions/playlists_and_songs.lua:35: in local 'set_playlists_on_ui'
        ...noth_Music_Player/GUI2/functions/playlists_and_songs.lua:71: in function <...noth_Music_Player/GUI2/functions/playlists_and_songs.lua:1>
        [C]: in field 'show_dialog'
        ~add-ons/Wesnoth_Music_Player/GUI2/functions/open.lua:3: in function <~add-ons/Wesnoth_Music_Player/GUI2/functions/open.lua:2>
        [C]: in field 'show_dialog'
        [string "..."]:3: in local 'bytecode'
        lua/wml-tags.lua:272: in local 'cmd'
        lua/wml-utils.lua:145: in field 'handle_event_commands'
        lua/wml-flow.lua:6: in function <lua/wml-flow.lua:5>
Edit: Ok, finally figured out what was happening. :oops:
I included the addon Wesnoth_Music_Player_Extras but I left it empty, that was causing the second error.
User avatar
Pentarctagon
Project Manager
Posts: 5564
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Wesnoth Music Player [Modification]

Post by Pentarctagon »

It's been removed from the add-ons server - I haven't used it in a while, and I don't really have any interest in maintaining it anymore.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
Post Reply