> For the complete documentation index, see [llms.txt](https://hamsterbaron.gitbook.io/hamsterbaron/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hamsterbaron.gitbook.io/hamsterbaron/augment-guide/flashlight.md).

# 手电配件 / Flashlight

## 将配件设为手电筒

仅需简单的几步便可将一个配件设置为手电筒类型。首先，在任意配件的配件数据文件中配置如下示例的字段，即可让程序将该配件视为一个可作用的手电筒配件。

```json
{
  "weight": 0.1,     //配件数据的其他部分
// Other Configs..
  "extras": {        //由 Arcana 提供的特殊属性
    "flashlight": {
      "enable": true,
      "luminance": 1.0,
      "angle": 30.0,
      "range": 32.0
    }
  }
}
```

该`extras`属性是一个顶层键，与`weight`这类顶层属性处于同一级。子属性`flashlight`即为手电筒数据的配置部分，其中四个键值对的含义如下所示：

<table><thead><tr><th width="116.20001220703125">属性名</th><th width="195">合法值类型</th><th>说明</th></tr></thead><tbody><tr><td><code>enable</code></td><td><code>boolean</code>  布尔类型值</td><td>是否将配件设置为手电筒</td></tr><tr><td><code>luminance</code></td><td><code>double</code>  浮点数</td><td>发光强度，决定手电筒的光束亮度</td></tr><tr><td><code>angle</code></td><td><code>double</code>  浮点数</td><td>照射角度，决定发出光束最多与照射射线成多少度角</td></tr><tr><td><code>range</code></td><td><code>double</code>  浮点数</td><td>照射范围，以照射射线为判定，决定最远能照亮多少格</td></tr></tbody></table>

设置完毕后，我们还需要给配件模型添加定位组，以便设计手电筒在第一人称下的照射源位置。打开配件的模型文件，并添加一个定位组`flashlight`在一级目录下，其朝向将被用作手电筒的照射方向：

<figure><img src="/files/5MaCDkVPCzXrZVstaZBS" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**开发须知** : 尽量不要在瞄准镜类型的配件 (scope) 上使用该属性，可能有各种未详细统计的不稳定问题。目前制作组暂无精力对此功能全面测试，请耐心等待问题修复。
{% endhint %}

***

## 在游戏中使用手电筒

本模组为镭射配件与手电筒配件新增了开关功能，可自由配置相应按键。因此，默认情况下，手电筒配件在安装后不会被立即打开。在给枪械安装了具有手电功能的配件后，按下对应按键（默认为Numpad 6）即可启用手电筒。手电筒发出的光束对于其他玩家是可见的。

手电筒与镭射的开关现在具有一个特殊的触发器，可用于调动机制开发组件中的机制执行。具体内容请参阅机制开发向导 - 触发器章节。

> 当前，Arcana 提供的手电功能的实现是基于真实光照与着色器结合实现的，因此会导致世界区块光照数据在有手电筒开关时重新计算。制作组虽已对此进行了优化，但仍建议避免频繁开关手电筒以及在多人世界中过多使用该功能。对于原版着色器，性能影响相对较小；与光影的兼容性问题较大，制作组将在有空余精力时尝试进一步兼容与性能优化。
>
> 本模组与 掌中明月（HandheldMoon）模组无任何关联，为分别独立的项目，因此在反馈相关功能的表现问题时请先验证是哪一模组导致的问题。对于模组间的兼容性问题，Arcana 将尽力跟进。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hamsterbaron.gitbook.io/hamsterbaron/augment-guide/flashlight.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
