角色模组
喂食、落地与收藏品
让特定事件调用合适的动作,不混入普通随机活动。
保留给事件的动作组名称
下面的名称位于 pet_conf.json 的 random_act 中,由软件在对应事件发生时调用,不要用于普通自创动作组。
name |
触发时机 |
|---|---|
feed_1 / feed_2 / feed_3 |
吃到喜欢 / 普通 / 不喜欢的食物 |
onfloor |
角色落地瞬间 |
check_item |
使用收藏品、查看其图片 |
这些条目采用 act_prob: 0 与 act_type: [0, 10000],避免参与普通随机选择。
给落地一个收尾
将下面一项加入角色的 random_act。landing 是你在动作文件中定义的动作名,onfloor 是软件识别的固定事件名称:
{
"name": "onfloor",
"act_list": ["landing"],
"act_prob": 0,
"act_type": [0, 10000]
}
name 保持为 onfloor;act_list 中的动作名可以自行定义,两者不必同名。
配合喂食反应播放声音
同样添加到 random_act,以下条目在吃到喜欢的食物时播放动作和声音:
{
"name": "feed_1",
"act_list": ["eat_happy"],
"act_prob": 0,
"act_type": [0, 10000],
"sound": ["feed_1"]
}
eat_happy 引用动作;sound 中的 feed_1 引用通知音效配置里的名称,不直接填写音频路径。
让角色展示收藏品
推荐把动作分成“拿起 → 展示 → 放下”三段。以下仍是一项 random_act 条目:
{
"name": "check_item",
"act_list": ["show_start", "show_loop", "show_end"],
"act_prob": 0,
"act_type": [0, 10000],
"item_size": [32, 32],
"item_anchor": [-75, -180]
}
item_size 是收藏品图片的宽高;item_anchor 是相对角色画布底边中心的偏移,向右和向下为正。示例数值必须按你的素材调整。
至少三段动作时,图片只在中间的动作期间显示。否则图片在整个动作组期间显示。软件按帧数、循环和时长计算出现时间,无需另写计时。
Group names reserved for events
These names belong in random_act in pet_conf.json. The app calls them for specific events; do not reuse them for ordinary custom groups.
name |
Event |
|---|---|
feed_1 / feed_2 / feed_3 |
Eating favorite / ordinary / disliked food |
onfloor |
Touching down after a fall |
check_item |
Using a collectible to view its image |
Set these entries to act_prob: 0 and act_type: [0, 10000] to keep them out of ordinary random selection.
Finish a fall with a landing
Add this entry to the character’s random_act. landing is an animation you define; onfloor is the fixed event name recognized by the app:
{
"name": "onfloor",
"act_list": ["landing"],
"act_prob": 0,
"act_type": [0, 10000]
}
Keep name as onfloor. The animation name in act_list can be your own; the two names do not have to match.
Play sound with a feeding reaction
Add this entry to random_act to play an animation and sound for favorite food:
{
"name": "feed_1",
"act_list": ["eat_happy"],
"act_prob": 0,
"act_type": [0, 10000],
"sound": ["feed_1"]
}
eat_happy references an animation. feed_1 in sound references a name in the notification configuration, not an audio path.
Show a collectible
A three-part sequence works well: pick up, display, put down. This is another single random_act entry:
{
"name": "check_item",
"act_list": ["show_start", "show_loop", "show_end"],
"act_prob": 0,
"act_type": [0, 10000],
"item_size": [32, 32],
"item_anchor": [-75, -180]
}
item_size sets the image dimensions. item_anchor offsets it from the bottom center of the character canvas; right and down are positive. Adjust these example values to your artwork.
With at least three actions, the image appears only during the middle actions. Otherwise it appears throughout the group. The app derives timing from frames, loops and durations; no separate timer is needed.
文档持续完善中。 查看原始开发文档 ↗