角色模组
制作第一个角色
先让角色站上桌面,再逐步丰富它的动作与个性。
一个角色由什么组成?
角色模组通常位于 res/role/角色名字/。先认识动画素材和两个核心配置文件:
角色名字/
├── action/ 动画帧
├── act_conf.json 每个动作怎样播放
├── pet_conf.json 什么情况下播放哪个动作
└── info/ 模组与作者信息、相关图片
act_conf.json 定义动作,pet_conf.json 将这些动作接入角色的交互和随机行为。两者使用动作名称关联。
先定义一个待机动作
把准备好的 stand_0.png、stand_1.png 等图片放进 action/。下面是一个可作为 act_conf.json 起点的完整示例:
{
"idle": {
"images": "stand",
"act_num": 1,
"frame_refresh": 0.1
}
}
这里的动作名是 idle,图片前缀是 stand。它们不必相同,但后续引用的动作名必须一致。
将动作接入角色
下面的 pet_conf.json 示例暂时让待机、拖拽和下落都使用同一个动作,方便先检查基础显示。画布宽高应按实际素材修改。
{
"width": 128,
"height": 128,
"scale": 1.0,
"default": "idle",
"drag": "idle",
"fall": "idle",
"random_act": [
{
"name": "待机",
"act_list": ["idle"],
"act_prob": 1.0,
"act_type": [2, 0]
}
]
}
| 字段 | 在这里的作用 |
|---|---|
width / height |
素材画布宽高;示例的 128 不是固定要求 |
scale |
显示缩放比例 |
default |
默认待机动作 |
drag / fall |
提起与下落时播放的动作 |
random_act |
可以随机播放的动作组 |
逐步增加个性
基础显示正常后,再为拖拽和下落准备不同的动作,加入行走、点击反应与随机动作。通过 昼夜作息,还可以让它在夜晚切换到睡眠动作。
按需要继续添加交互与随机动作、喂食与落地等事件动作、食物喜好与金币外观、通知声音和对话气泡。分享前填写模组与作者资料,再做一次导入测试。
What makes up a character?
A character mod usually lives in res/role/CharacterName/. Start with the animation assets and two core configuration files:
CharacterName/
├── action/ Animation frames
├── act_conf.json How each animation plays
├── pet_conf.json When each animation plays
└── info/ Mod and creator information, images
act_conf.json defines animations. pet_conf.json connects them to interactions and random behavior. Animation names link the two files.
Define an idle animation
Place stand_0.png, stand_1.png and the remaining frames in action/. This complete example is a starting point for act_conf.json:
{
"idle": {
"images": "stand",
"act_num": 1,
"frame_refresh": 0.1
}
}
The animation name is idle; the image prefix is stand. They can differ, but references must use the correct animation name.
Connect it to the character
This pet_conf.json example uses the same animation for idle, dragging and falling so you can check the basic display first. Adjust the canvas dimensions to match your assets.
{
"width": 128,
"height": 128,
"scale": 1.0,
"default": "idle",
"drag": "idle",
"fall": "idle",
"random_act": [
{
"name": "Idle",
"act_list": ["idle"],
"act_prob": 1.0,
"act_type": [2, 0]
}
]
}
| Field | Purpose in this example |
|---|---|
width / height |
Canvas dimensions; 128 is only an example |
scale |
Display scale |
default |
Default idle animation |
drag / fall |
Animations for dragging and falling |
random_act |
Groups of animations that can play randomly |
Add personality gradually
Once the basic display works, add separate drag and fall animations, walking, reactions and random actions. Day/night routines let your character switch to sleeping animations at night.
Continue with interactions and random actions, event actions such as feeding and landing, food preferences and coin appearance, notification sounds and speech bubbles. Before sharing, add mod and creator information and test an import.
文档持续完善中。 查看原始开发文档 ↗