- 好友
- 1
- 在线时间
- 0 小时
- 最后登录
- 2024-12-23
扈从
- UID
- 3204651
- 第纳尔
- 1522
- 精华
- 0
- 互助
- 2
- 荣誉
- 0
- 贡献
- 0
- 魅力
- 0
- 注册时间
- 2020-10-24
鲜花( 15) 鸡蛋( 0)
|
楼主 |
发表于 2022-6-28 16:44:34
|
显示全部楼层
我自己根据这个代码,仿了个中式链枷代码,能不能烦请大佬帮忙看下有没有错误
Mt:(
0,0,0,[],
[
(try_for_agents,":agent_no"),
(agent_is_alive,":agent_no"),
(agent_is_human,":agent_no"),
(agent_get_wielded_item, ":item_id", ":agent_no", 0),
(eq,":item_id","itm_Chinese_flail"),
(try_begin),
(agent_slot_eq, ":agent_no", slot_agent_own_flail, 0),
(agent_get_position,pos1,":agent_no"),
(set_spawn_position, pos1),
(spawn_scene_prop, "spr_han_blunt_head"),
(agent_set_slot, ":agent_no", slot_agent_own_han_blunt_head, 1),
(agent_set_slot, ":agent_no", slot_agent_han_blunt_head_id, reg0),#检测agent是否有对应的链锤头,没有的话就刷一个,再用slot建立agent与锤头一一对应的关系
#想了很久才确立了以上这种思路,虽然用了两个slot,但是好处是:既然一个agent手中只能有
#一把武器,这两个slot同样可以用于其他武器的附加模型的存储
(else_try),
(agent_get_slot, ":han_blunt_head_id", ":agent_no", slot_agent_flail_id),
(agent_get_bone_position, pos2, ":agent_no", 19, 1),
(agent_get_animation, ":cur_anim", ":agent_no", 1),
(position_move_y, pos2,30), #通过检测玩家右手武器骨骼块的位置,找到武器的位置。这是这个OSP的核心,以前没这个操作,
#想做同功能只能是空中楼阁
(try_begin),
(this_or_next|eq,":cur_anim","anim_release_slash_horseback_right"),
(this_or_next|eq,":cur_anim","anim_release_slash_horseback_left"),
(this_or_next|eq,":cur_anim","anim_release_slashleft_onehanded"),
(this_or_next|eq,":cur_anim","anim_release_overswing_onehanded"),
(eq,":cur_anim","anim_release_slashright_onehanded"),
(prop_instance_deform_to_time, ":flail_id", 1),
(prop_instance_animate_to_position, ":flail_id", pos2, 0),#如果是挥砍动作中,则用顶点动画操作来调整锤头的姿态,并附着在如此的position上
#由于是非平衡武器,所以可以在挥击时给链和锤加上甩出的顶点动画
(else_try),
(prop_instance_deform_to_time, ":flail_id", 0),
(agent_get_position,pos3,":agent_no"),
(position_copy_origin, pos3, pos2),
(position_rotate_x, pos3, -90),
(position_rotate_y, pos3, 0),
(position_rotate_z, pos3, -35),
(prop_instance_animate_to_position, ":flail_id", pos3, 0),#如果不是挥砍,则用顶点动画操作来调整锤头的姿态,并附着在如此的position上
#对动作的判断和对应的顶点动画控制可以更细化:走、跑时链子和锤头可以甩动摇摆
(try_end),
(try_end),
(try_end),
])
constants: slot_agent_own_han_blunt_head = 31
slot_agent_han_blunt_head_id = 31
scene_props:("han_blunt_head",0,"han_blunt_head","0", []), |
|