王国风云2
ParaWikis
最新百科
都市天际线2百科
英雄无敌3百科
维多利亚3百科
奇妙探险队2百科
罪恶帝国百科
英白拉多:罗马百科
热门百科
群星百科
欧陆风云4百科
十字军之王2百科
十字军之王3百科
钢铁雄心4百科
维多利亚2百科
ParaWikis
申请建站
ParaWikis
ParaCommons
最近更改
随机页面
加入QQ群
工具
链入页面
相关更改
特殊页面
页面信息
页面值
帮助
译名手册
字词转换
编辑指南
编辑规范
练手沙盒
资助我们
ParaTranz
资助我们
×
欢迎访问王国风云2百科!
注册一个账号
,一起参与编写吧!这里是
当前的工程
。
全站已采用新UI,任何使用上的问题请点击
这里
。欢迎所有对百科感兴趣的同学加入QQ群:
497888338
。
阅读
查看源代码
查看历史
讨论
查看“音乐模组制作”的源代码
←
音乐模组制作
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{version|2.7}} It is fairly simple to add or change music in Crusader Kings II. Two things are needed in the ''Crusader Kings II\music'' folder: * a music file, saved in the [[wikipedia:Vorbis|Vorbis (.ogg)]] format (.mp3 is not supported) * a definition file, saved in .txt format, referencing the music file. ==Music file== To convert to ogg format, [[wp:VLC media player|VLC media player]] can be used: *In ''Media'' menu, select ''Convert / Save...'' *Click ''Add'' to select the music file (note: only supports one song at a time) *Click ''Convert / Save'' *Select profile ''Audio - Vorbis (OGG)'' *Click ''Browse'' to select a destination file *Click ''Start'' and wait for encoding to finish As of patch 2.7x the sample rate has to be 44100 Hz, as otherwise songs have a scratchy sound or don't seem to play in game anymore. ==Definition file== In the base game the music files are defined in ''songs.txt'', which is located in the ''Crusader Kings II\music'' folder. Music which is added by [[DLC]]s such as ''[[Music#Hymns of Abraham|Hymns of Abraham]]'' or ''[[Music#Songs of the Caliph|Songs of the Caliph]]'' is defined in a ''.txt'' file within the ''music'' folder of [[DLC files|DLC's zip file]]. Songs are defined using a similar system to [[Event modding|events]]. The simplest are those found in the base game, and look something like this: song = { name = "crusaderkings2_maintitle.ogg" song_name = "Crusader Kings 2 Maintitle" chance = { modifier = { factor = 1 } } volume = 0.48 } Each song has: * a <code>name</code>, which corresponds to the ''.ogg'' file being used. * a <code>song_name</code>, which can be displayed to the player * a <code>factor</code> within a <code>chance</code> clause which defines how likely it is to be played. Songs in the base game all carry a factor of 1, while those added in DLCs tend to have a larger factor (thus making them play more often). * a <code>volume</code> to adjust the audio level. No music on start issue/bug since 2.7x: *The songs.txt file inside the music folder requires a different name than the original (simply asongs.txt will do) or there won't be music during load/start, unless you replace the folder. *If you do use replace_path for the music folder in your *.mod file, then the opening song crusaderkings2_maintitle needs to be mentioned inside the songs.txt file, which wasn't the case before that patch. ===Music scripting=== It is possible to change the probability that a song will play based on certain conditions. Most of the music-based DLCs add music which is exclusive to a particular culture/culture group or religion/religion group. This is achieved by adding conditions to the modifier clause. For example, the song ''England Anno 1066'' from the ''[[Music#Songs of Albion|Songs of Albion]]'' DLC uses the following code: song = { name = "englandanno1066.ogg" chance = { factor = 2 modifier = { factor = 0 NOT = { culture = english } NOT = { culture = saxon } } } } This gives it a probability factor of 2 (i.e. makes it twice as likely to play as a track in the base game), but restricts it to only play when the player's character is either English or Anglo-Saxon by multiplying the factor by 0 when that is not the case (2 × 0 = 0). The [[conditions]] used are the same as those used in events, so can be incredibly elaborate or be based on very specific triggers. The free ''[[Music#Songs of Yuletide|Songs of Yuletide]]'' DLC uses the clause <code>NOT = { real_month_of_year = 11 }</code> to reduce the chance to 0 in any month other than December. The songs in ''[[Music#Songs of the Holy Land|Songs of the Holy Land]]'' each carry two modifier clauses: one multiplies the base factor (in this case 5) by 0.1 (5 × 0.1 = 0.5) if there is not currently a crusade; the other multiplies it by 2 (5 × 2 = 10) if there ''is'' a crusade and the player is currently in the target kingdom (e.g. leading troops in the crusade or is in their capital, which is within the target kingdom). song = { name = "ascalon.ogg" chance = { factor = 5 modifier = { factor = 0.1 has_called_crusade = no } modifier = { factor = 2 crusade_target = { ROOT = { location = { kingdom = { title = PREVPREVPREV } } } } } } } ==External links== *[[forum:593803|Adding Own Music Mini-Tutorial]] {{ModdingNavbox}} [[Category:模组制作]] [[en:Music modding]]
本页使用的模板:
Template:Clear
(
查看源代码
)
Template:ModdingNavbox
(
查看源代码
)
Template:Navbox
(
查看源代码
)
Template:Navboxgroup
(
查看源代码
)
Template:Version
(
查看源代码
)
返回
音乐模组制作
。
×
登录
密码
记住登录
加入王国风云2百科
忘记密码?
其他方式登录