本帖最后由 wei1786 于 2023-3-10 22:43 编辑
首先是改名。
挺简单的代码,拿name_kingdom随便改下就行;
对话部分
在原本的member_talk中加
[anyone|plyr, "member_talk", #
[],
"want change name?", "member_talk_change_name",[#
]],
[anyone, "member_talk_change_name", [], "ok, whatever you want", "close_window",[(assign,"$troop_need_rename","$g_talk_troop"),(start_presentation,"prsnt_name_npc")]],
然后是presentation
("name_npc",0,0,[
(ti_on_presentation_load,
[
(presentation_set_duration, 999999),
(set_fixed_point_multiplier, 1000),
(create_mesh_overlay, reg1, "mesh_load_window"),
(position_set_x, pos1, 0),
(position_set_y, pos1, 0),
(overlay_set_position, reg1, pos1),
(str_store_string, s1, "str_name_of_troop"),
(create_text_overlay, reg1, s1, tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 500),
(overlay_set_position, reg1, pos1),
(overlay_set_text, reg1, s1),
(create_simple_text_box_overlay, "$g_presentation_obj_name_kingdom_1"),
(position_set_x, pos1, 400),
(position_set_y, pos1, 400),
(overlay_set_position, "$g_presentation_obj_name_kingdom_1", pos1),
(str_store_troop_name, s7, "$troop_need_rename"),
(overlay_set_text, "$g_presentation_obj_name_kingdom_1", s7),
(create_button_overlay, "$g_presentation_obj_name_kingdom_2", "@Continue...", tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 300),
(overlay_set_position, "$g_presentation_obj_name_kingdom_2", pos1),
]),
(ti_on_presentation_event_state_change,
[
(store_trigger_param_1, ":object"),
(try_begin),
(eq, ":object", "$g_presentation_obj_name_kingdom_1"),
(str_store_string, s7, s0),
(else_try),
(eq, ":object", "$g_presentation_obj_name_kingdom_2"),
(troop_set_name, "$troop_need_rename", s7),
(presentation_set_duration, 0),
(try_end),
]),
]),
string
("name_of_troop","name_of_troop"),
str_name_of_troop|重 命 名 该 角 色 。
然后是修改发型
[anyone|plyr, "member_talk", #new#change hair
[(troop_get_type,":type","$g_talk_troop"),
(this_or_next|eq,":type",0),
(eq,":type",1),],
"You may have a new hair cut", "member_talk_change_hair",[
]],
[anyone, "member_talk_change_hair", #
[],
"What kind of it?", "member_talk_choose_hair",[
]],
[anyone|plyr|repeat_for_100, "member_talk_choose_hair",
[
(store_repeat_object,":hair_no"),
(val_add,":hair_no","str_man_bald"),
(assign,":continue",0),
(troop_get_type,":type","$g_talk_troop"),
(try_begin),
(eq,":type",0),
(store_add,":hair_end","str_man_hair_y4",1),
(is_between,":hair_no","str_man_bald",":hair_end"),
(assign,":continue",1),
(else_try),
(eq,":type",1),
(store_add,":hair_end","str_woman_hair_s",1),
(is_between,":hair_no","str_woman_bald",":hair_end"),
(assign,":continue",1),
(try_end),
(eq,":continue",1),
(str_store_string,s1,":hair_no"),
],"{s1}", "close_window",[
(store_repeat_object,":hair_no"),
(troop_get_type,":type","$g_talk_troop"),
(try_begin),
(eq,":type",1),
(store_sub,":des","str_woman_bald","str_man_bald"),
(val_sub,":hair_no",":des"),
(try_end),
(str_store_troop_face_keys,s1,"$g_talk_troop"),
(face_keys_set_hair,s1,":hair_no"),
(troop_set_face_keys,"$g_talk_troop",s1),
]],
[anyone|plyr, "member_talk_choose_hair", #
[],
"that is nice", "do_member_trade",[
]],
string
#hair male
("man_bald","0"),
("man_hair_s","1"),
("man_hair_m","2"),
("man_hair_n","3"),
("man_hair_o","4"),
("man_hair_y10","5"),
("man_hair_y12","6"),
("man_hair_p","7"),
("man_hair_r","8"),
("man_hair_q","9"),
("man_hair_v","10"),
("man_hair_t","11"),
("man_hair_y6","12"),
("man_hair_y3","13"),
("man_hair_y7","14"),
("man_hair_y9","15"),
("man_hair_y11","16"),
("man_hair_u","17"),
("man_hair_y","18"),
("man_hair_y2","19"),
("man_hair_y4","20"),
#hair female
("woman_bald","0"),
("woman_hair_p","1"),
("woman_hair_n","2"),
("woman_hair_o","3"),
("woman_hair_q","4"),
("woman_hair_r","5"),
("woman_hair_t","6"),
("woman_hair_s","7"),
然后需要给每种发型命下名
str_man_bald|光 头
str_man_hair_s|长 散 发 1
str_man_hair_m|锅 盖
str_man_hair_n|长 散 发 2
str_man_hair_o|长 散 发 3
str_man_hair_y10|较 短 发
str_man_hair_y12|短 发
str_man_hair_p|齐 肩 长 发
str_man_hair_r|马 尾
str_man_hair_q|遮 面 长 发
str_man_hair_v|库 吉 特 马 尾
str_man_hair_t|贝 斯 图 尔
str_man_hair_y6|库 吉 特 辫 子
str_man_hair_y3|除 额 头 剃 光
str_man_hair_y7|锅 盖 光 头
str_man_hair_y9|艾 雷 恩
str_man_hair_y11|后 脑 勺 剃 光
str_man_hair_u|向 上 短 发
str_man_hair_y|地 中 海
str_man_hair_y2|地 中 海 长
str_man_hair_y4|背 头
str_woman_bald|光 头
str_woman_hair_p|雅 米 拉
str_woman_hair_n|库 吉 特
str_woman_hair_o|凯 特 琳
str_woman_hair_q|农 妇
str_woman_hair_r|齐 肩 长 发
str_woman_hair_t|马 尾
str_woman_hair_s|克 雷 斯
这两个代码理论上可以给所有角色用
|