Berserker, talking is easier than coding. Thanks again for bringing us such a great mod and another example of ERM 2.0 implementation.
Just want to confirm if my understanding is right about the json.
Code:
"randomizationIntervalDays": "1", // Interval in days, after each new random file is selected for each basic music theme
"minThemePlaybackTime": "40", // Minimal time in seconds, the theme should be played before being changed to other random theme
"playAltThemesSequently": "TRUE", // If 1, all theme alternatives will be played sequently, as opposed to random theme selection
"shuffleAltThemes": "TRUE", // If 1 and "play_alt_themes_sequently" is 1, alternative themes will be played sequentially, but in shuffled order
My understanding:
1. All these options work for all tracks, instead of "Alterative" tracks. For examples, the same rules will apply on combat01-09 instead of differentiating them for 01-04 and 05-09.
2. "playAltThemesSequently" = "true" means all track would be played with the sequence generated every x days (x is set in "randomizationIntervalDays"). For example, for aitheme01-03 it could be 01, 03, 02 then 03, 01, 02. Playing with the order 01, 02, 01 is never gonna happen (as 01 shouldn't be played again before 03 is played).
3. "shuffleAltThemes" = "true" means all tracks are played with random order. The value here does not matter if "playAltThemesSequently" = "false"
4. "minThemePlaybackTime". Well I believe I understand the description correctly but it doesn't seem to work. Set it to 1, tested on grass, grass01, grass02 and I couldn't figure out the timing the track is switched.
Archer30, I'll probably make 2.0 version, thanks for idea anyway.
Quote:1. All these options work for all tracks, instead of "Alterative" tracks. For examples, the same rules will apply on combat01-09 instead of differentiating them for 01-04 and 05-09.
Regular theme files are considered part of alternatives to select, right.
2. Nope. It means, that each N days next track will be selected. And playlist is ordered by default.
dirt, dirt01, dirt02, dirt03, dirt04.
Before N days pass you'll hear only "dirt", then for a few days "dirt1" and so on.
3. The option forces playlist to be shuffled each time, when we reached its end.
So we get: dirt02, dirt, dirt04, dirt01, dirt03 { here playlist is recreated/reshuffled } dirt04 dirt02 dirtdirt01
4. It's the minimal time a track will be played (in seconds) before it will be allowed to select another alternative track.
Set it to 40 and press "end of turn" a few times. You will notice, that most themes do not change. They are marked for randomization, but will not be changed/reselected until player listens to them enough.
Thanks! Now it's clear. I was very confused actually.
Looks like combat and aitheme have slightly different rules with other tracks. For example, combat music is switched with each battle replay as it does without this mod, ignoring the setting in json.
Right. An exception is made for combat and aitheme. Combat randomization is forced in OnBeforeBattlefieldVisible event. Aitheme track is changed each time the "play" method is called at the end of turn. Both behaviors match original H3 behavior.
Версии 2 мода быть. Почти закончено формирование плелийстов через сканирование Mp3 с подпапками.
Вышла вторая версия мода «Безлимит на музыку»
Текущая версия:
2.0.0
Требует: ERA 3.3+, Erm Framework Mod

Особенности:

Автоматически ищет аудиофайлы для музыкальных тем Героев 3 в каталоге Mp3 и вложенных подкаталогах. Игнорирует числовые суффиксы в именах файлов. Так, "dirt.mp3", "dirt007.mp3" и "dirt1000.mp3" будут добавлены в один плейлист темы "dirt" (грязевая почва).

Гибкий json-файл с настройками.

Интеллектуальное управление переключением треков для обеспечения максимального разнообразия и комфорта.
Скачать
Мод поддерживает следующие настройки:
Code:
"umt": {
"randomizationIntervalDays": "1", // Интервал в игровых днях, после которых нужно при возможности выбрать другую дорожку для каждой музыкальной темы
"minThemePlaybackTime": "40", // Минимальное время в секундах, которое должна проигрываться тема до того, как иметь возможность быть сменённой на другую
"playAltThemesSequently": "TRUE", // Если 1, то темы меняются не на случайную, а последовательно от первого альтернативного трека к последнему в перемешанном плейлисте
"treatCombatThemeSpecially": "TRUE", // Если 1, то боевые дорожки будут сменяться для каждого боя.
"treatAiThemeSpecially": "TRUE", // Если 1, то дорожки ИИ темы будут сменяться каждый раз после хода игрока-человека.
}
Great release
Berserker! But you forgot to disable IF:L and set the mod icon

Archer30, what would I do without you?

Вышло обновление мода «Безлимит на музыку»
Текущая версия:
2.1.0
Требует: ERA 3.3+, Erm Framework Mod

Изменения:

Исправлена обработка ИИ темы.

Исправлено неверное название файла иконки для менеджера модов.

Удалено отладочное сообщение с названием текущей музыкальной темы.

Добавлены две новые опции для контроля того, стоит ли обрабатывать боевые и ИИ темы особенным образом (принудительно переключать треки для каждого боя или хода ИИ) или нет.
Скачать
Вышло обновление мода «ERA»
Текущая версия:
3.3
Требует: «Безлимит на музыку» 2.1.0+, Erm Framework Mod


P.S.:Глянул немного код.
Любопытно мне, насколько сильно нагружает систему ежесекундная проверка настроек? И не повредит ли добавить GetGameState?
P.P.S.: в моде лежит мусорная папка "Mods"
daemon_n, ежесекундная проверка не нагружает вообще. Она реализована корректно. Нагрузка на процессор не изменилась.
GetGameState не нужен от слова «вообще». Музыка работает во всех диалогах, пока выполняются ЕРМ триггеры.
Лишнюю папку удалил, спасибо.
Можно ли реализовать чтобы при долгих битвах не спустя огромное время, а спустя 20 секунд проигрывался другой трек?
Vузыка затихает надолго и в тишине играешь
Hi,
Berserker, I want to tell you that I loved your mod, I embedded it in TUM and it was a success!

Now I can play any kind of additional soundtrack in the game.
V_Maiko, thanks. I still recommend to not embed it and use as standalone mod. As always in Era, it will read mp3 files from all mods directories.