角色模组
昼夜作息
给角色安排白天的活动与夜晚的睡眠。
角色和迷你宠物共用的作息配置
本页同时适用于角色与迷你宠物:字段、引用方式和配置步骤一致。分别修改各自模组的 pet_conf.json,不用给迷你宠物额外编写 main_interact。
白天使用平常的随机动作,夜晚切换到睡眠循环和可选的夜间小动作。不配置 day_night 时,保持原来的日常行为。
用户需要在软件设置中开启昼夜作息。几点入睡、几点起床由用户设置,模组只决定对应的表现。
第一步:标记睡眠动作组
先在 act_conf.json 中定义 sleep 动作,并准备对应图片。再把下面这个动作组添加到 pet_conf.json 已有的 random_act 列表中,保留白天的动作组:
{
"name": "睡觉",
"act_list": ["sleep"],
"act_prob": 1,
"act_type": [0, 0],
"phase": "night"
}
act_list 引用 act_conf.json 的动作名;name 则是这个动作组的名字。夜间专用的 random_act 或 accessory_act 动作组都应加上 phase: "night"。
标记后的动作组不进入白天随机池,但仍能在动作菜单中手动选择。夜间选择不受饱食度影响,推荐使用 [0, 0] 保持配置清晰。
第二步:指定睡眠循环
将以下字段合并到 pet_conf.json 的最外层,不要替换整个文件:
{
"day_night": {
"sleep": "睡觉"
}
}
这里的 睡觉 引用上一步的动作组 name,不是图片前缀或动作名 sleep。这两步足以建立基础睡眠循环;没有过渡动画时直接切换。
加入翻身、入睡与起床
准备好相应动画后,将它们分别登记为带 phase: "night" 的动作组。例如用 翻身、上床、起床、被打扰 作为组名,再扩展已有的 day_night:
{
"day_night": {
"sleep": "睡觉",
"night_random_act": ["翻身"],
"to_night": "上床",
"to_day": "起床",
"disturbed": "被打扰",
"night_random_prob": 0.15
}
}
这是引用示例,必须先建立同名动作组才能使用。各组中的 act_list 仍应指向实际存在的动画。
| 字段 | 格式 | 行为 |
|---|---|---|
sleep |
字符串或字符串列表,必填 | 基础睡眠循环;多个组按各自 act_prob 加权选择 |
night_random_act |
字符串列表,可选 | 偶尔播放的夜间动作;为空时只播放睡眠循环 |
to_night / to_day |
字符串或字符串列表,可选 | 入睡 / 起床时播放一次;省略则直接切换 |
disturbed |
字符串或字符串列表,可选 | 被打扰时的反应,不会因此切回白天模式 |
night_random_prob |
0–1 的数值,可选 | 夜间随机动作触发概率,默认 0.1 |
过渡或被打扰反应填写列表时,会随机选择其中一个,不是依次播放整份列表。夜间的 act_prob 是独立于白天的相对权重。
可选:夜间隐藏动作
如果希望夜间藏到屏幕边缘时也保留睡眠感,可在 pet_conf.json 最外层加入 hide_night:
{
"hide": "hide",
"hide_night": "hide_sleep"
}
这里的值引用 act_conf.json 中的动作名。需提前定义 hide 和 hide_sleep,缺少 hide_night 时沿用普通的 hide 动作。
测试顺序
先确认用户设置已开启作息,再依次检查进入夜晚、睡眠循环、被打扰、回到白天。加入可选动作后,还要检查每个组名是否匹配,以及夜间动作是否误入白天随机池。
返回角色制作或迷你宠物的昼夜作息入口。
One routine format for characters and mini-pets
This reference applies equally to characters and mini-pets: the fields, references and setup steps are the same. Edit each mod’s own pet_conf.json; mini-pets do not need main_interact to use routines.
Daytime uses the normal random actions. Nighttime uses a sleep loop and optional occasional actions. Without day_night, normal behavior continues.
Users must enable day/night routines in the app settings. Users choose when day and night begin; the mod defines how those changes look.
Step 1: mark a sleep action group
Define a sleep animation in act_conf.json and prepare its images. Then append this group to the existing random_act list in pet_conf.json, keeping the daytime groups:
{
"name": "Sleeping",
"act_list": ["sleep"],
"act_prob": 1,
"act_type": [0, 0],
"phase": "night"
}
act_list references animation names in act_conf.json; name identifies this action group. Add phase: "night" to nighttime-only groups in either random_act or accessory_act.
Marked groups stay out of the daytime random pool but remain selectable in the action menu. Nighttime selection ignores hunger; [0, 0] is recommended for clarity.
Step 2: select the sleep loop
Merge these fields into the top level of pet_conf.json. Do not replace the entire file:
{
"day_night": {
"sleep": "Sleeping"
}
}
Sleeping references the group’s name, not the image prefix or the animation name sleep. These two steps provide a basic sleep loop. Without transition animations, the switch happens directly.
Add turning over, bedtime and waking up
After preparing the animations, register a separate group with phase: "night" for each. For example, use the group names Turning over, Bedtime, Waking up and Disturbed, then extend the existing day_night:
{
"day_night": {
"sleep": "Sleeping",
"night_random_act": ["Turning over"],
"to_night": "Bedtime",
"to_day": "Waking up",
"disturbed": "Disturbed",
"night_random_prob": 0.15
}
}
This reference example requires those named groups to exist first. Each group’s act_list must still reference actual animations.
| Field | Format | Behavior |
|---|---|---|
sleep |
String or list of strings; required | Main sleep loop; multiple groups are selected using their act_prob weights |
night_random_act |
List of strings; optional | Occasional nighttime actions; an empty list leaves only the sleep loop |
to_night / to_day |
String or list of strings; optional | One transition at bedtime / waking; omission switches directly |
disturbed |
String or list of strings; optional | Reaction to an interruption; does not switch back to daytime |
night_random_prob |
Number from 0 to 1; optional | Chance of a nighttime random action; defaults to 0.1 |
A list of transitions or interruption reactions means choose one at random, not play the entire list in order. Nighttime act_prob weights are independent of daytime selection.
Optional: a nighttime hiding animation
To keep the sleepy appearance while hiding at the screen edge, add hide_night at the top level of pet_conf.json:
{
"hide": "hide",
"hide_night": "hide_sleep"
}
These values reference animation names in act_conf.json. Define hide and hide_sleep first. Without hide_night, the normal hide animation is reused.
Test in stages
Enable routines in the app settings, then check entering nighttime, the sleep loop, interruptions and returning to daytime. After adding optional actions, check every group reference and confirm that nighttime groups do not enter the daytime random pool.
Return to character creation or the mini-pet routine entry.
文档持续完善中。 查看原始开发文档 ↗