群星
ParaWikis
最新百科
都市天际线2百科
英雄无敌3百科
维多利亚3百科
奇妙探险队2百科
罪恶帝国百科
英白拉多:罗马百科
热门百科
群星百科
欧陆风云4百科
十字军之王2百科
十字军之王3百科
钢铁雄心4百科
维多利亚2百科
ParaWikis
申请建站
ParaWikis
ParaCommons
最近更改
随机页面
加入QQ群
工具
链入页面
相关更改
特殊页面
页面信息
页面值
阅读
编辑
编辑源代码
查看历史
讨论
编辑“
模组创作教程
”(章节)
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
=== Localisations === ==== Localisation files ==== [[File:VSCode CWTools localisations.gif|right|Generating missing localisation keys with CWTools.]] {{Main|Localisation modding}} Useful console commands: reload text – reloads localisation table. switchlanguage english – switches used language and reloads localisation table. CWTools highlights keys which are missing localisations, you can see full list of potential issues at the bottom of VSCode window: Localisation key tutmod_civic is not defined for English Localisation key tutmod_civic_desc is not defined for English We need to create a localisation folder structure. Create <code>\localisation\english\</code> folders inside root mod folder first, and then create <code>tutmod_l_english.yml</code>. VSCode will automatically encode file in UTF8 with BOM which Stellaris localisation files need. Both VSCode and Notepad++ are able to easily change file encoding if needed. Localisation files require language declaration in the first line. Simply write: l_english: Supported language declarations are: braz_por english french german polish russian simp_chinese spanish We have file prepared. Switch back to <code>tutmod_civics.txt</code> tab, '''right mouse click > Command Palette > Generate missing loc for all files'''. Copy generated strings into loc file. We will fill the placeholders with the following information: <syntaxhighlight lang="yaml"> l_english: tutmod_civic: "Semper Exploro" tutmod_civic_desc: "This society prioritised scientific exploration over military expansion in the early space age." tutmod_civic_effects: "Start with a $science$ and assigned $scientist$ instead of $OUTLINER_FLEETS$."</syntaxhighlight> Note the '''$''' signs which can be used to refer to other localisation key, be it existing in game or modded one. You can view vanilla keys directly in <code>SteamLibrary\steamapps\common\Stellaris\localisation\english\</code> . Due to the way Stellaris localisations work, there is no way to set up a fallback localisation for other languages to use. If you generate localisations for English only, users playing the game in other language will see a raw key name, ie. <code>tutmod_civic</code>. We have to copy the localisation file <code>\localisation\english\tutmod_l_english.yml</code> to the corresponding language folders, change file name, and adjust language declaration at the beginning of the file: \localisation\english\tutmod_l_braz_por.yml \localisation\english\tutmod_l_english.yml \localisation\english\tutmod_l_french.yml \localisation\english\tutmod_l_german.yml \localisation\english\tutmod_l_polish.yml \localisation\english\tutmod_l_russian.yml \localisation\english\tutmod_l_simp_chinese.yml \localisation\english\tutmod_l_spanish.yml With an example tutmod_l_braz_por.yml containing: <pre>l_braz_por: tutmod_civic:0 "Semper Exploro" tutmod_civic_desc:0 "This society prioritised scientific exploration over military expansion in the early space age." tutmod_civic_effects:0 "Start with a $science$ and assigned $scientist$ instead of $OUTLINER_FLEETS$."</pre> Advantage of using '''$''' signs to reference other keys is that we do not have to translate string multiple times, game will automatically pull the content for the language user plays on. This might not always result in a grammatically correct sentence, it usually works best with the key being used in nominative case. ==== Custom tooltips ==== Game automatically generates localisations for things like tooltips based on effects in the game. For civics it means we do not have to write what effect civic has, as the game will pull all modifiers we wrote and generate sentences, ie. having below in civic definition: <pre>modifier = { country_unity_produces_mult = 0.15 }</pre> will result in the following in the effects tooltip: Monthly Unity: +15% Sometimes we want to add a text for more effects. We will reference <code>tutmod_civic_effects</code> in the <code>tutmod_civics.txt</code> file for <code>tutmod_civic</code> and swap modifier while we are at it. <pre># modifier = { # country_unity_produces_mult = 0.15 # } description = "tutmod_civic_effects" modifier = { ship_science_cost_mult = -0.25 }</pre> Tutorial civics file should now look as below: [[File:Tutmod civic tooltip no gfx.png|thumb|right|Tutorial civic tooltip without icon.]] <syntaxhighlight lang="Ruby"> # civic_beacon_of_liberty = { tutmod_civic = { potential = { ethics = { NOT = { value = ethic_gestalt_consciousness # No gestalt. } } # authority = { # NOT = { # value = auth_corporate # } # } } possible = { authority = { value = auth_democratic } ethics = { OR = { text = civic_tooltip_materialist value = ethic_materialist value = ethic_fanatic_materialist } OR = { text = civic_tooltip_egalitarian value = ethic_egalitarian value = ethic_fanatic_egalitarian } NOR = { text = civic_tooltip_not_xenophobe value = ethic_xenophobe value = ethic_fanatic_xenophobe } } } random_weight = { base = 5 } description = "tutmod_civic_effects" modifier = { ship_science_cost_mult = -0.25 } # modifier = { # country_unity_produces_mult = 0.15 # } } </syntaxhighlight>
摘要:
请注意您对群星百科的所有贡献都被认为是在知识共享署名-非商业性使用-相同方式共享下发布,请查看在
群星百科:版权
的细节。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源。
未经许可,请勿提交受版权保护的作品!
为防止机器编辑,请完成下方验证
取消
编辑帮助
(在新窗口中打开)
该页面属于1个隐藏分类:
Category:含有受损文件链接的页面
×
登录
密码
记住登录
加入群星百科
忘记密码?
其他方式登录