称号模组制作:修订间差异

本页面所适用的版本可能已经过时,最后更新于3.2
(创建页面,内容为“{{version|3.2}} Nicknames are epithets defined in files in the <code>common/nicknames</code> folder. Any nickname defined in one of these files can be added us…”)
 
(渣翻了一下)
 
(未显示2个用户的3个中间版本)
第1行: 第1行:
{{version|3.2}}
{{version|3.2}}


[[Nickname]]s are epithets defined in files in the <code>common/nicknames</code> folder.
[[ 称号]] 是在 <code>common/nicknames</code> 文件夹中定义的。


Any nickname defined in one of these files can be added using the <code>give_nickname</code> [[commands|command]]. They can also be granted at random based on conditions defined on the nicknames.
任何被定义在这些文件中的称号都可以用 <code>give_nickname</code> 命令([[commands|command]] )来添加。 根据被定义的条件,它们也可以被随机地授予。


== Definition ==
== Definition ==
第14行: 第14行:
!<code>allow</code>
!<code>allow</code>
|[[Conditions]]
|[[Conditions]]
|Optional. The conditions a character must fulfill to be eligible to receive the nickname randomly. If missing, nickname can only be obtained with the <code>give_nickname</code> command.
| 可选。 一个角色随机接收称号必须满足的条件。如果缺少,则只能使用give_nickname命令获取昵称。
|<pre>allow = {
|<pre>allow = {
    age = 16
    age = 16
第21行: 第21行:
!<code>chance</code>
!<code>chance</code>
|[[MTTH]]
|[[MTTH]]
|Optional. The odds of an eligible character receiving the given nickname (presumably in percent per year). If missing, nickname can only be obtained with the <code>give_nickname</code> command.
| 可选。 符合条件的角色获得给定称号的几率(大概是每年百分比)。如果缺少,则只能使用give_nickname命令获取昵称。
|<pre>chance = {
|<pre>chance = {
    factor = 5
    factor = 5
第34行: 第34行:
== Localisation ==
== Localisation ==


Nicknames take their localization from a key with the same name as the nickname. For example, the nickname <code>nick_the_swift</code> would look for the localization key also called <code>nick_the_swift</code>. Nicknames typically begin with <code>nick_</code>, but this is not enforced. For nicknames which use localization commands, those commands are only evaluated when the nickname is handed out - a nickname will not change after it's been obtained.
称号从与称号同名的密钥中获取本地化信息。例如,称号<code>nick_the_swift</code> 将会查找也叫做 <code>nick_the_swift</code> 的本地化密钥。称号通常以 <code>nick_</code> 开头,但这并不是强制的。


[[Category:Modding]]
对于使用了本地化命令的称号,这些命令只会在称号授予的时候进行评估——在获得了称号之后将会不作更改。
 
[[Category: 模组制作]]
{{ModdingNavbox}}
{{ModdingNavbox}}
[[en:Nickname modding]]

2021年3月19日 (五) 13:39的最新版本


称号 是在 common/nicknames 文件夹中定义的。

任何被定义在这些文件中的称号都可以用 give_nickname 命令(command)来添加。 根据被定义的条件,它们也可以被随机地授予。

Definition

Name Type Description Example
allow Conditions 可选。 一个角色随机接收称号必须满足的条件。如果缺少,则只能使用give_nickname命令获取昵称。
allow = {
    age = 16
}
chance MTTH 可选。 符合条件的角色获得给定称号的几率(大概是每年百分比)。如果缺少,则只能使用give_nickname命令获取昵称。
chance = {
    factor = 5

    modifier = {
        factor = 2
        stewardship >= 8
    }
}

Localisation

称号从与称号同名的密钥中获取本地化信息。例如,称号nick_the_swift 将会查找也叫做 nick_the_swift 的本地化密钥。称号通常以 nick_ 开头,但这并不是强制的。

对于使用了本地化命令的称号,这些命令只会在称号授予的时候进行评估——在获得了称号之后将会不作更改。