桌面模组文档迷你宠物
模组开发文档

迷你宠物

制作迷你宠物

沿用角色的动画基础,再加入召唤与角色联动。

共用的基础与独有的部分

迷你宠物与角色共用动画帧、动作播放、定位和昼夜作息的配置方式。已有角色制作经验,可以直接复用这些知识。

不同之处在于:迷你宠物通过物品召唤,可以跟随主角色,还有自己的专属联动。它不使用角色的 item_favorite、item_dislike、prompt、对话映射、coin_config 等字段。

文件夹里放什么?

下面按现有迷你宠物样例整理,模组位于 res/pet/ 下。把图片和配置打包在同一个迷你宠物文件夹内:

小伙伴/
├── action/
├── act_conf.json
├── pet_conf.json
├── items_config.json
├── companion.png
└── info/
    ├── info.json
    ├── portrait.png
    └── author.png

act_conf.json 定义动画,pet_conf.json 定义行为,items_config.json 提供召唤物品。资料写法见模组介绍与作者资料。

先让它显示并跟随

在 action/ 放入从 stand_0.png 开始的连续帧。下面是完整的 act_conf.json 起点:

{
  "idle": {"images": "stand", "act_num": 1, "frame_refresh": 0.1}
}

配套的 pet_conf.json 起点如下。它先把基础交互都接到待机动作,便于测试;画布与跟随偏移需按素材修改。

{
  "width": 128,
  "height": 128,
  "scale": 1.0,
  "default": "idle",
  "drag": "idle",
  "fall": "idle",
  "patpat": "idle",
  "follow_main_x": true,
  "follow_main_y": true,
  "anchor_to_main": [10, -80],
  "random_act": [
    {"name": "待机", "act_list": ["idle"], "act_prob": 1.0, "act_type": [0, 10000]}
  ],
  "main_interact": {}
}

follow_main_x、follow_main_y 分别控制横向、纵向跟随;anchor_to_main 调整相对主角色的位置。这些设置参考现有派蒙等迷你宠物样例,测试时观察主角色移动后的实际位置。这里的随机组设置沿用迷你宠物样例,不要套用为角色的普通随机活动模板。

配置召唤物品

在迷你宠物根目录准备 companion.png,并创建完整的 items_config.json:

{
  "小伙伴": {
    "image": "companion.png",
    "description": "陪在你身边的小伙伴。",
    "type": "subpet",
    "cost": 1000,
    "fv_lock": 0
  }
}

按现有样例,物品名、迷你宠物文件夹名与资料中的 petName 保持一致。图片路径从迷你宠物根目录开始,不从 info/ 开始。召唤物品不填写直接喂食效果或随机掉落权重。

先检查能否获得并使用召唤物品,再增加动作和增益效果。

下一步

动画细节参考动画帧与动作。昼夜作息与角色配置一致,见迷你宠物的昼夜作息入口。

main_interact 的具体角色联动写法暂不展开,后续补充;当前可保留空对象。已经有角色模板时,记得移除角色专属的喜好、提示词、对话映射(如 msg_dict / message_dict)和金币外观字段。

Shared foundations and differences

Mini-pets share frame preparation, animation playback, positioning and day/night configuration with characters. Reuse those foundations if you have already made a character.

Mini-pets are summoned through items, can follow the main character and have dedicated interactions. They do not use character fields such as item_favorite, item_dislike, prompt, dialogue mappings or coin_config.

Folder structure

This structure follows existing mini-pet examples under res/pet/. Package the files in one mini-pet folder:

Companion/
├── action/
├── act_conf.json
├── pet_conf.json
├── items_config.json
├── companion.png
└── info/
    ├── info.json
    ├── portrait.png
    └── author.png

act_conf.json defines animations, pet_conf.json defines behavior, and items_config.json provides the summoning item. See mod and creator information for metadata.

Start with appearance and following

Place consecutive frames starting with stand_0.png in action/. This is a complete starting act_conf.json:

{
  "idle": {"images": "stand", "act_num": 1, "frame_refresh": 0.1}
}

The matching starting pet_conf.json connects basic interactions to the idle animation for initial testing. Adjust the canvas and following offset to your artwork.

{
  "width": 128,
  "height": 128,
  "scale": 1.0,
  "default": "idle",
  "drag": "idle",
  "fall": "idle",
  "patpat": "idle",
  "follow_main_x": true,
  "follow_main_y": true,
  "anchor_to_main": [10, -80],
  "random_act": [
    {"name": "Idle", "act_list": ["idle"], "act_prob": 1.0, "act_type": [0, 10000]}
  ],
  "main_interact": {}
}

follow_main_x and follow_main_y control horizontal and vertical following. anchor_to_main adjusts the relative position. These settings follow existing examples such as Paimon; check the position while moving the main character. The random-group settings follow mini-pet examples and are not a template for ordinary character random activities.

Configure the summoning item

Add companion.png at the mini-pet root and create this complete items_config.json:

{
  "Companion": {
    "image": "companion.png",
    "description": "A little friend by your side.",
    "type": "subpet",
    "cost": 1000,
    "fv_lock": 0
  }
}

Following existing examples, keep the item name, mini-pet folder name and metadata petName identical. Image paths start at the mini-pet root, not info/. Omit direct feeding effects and random drop weight from summoning items.

Check acquisition and summoning before adding more animations and buffs.

Next steps

See frames and animations for animation details. Day/night settings are identical to character settings; use the mini-pet day/night entry.

Dedicated main_interact mappings will be documented later; leave the object empty for now. When adapting a character template, remove character-specific preferences, prompts, dialogue mappings (such as msg_dict / message_dict) and coin appearance fields.

文档持续完善中。 查看原始开发文档 ↗

使用指南

待后续补充

使用指南将在后续补充,介绍呆啵桌宠的设置与日常使用。

常见问题

待后续补充

常见问题将在后续补充,汇总使用过程中常遇到的问题与解答。

QQ 群

一起分享使用体验,抢先测试新版

群号557261268

QQ 群二维码

使用 QQ 扫码,或搜索群号加入。