主题
Kether(服务端脚本)
服务端逻辑脚本语言,用于热键触发、动画行为和音效播放。
Kether 运行在服务端,用于处理逻辑与触发行为。 Behemiron 主要在以下场景使用 Kether:
- 服务端热键触发
- 动画行为触发
- 音效播放
Kether 只在服务端执行,不影响客户端性能。
Quick Start
# 触发冲刺动画 + 播放音效
anim trigger dash start
sound play "ui/quest_accept"1. 命名空间
Behemiron 的 Kether Action 在命名空间 behemiron 下。
热键触发时默认启用:
behemironchemdahadyeshach
2. Action 速查表
动画 Action
| 语法 | 说明 | 示例 |
|---|---|---|
anim trigger <behavior> <action> | 触发行为系统中的动画动作 | anim trigger dash start |
anim var <key> <value> | 写入运行变量(驱动 Graph 条件) | anim var speed 1.2 |
anim flag <key> <value> | 写入标志变量 | anim flag footIk true |
音效 Action
| 语法 | 说明 | 示例 |
|---|---|---|
sound play "<path>" | 播放音效 | sound play "ui/quest_accept" |
sound play "<path>" volume <v> pitch <p> | 指定音量/音高 | sound play "ambient/forest" volume 0.6 pitch 1.0 |
sound play "<path>" bus <bus> | 指定总线 | sound play "ambient/forest" bus environment |
sound play "<path>" loop <bool> | 循环播放 | sound play "ambient/forest" loop true |
sound play "<path>" at <x> <y> <z> | 坐标播放 | sound play "combat/tension_1" at 100 64 100 |
sound event <name> | 触发已配置的音效事件 | sound event quest_accept |
sound scene <name> <bool> | 激活/关闭音效场景 | sound scene combat true |
sound stop "<path>" | 停止音效 | sound stop "combat/tension_1" |
sound play 可选参数
| 参数 | 类型 | 说明 |
|---|---|---|
volume | float | 音量 0.0 ~ 1.0 |
pitch | float | 音高 |
bus | string | 音效总线 |
source | string | 音效源(可选) |
loop | boolean | 是否循环 |
relative | boolean | 相对玩家位置 |
at x y z | int int int | 指定世界坐标播放 |
路径规则(强制):
- 只能写
sound/目录下的相对路径 - 禁止
behemiron:或sound/前缀
3. 完整示例
热键触发冲刺
yaml
bindings:
skill_dash:
context: gameplay
pattern: "W, W"
trigger: press
action: |-
anim trigger dash start
sound play "ui/quest_accept"场景切换与变量控制
# 进入战斗
sound scene combat true
anim var speed 1.5
anim flag footIk true
# 离开战斗
sound scene combat false
anim var speed 1.0
anim flag footIk false带坐标的环境音效
sound play "ambient/waterfall" at 100 64 200 volume 0.7 loop true多步连招脚本
anim trigger combo step1
sound play "combat/slash_1"4. 与热键结合
服务端热键的 action 就是 Kether 脚本:
yaml
bindings:
skill_dash:
context: gameplay
pattern: "W, W"
trigger: press
action: |-
anim trigger dash start
sound play "ui/quest_accept"
charge_skill:
context: gameplay
pattern: "F@300"
trigger: hold
holdMs: 300
action: |-
anim trigger charge start
anim var chargeLevel 15. 常见问题
| 现象 | 排查方向 |
|---|---|
| 执行失败 | 检查命名空间是否包含 behemiron |
| 音效无声 | 路径写错或未放入 sound/ |
| 动画不触发 | 检查 behavior/action 名称是否与 Graph 配置一致 |
| 变量未生效 | 确认 var / flag 的 key 与 Molang 条件引用的变量名匹配 |