> 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/mechanic-guides/function.md).

# 变量与函数 / Function

## 使用占位符与插入变量

在实际的机制开发中，常需获得各种各样的状态数据，例如目标的坐标，玩家自身的血量，或是与 TacZ 模组事件相关的诸多数据：枪械伤害，后坐力数据

***

## 可编辑的变量

在动作块部分的 Modify 属性编辑器组件中，您或许已经了解了对变量的控制方式。实际上，Arcana 通过灵活的设计使得部分变量与原版的计分板功能友好兼容，变量能够即时的存储至计分板项目中以与其他服务器插件或 FTB Quest 任务模组等交换数据，也可以读取当前计分板中的分数项并同步至组件中以便于在机制流程中应用。

#### 创建临时变量

#### 创建常量

有时候，我们希望自定义的变量在游戏一打开时就能被赋予预期中的数值，但在机制开发过程中直接将其设置于一个常数又不便于后续调整。此时，注册一个易失性变量并将其赋值将是合适的选择。

安装 Arcana 并首次打开游戏后，在游戏配置文件夹中打开<kbd>TaczExpand</kbd>文件夹，您会发现除了skill文件夹外，还生成了一份空白的

***

## 自定义变量

为了

***

## 利用自定变量传递信息


---

# 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/mechanic-guides/function.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.
