Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
[Event] changeable battle themes / bgms #124
see here in the forum: https://forum.tuxemon.org/thread.php?pid=971#p971
we could move specific soundtracks (special battle themes and region themes) to the db folder; the main battle theme should stay at res/music
the music should be changeable through events. this might not only be useful for a changing region or when having a boss battle, but also if you have a cutscene where the bgm changes.
a possible solution could be a "music emitter", like the translator object we have.
here is how i imagine it:
a cutscene plays. the character says something drastic.
is something like this useful? is this a good approach?
I like the idea of changing music based on the map or events. If I am understanding correctly, you are proposing to create a set of "music types", where each "music type" refers to a music file somewhere in the database. The actual mapping of "types" to "files" is part of a campaign or theme.
So, its a bit like what we've done with the text and locale? Let me know if I understand correctly.
I like the idea of it, as it would make sharable campaigns more simple in the future. We would have to do an inventory of music types and maybe plan for some future reserved names "end credits", "you lost", type stuff. Eventually, maybe even do the same for sounds, idk. Something to think about.
Maybe @ShadowApex has an opinion about this. Let's suppose after version 0.4 we start "The Great Divide", where we start treating the game engine and campaign separately. Would there be a config file (json?) the defines certain properties of the game?
How about this:
For implementing campaign-specific music, borders, artwork, sounds, etc, we start changing all the internal references to the sound/music/graphic files. Replace the hard-coded values to lookup campaign variables.
Eventually, once we have changed the hard coded values, we will have our first campaign...Tuxemon! After that, it will be less difficult to extend the engine portion of the game.
The unifying answer to all this seems that maps should have the option of running a event/script when they are loaded. At that point they can set game variables like music and what not. I'm not sure if this is available to do now, but it seems simple enough to implement.