變更

跳至導覽 跳至搜尋
建立内容为“<noinclude> == 简介 == 该模板被用在模组:控制台命令以生自动文字链接及为命令文档提供一致的格式。 == 模板参数 == * <sam…”的新页面
<noinclude>
== 简介 ==
该模板被用在[[模组:控制台命令]]以生自动文字链接及为命令文档提供一致的格式。

== 模板参数 ==
* <samp>command</samp> - 命令名;若有别名,使用半角逗号分割。最详尽的名称应当列在首位。
* <samp>params</samp> - 任何参数,用逗号分隔。使用[[Template:T/doc|T模板]]标记必需参数,使用[[Template:O/doc|O模板]]标记可选参数。如果没有参数,则''语法''一行不会显示。
* <samp>desc</samp> - 完整的描述。
* <samp>example</samp> - 任何示例,用半角分号分隔。例子应当包括在代码块中的完整命令(包括"debug")及对预期效果的描述。

== 例子 ==

=== 没有别名、参数、示例的命令 ===
<pre>{{/cmd
| command = everythingshop
| desc = 打开一个包含家具[[目录]]、所有物品、所有可打造物品、所有武器的购物菜单。所有物品均免费。
}}</pre>

{| class="wikitable"
|-
! 命令
! 描述
! &nbsp;
|-
{{{{FULLPAGENAME}}
| command = everythingshop
| desc = 打开一个包含家具[[目录]]、所有物品、所有可打造物品、所有武器的购物菜单。所有物品均免费。
}}
|}

=== 只包含别名的命令 ===
<pre>{{/cmd
| command = clear,ci
| desc = 移除物品栏中的所有物品。
}}</pre>

{| class="wikitable"
|-
! 命令
! 描述
! &nbsp;
|-
{{{{FULLPAGENAME}}
| command = clear,ci
| desc = 移除背包中的所有物品。
}}
|}

=== 包括参数但没有示例的命令 ===
<pre>{{/cmd
| command = backpack
| params = {{t|I:amount}}
| desc = 依指定数量增加背包空间;至多36格。
}}</pre>

{| class="wikitable"
|-
! 命令
! 描述
! &nbsp;
|-
{{{{FULLPAGENAME}}
| command = backpack
| params = {{t|I:amount}}
| desc = 依指定数量增加背包空间;至多36格。
}}
|}

=== 有单个示例的命令 ===
<pre>{{/cmd
|command = bigitem,big,bi,b
|params = {{t|I:itemID}}
|desc = 将指定的可打造物品放入背包。参见[[模组:物品|大型打造品]]以获得物品ID。
|example = <code>debug bigitem 12</code>会给您一个[[小桶]]。
}}</pre>

{| class="wikitable"
|-
! 命令
! 表述
! &nbsp;
|-
{{{{FULLPAGENAME}}
|command = bigitem,big,bi,b
|params = {{t|I:itemID}}
|desc = 将指定的可打造物品放入背包。参见[[模组:物品|大型打造品]]以获得物品ID。
|example = <code>debug bigitem 12</code>会给您一个[[小桶]]。
}}
|}

=== 包含全部要素(别名、多重参数、多重示例)的命令 ===
<pre>{{/cmd
|command = fuzzyitemnamed,fin,f
|params = {{t|S:itemName}},{{o|I:amount}},{{o|I:quality}}
|desc = 将指定物品加入背包。该命令是模糊查询,游戏将遍历物品、可打造物品、家具、武器、靴子、帽子和衣服以求匹配。由于没有可靠方法使用包含空格的物品名称和区分相同名称的不同物品,所以此命令有一些无法获取的物品。可选参数用于配置堆叠数量(默认为1)和品质(默认为0)。
|example = <code>debug fuzzyitemnamed sturg 5 4</code>会给您5条铱星品质的[[鲟鱼]];<code>debug fin galaxy</code>会给您1把[[银河剑]]; <code>debug f grief</code>会给您一件[[裁缝#上衣|"Good Grief"衫]]。
}}</pre>

{| class="wikitable"
|-
! command
! description
! &nbsp;
|-
{{{{FULLPAGENAME}}
|command = fuzzyitemnamed,fin,f
|params = {{t|S:itemName}},{{o|I:amount}},{{o|I:quality}}
|desc = 将指定物品加入背包。该命令是模糊查询,游戏将遍历物品、可打造物品、家具、武器、靴子、帽子和衣服以求匹配。由于没有可靠方法使用包含空格的物品名称和区分相同名称的不同物品,所以此命令有一些无法获取的物品。可选参数用于配置堆叠数量(默认为1)和品质(默认为0)。
|example = <code>debug fuzzyitemnamed sturg 5 4</code>会给您5条铱星品质的[[鲟鱼]];<code>debug fin galaxy</code>会给您1把[[银河剑]]; <code>debug f grief</code>会给您一件[[裁缝#上衣|"Good Grief"衫]]。
}}
|}

</noinclude>
<includeonly>
<!-- parse command and params into arrays -->
{{#arraydefine:com_list|{{{command}}}}}
{{#arraydefine:par_list|{{{params}}}}}
{{#arraydefine:ex_list|{{{example}}}|;}}
<!-- new row with anchor -->
|- id="{{anchorencode:{{#arrayindex:com_list|0}}}}"
<!-- print command and aliases in <samp>, one per line -->
|<samp>{{#arrayprint:com_list|,<br />}}</samp>
||
<!-- Next syntax, if necessary -->
{{#if:{{{params|}}}|''Syntax'': <code>{{#arrayindex:com_list|0}}</code> {{#arrayprint:par_list|&#32;}}|}}
<!-- Then description -->
<p>{{{desc}}}</p>
<!-- Then examples, if necessary -->
{{#if:{{{example|}}}|{{#ifeq:{{#arraysize:ex_list}}|1|
<p>''Example:'' {{{example}}}</p>|
<p>''Examples:''</p><ul>{{#arrayprint:ex_list| |@@@|<li>@@@</li>}}</ul>}}| }}
<!-- The anchor link -->
||[[#{{#arrayindex:com_list|0}}|#]]
|-
</includeonly>
<noinclude>[[Category:模组]]

[[en:Modding:Console_commands/cmd]]
[[ru:Модификации:Команды для отладки/cmd]]</noinclude>
39

次編輯

導覽選單