角色模组
交互与随机动作
决定角色何时播放动作,以及饱食度和好感等级怎样参与。
两种播放方式
交互动作即时回应用户,例如点击、提起和下落;随机动作让角色在没人操作时也有自己的活动。先在 act_conf.json 中定义动作,再在 pet_conf.json 中指定用途。
| 字段 | 用途 |
|---|---|
default |
默认待机;基础角色需要提供 |
drag / fall |
提起 / 下落;基础角色需要提供 |
prefall |
下落前的预备动作,缺少时使用 fall |
left / right |
向左 / 向右移动时的动作 |
patpat |
点击角色时的反应 |
focus |
专注期间的动作 |
其他常规动作未提供时可回退到默认动作。不要把用于扩展的 up / down 当成制作第一个角色的前置要求。
点击时根据状态回应
只有一个点击动作时,patpat 填一个动作名即可。也可以按饱食度分级指定不同动作。下面是合并到 pet_conf.json 的片段,动作需事先定义:
{
"patpat": {
"0": "pat_hungry",
"1": "pat_hungry",
"2": "pat_normal",
"3": "pat_happy"
}
}
把动作串成一段活动
以下是一项 random_act 列表条目,先向左走、再向右走、最后待机。将它添加到现有列表,不要覆盖其他动作组。
{
"name": "散步",
"act_list": ["walk_left", "walk_right", "idle"],
"act_prob": 0.4,
"act_type": [3, 1]
}
| 字段 | 含义 |
|---|---|
name |
动作组名称;普通动作可由这个名称出现在动作菜单中 |
act_list |
按顺序播放的动作名列表,均需在动作文件中定义 |
act_prob |
相对权重,不是直接的百分比;总和不必等于 1 |
act_type |
[偏好的饱食度分级, 解锁的好感等级];示例在好感 1 级解锁 |
至少保留一个可用的普通随机动作。只配置内部特殊动作,不能替代日常活动列表。
饱食度怎样影响随机选择?
饱食度分为 3(大于 80)、2(大于 50 且不超过 80)、1(大于 0 且不超过 50)、0(为 0)。下表中 a 是动作组本身的权重,结果仍是相对权重:
| 动作偏好分级 | 当前 3 | 当前 2 | 当前 1 | 当前 0 |
|---|---|---|---|---|
| 3 | a | a/4 | a/16 | 0 |
| 2 | a/4 | a | a/4 | 0 |
| 1 | 0 | 0 | a | 0 |
| 0 | 0 | 0 | 0 | a |
可以给饱食度为 0 准备一个休息动作组,避免该状态没有合适动作。夜间动作使用独立的选择规则,不套用此表。
Two ways to play actions
Interaction actions respond immediately to clicks, dragging and falling. Random actions keep a character active when no one is interacting. Define animations in act_conf.json, then assign their roles in pet_conf.json.
| Field | Purpose |
|---|---|
default |
Default idle; required for a basic character |
drag / fall |
Dragging / falling; required for a basic character |
prefall |
Preparation before falling; falls back to fall |
left / right |
Animations while moving left / right |
patpat |
Response to a click |
focus |
Animation during focus time |
Other missing ordinary actions can fall back to idle. The extension fields up / down are not prerequisites for creating a first character.
Respond according to satiety
For one click reaction, set patpat to an animation name. Alternatively, assign animations by satiety band. Merge this fragment into pet_conf.json after defining the referenced animations:
{
"patpat": {
"0": "pat_hungry",
"1": "pat_hungry",
"2": "pat_normal",
"3": "pat_happy"
}
}
Combine animations into an activity
This single random_act entry walks left, walks right, then idles. Append it to the existing list without replacing other groups.
{
"name": "A walk",
"act_list": ["walk_left", "walk_right", "idle"],
"act_prob": 0.4,
"act_type": [3, 1]
}
| Field | Meaning |
|---|---|
name |
Group name; ordinary groups can appear under this name in the action menu |
act_list |
Ordered animation names, each defined in the animation file |
act_prob |
Relative weight, not a direct percentage; the total need not be 1 |
act_type |
[preferred satiety band, affection level required]; this example unlocks at level 1 |
Keep at least one usable ordinary random group. Internal special actions do not replace everyday activities.
How does satiety change selection?
Satiety bands are 3 (above 80), 2 (above 50 through 80), 1 (above 0 through 50), and 0 (zero). In this table, a is the group’s configured weight. The adjusted values remain relative weights:
| Preferred band | Current 3 | Current 2 | Current 1 | Current 0 |
|---|---|---|---|---|
| 3 | a | a/4 | a/16 | 0 |
| 2 | a/4 | a | a/4 | 0 |
| 1 | 0 | 0 | a | 0 |
| 0 | 0 | 0 | 0 | a |
Prepare a resting group for band 0 so this state has an appropriate action. Nighttime actions use independent selection rules rather than this table.
文档持续完善中。 查看原始开发文档 ↗