参数配置说明:Json配置 - Live2DViewerEX文档
下面参数位于动作代码中: “motions”: {…}
一、 Live2d-SDK2
Live2d-SDK2的参数首字母小写,多个单词用_分隔,参数最后可以保留逗号。
菜单列表:
text为显示文本,next_mtn为执行的动作
"设定": [{
"text": "设定",
"choices": [
{"text": "换装","next_mtn": "换装动作"},
{"text": "台词","next_mtn": "台词动作"},
{"text": "嘴型同步","next_mtn": "嘴型同步"},
]}],
嘴型同步和鼠标追踪开关:
在EX工作室中打开控制器-鼠标追踪、嘴型同步才能使用
"嘴型同步": [
{"text": "关闭","command": "lip_sync disable","var_floats": [{"name": "嘴型同步", "equal":0,"assign":1}]},
{"text": "开启","command": "lip_sync enable","var_floats": [{"name": "嘴型同步", "equal":1,"assign":0}]},
],
"鼠标追踪": [
{"text": "关闭","command": "tracking disable","var_floats": [{"name": "鼠标追踪", "equal":0,"assign":1}]},
{"text": "开启","command": "tracking enable","var_floats": [{"name": "鼠标追踪", "equal":1,"assign":0}]},
],
切换模型
切换“模型2.json”模型的配置文件:
"换装": [{"command": "change_cos 模型2.json"}],
切换贴图
切换同一模型的不同贴图,
replace_tex 0:0表示第一张贴图
文件位置c999_01/texture_00_1.png
"换装": [
{"text": "换装","command": "replace_tex 0 c999_01/texture_00_1.png","var_floats": [{"name": "换装", "equal": 0,"assign": 1}]},
{"text": "原装","command": "replace_tex 0 c999_01/texture_00.png","var_floats": [{"name": "换装", "equal": 1,"assign": 0}]},
],
音乐列表
"音乐": [{
"text": "选择",
"choices": [
{"text": "关闭","next_mtn": "关闭"},
{"text": "音乐1","next_mtn": "音乐1"},
{"text": "音乐2","next_mtn": "音乐2"},
{"text": "音乐3","next_mtn": "音乐3"},
]}],
"关闭": [{"command": "stop_sound 1"}],
"音乐1": [{"sound": "sound/1.ogg","sound_channel": 1,"sound_loop": true}],
"音乐2": [{"sound": "sound/2.ogg","sound_channel": 1,"sound_loop": true}],
"音乐3": [{"sound": "sound/3.ogg","sound_channel": 1,"sound_loop": true}],
背景音乐
音乐文件:sound/music042.ogg
sound_channel为声音频道,默认为0
sound_loop为循环声音
var_floats设置点击开、关
"背景音乐": [
{"sound": "sound/music042.ogg","sound_channel": 1,"sound_loop": true,"var_floats": [{"name": "背景音乐","equal": 0,"assign": 1}]},
{"command": "stop_sound 1","var_floats": [{"name": "背景音乐","equal": 1,"assign": 0}]}
],
待机语音
tick为每1分钟执行一次动作,tick_2为每2分钟执行一次动作。tick可设置多个,冲突时位于代码前的优先。时间采用系统时间。
leave为自定义:从放置1秒开始,2秒~10秒之间随机触发动作。leave只有一个有效,位于代码前的有效。时间为放置时间,点击后重新计算时间。
"tick": [{"command":"start_mtn 语音"}],
"tick_2": [{"command":"start_mtn 语音"}],
"leave_1_2_10": [{"command":"start_mtn 语音"}],
"语音": [
{"file": "c345_01/c345_01_attack.mtn","sound": "sound/c345_ctskill.ogg","text": "稍微有点游戏样了!","fade_in": 0,"fade_out": 0},
{"file": "c345_01/c345_01_hit.mtn","sound": "sound/c345_death_1.ogg","text": "这样的我…在家里…还能…待吗…","fade_in": 0,"fade_out": 0},
{"file": "c345_01/c345_01_hit.mtn","sound": "sound/c345_death_2.ogg","text": "呜呜…!嗯…","fade_in": 0,"fade_out": 0},
],
整点报时
"tick": [
{"text": "0点","time_limit": {"hour":0,"minute":0}},
{"text": "1点","time_limit": {"hour":1,"minute":0}},
{"text": "2点","time_limit": {"hour":2,"minute":0}},
{"text": "3点","time_limit": {"hour":3,"minute":0}},
{"text": "4点","time_limit": {"hour":4,"minute":0}},
{"text": "5点","time_limit": {"hour":5,"minute":0}},
{"text": "6点","time_limit": {"hour":6,"minute":0}},
{"text": "7点","time_limit": {"hour":7,"minute":0}},
{"text": "8点","time_limit": {"hour":8,"minute":0}},
{"text": "9点","time_limit": {"hour":9,"minute":0}},
{"text": "10点","time_limit": {"hour":10,"minute":0}},
{"text": "11点","time_limit": {"hour":11,"minute":0}},
{"text": "12点","time_limit": {"hour":12,"minute":0}},
{"text": "13点","time_limit": {"hour":13,"minute":0}},
{"text": "14点","time_limit": {"hour":14,"minute":0}},
{"text": "15点","time_limit": {"hour":15,"minute":0}},
{"text": "16点","time_limit": {"hour":16,"minute":0}},
{"text": "17点","time_limit": {"hour":17,"minute":0}},
{"text": "18点","time_limit": {"hour":18,"minute":0}},
{"text": "19点","time_limit": {"hour":19,"minute":0}},
{"text": "20点","time_limit": {"hour":20,"minute":0}},
{"text": "21点","time_limit": {"hour":21,"minute":0}},
{"text": "22点","time_limit": {"hour":22,"minute":0}},
{"text": "23点","time_limit": {"hour":23,"minute":0}},
],
多层动作
有多个待机动作时,使用#1、#2…分动作层级实现多个待机动作一起运行。
"idle": [{"file": "c345_01/c345_01_idle.mtn","fade_in": 0,"fade_out": 0}],
"idle#1": [{"file": "c345_01/c345_01_bg_idle.mtn","fade_in": 0,"fade_out": 0}],
二、 Live2d-SDK3
Live2d-SDK3的参数首字母大写,多个单词首字母答谢拼接,参数最后不能保留逗号。
菜单列表
"设定": [{
"Text": "设定",
"Choices": [
{"Text": "换装","NextMtn": "换装"},
{"Text": "背景音乐","NextMtn": "背景音乐"},
{"Text": "台词鉴赏","NextMtn": "台词鉴赏"}
]}],
切换模型
切换模型:
"换装": [{"Command": "change_cos aijierM.config.json"}],
切换贴图
"换装": [
{"Text": "换装1","Command": "replace_tex 0 chaijun_3/Texture_00_1.png"},
{"Text": "换装","Command": "replace_tex 0 chaijun_3/Texture_00.png"}
],
背景音乐
"背景音乐": [
{"Sound": "sound/主界面.ogg","sound_channel": 1,"sound_loop": true,"var_floats": [{"name": "背景音乐","equal": 0,"assign": 1}]},
{"command": "stop_sound 1","var_floats": [{"name": "背景音乐","equal": 1,"assign": 0}]}
],
三、 Spine+DragonBones
Spine和DragonBones参数首字母小写,多个单词用_分隔,参数最后可以保留逗号。
部分参数可与Live2d-SDK2相同
切换皮肤
"皮肤": [{"command": "set_skin 皮肤名"}],
在模型加载时加载皮肤
"start": [{"command": "set_skin 皮肤名"}],
设置不同的待机动作
设置一个点击区域,点击动作为“切换待机”,可顺序切换待机动作
"idle": [
{"file": "idle","fade_in": 0,"fade_out": 0,"var_floats": [{"name": "待机","equal": 0}]},
{"file": "angry","fade_in": 0,"fade_out": 0,"var_floats": [{"name": "待机","equal": 1}]},
{"file": "delight","fade_in": 0,"fade_out": 0,"var_floats": [{"name": "待机","equal": 2}]},
],
"切换待机": [
{"command":"start_mtn idle","var_floats": [{"name": "待机","equal": 0,"assign": 1}]},
{"command":"start_mtn idle","var_floats": [{"name": "待机","equal":1,"assign": 2}]},
{"command":"start_mtn idle","var_floats": [{"name": "待机","equal": 2,"assign": 0}]},
],