Skip to content

Kether(服务端脚本)

服务端逻辑脚本语言,用于热键触发、动画行为和音效播放。

Kether 运行在服务端,用于处理逻辑与触发行为。 Behemiron 主要在以下场景使用 Kether:

  • 服务端热键触发
  • 动画行为触发
  • 音效播放

Kether 只在服务端执行,不影响客户端性能。

Quick Start

# 触发冲刺动画 + 播放音效
anim trigger dash start
sound play "ui/quest_accept"

1. 命名空间

Behemiron 的 Kether Action 在命名空间 behemiron 下。

热键触发时默认启用:

  • behemiron
  • chemdah
  • adyeshach

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 可选参数

参数类型说明
volumefloat音量 0.0 ~ 1.0
pitchfloat音高
busstring音效总线
sourcestring音效源(可选)
loopboolean是否循环
relativeboolean相对玩家位置
at x y zint 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 1

5. 常见问题

现象排查方向
执行失败检查命名空间是否包含 behemiron
音效无声路径写错或未放入 sound/
动画不触发检查 behavior/action 名称是否与 Graph 配置一致
变量未生效确认 var / flag 的 key 与 Molang 条件引用的变量名匹配