骑马与砍杀中文站论坛

 找回密码
 注册(Register!)

QQ登录

只需一步,快速开始

搜索
购买CDKEY 小黑盒加速器
查看: 1840|回复: 13

[求助] [已解决]链枷代码导入出错

[复制链接]

51

主题

191

回帖

83

积分

扈从

Rank: 2Rank: 2

UID
3204651
第纳尔
1522
精华
0
互助
2
荣誉
0
贡献
0
魅力
0
注册时间
2020-10-24

拿破仑正版勋章

鲜花(15) 鸡蛋(0)
发表于 2022-6-27 16:37:07 | 显示全部楼层 |阅读模式
本帖最后由 MikeBullock 于 2022-7-2 12:38 编辑

链枷及代码来源:https://bbs.mountblade.com.cn/fo ... hlight=%C1%B4%B4%B8
将这段代码:init_flail_head = (
       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_ba_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_flail_head"),
                 (agent_set_slot, ":agent_no", slot_agent_own_flail, 1),
                 (agent_set_slot, ":agent_no", slot_agent_flail_id, reg0),#检测agent是否有对应的链锤头,没有的话就刷一个,再用slot建立agent与锤头一一对应的关系
                                                                                                      #想了很久才确立了以上这种思路,虽然用了两个slot,但是好处是:既然一个agent手中只能有
                                                                                                      #一把武器,这两个slot同样可以用于其他武器的附加模型的存储
               (else_try),
                 (agent_get_slot, ":flail_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),
       ])

导入module_mission_templates后,开始报错.我是把哪里搞错了
XP[]@COAS4Z6WHK97I[MZ8J.png WMWAXAIXCBF8QEERC~K5`[B.png IR]5)U)WCCMCT$RQF9G($W3.png

评分

参与人数 1第纳尔 +5 互助 +1 收起 理由
vegetto + 5 + 1 自助精神可嘉

查看全部评分

51

主题

191

回帖

83

积分

扈从

Rank: 2Rank: 2

UID
3204651
第纳尔
1522
精华
0
互助
2
荣誉
0
贡献
0
魅力
0
注册时间
2020-10-24

拿破仑正版勋章

鲜花(15) 鸡蛋(0)
 楼主| 发表于 2022-6-27 16:51:33 来自手机 | 显示全部楼层
我使用的是小虎仔修复的1.171源码来自: Android客户端

60

主题

449

回帖

358

积分

见习骑士

Rank: 3

UID
2741644
第纳尔
5703
精华
0
互助
37
荣誉
2
贡献
15
魅力
403
注册时间
2016-4-23

骑砍中文站APP会员勋章霸主正版勋章

鲜花(158) 鸡蛋(0)
发表于 2022-6-28 03:56:23 | 显示全部楼层
本帖最后由 野蛮人y 于 2022-6-28 04:01 编辑

###########
init_flail_head = (      
0,0,0,[],
       [
……
]
)###########
这一段不是放在场景mt里,是在前面定义,例af_castle_lord 行下,场景里填init_flail_head,就引用了括号里的触发器,就是先在前面定义一个触发器函数a=(b),后面引用填a,即可使用触发器b,要整个触发器直接填场景mt里就删掉a=后面括号加英文逗号(b), ;

你现在要整个触发器直接填场景mt里(其他场景少用这个触发器可以这样),      
就删了init_flail_head =,在后面括号加上英文逗号,
★★★【三国群英赋】★★★

51

主题

191

回帖

83

积分

扈从

Rank: 2Rank: 2

UID
3204651
第纳尔
1522
精华
0
互助
2
荣誉
0
贡献
0
魅力
0
注册时间
2020-10-24

拿破仑正版勋章

鲜花(15) 鸡蛋(0)
 楼主| 发表于 2022-6-28 12:04:05 | 显示全部楼层
本帖最后由 MikeBullock 于 2022-6-28 12:10 编辑
野蛮人y 发表于 2022-6-28 03:56
###########
init_flail_head = (      
0,0,0,[],

我删了init_flail_head =,然后说我这个slot_agent_own_flail没有被标注
ACW5THLFM2P@V11V}{~4K(A.png 8%00K$R~(]JU{4UA8NB%4SF.png

58

主题

957

回帖

545

积分

子爵[版主]

Rank: 7Rank: 7Rank: 7

UID
81513
第纳尔
5143
精华
1
互助
18
荣誉
5
贡献
100
魅力
123
注册时间
2008-6-26
QQ
鲜花(104) 鸡蛋(0)
发表于 2022-6-28 13:28:11 | 显示全部楼层
自己定义一个呗,在constant

51

主题

191

回帖

83

积分

扈从

Rank: 2Rank: 2

UID
3204651
第纳尔
1522
精华
0
互助
2
荣誉
0
贡献
0
魅力
0
注册时间
2020-10-24

拿破仑正版勋章

鲜花(15) 鸡蛋(0)
 楼主| 发表于 2022-6-28 14:31:30 | 显示全部楼层
stevenxxy007 发表于 2022-6-28 13:28
自己定义一个呗,在constant

slot搞定了,这个是不是模型网格名没对的意思(我Ms是小白).
{ZOYQ2I})T3`WVS{WP@R6E6.png

58

主题

957

回帖

545

积分

子爵[版主]

Rank: 7Rank: 7Rank: 7

UID
81513
第纳尔
5143
精华
1
互助
18
荣誉
5
贡献
100
魅力
123
注册时间
2008-6-26
QQ
鲜花(104) 鸡蛋(0)
发表于 2022-6-28 14:56:31 | 显示全部楼层
MikeBullock 发表于 2022-6-28 14:31
slot搞定了,这个是不是模型网格名没对的意思(我Ms是小白).

这个要在module_scene_props里定义一个场景物,那个挥舞的链枷是个场景物

51

主题

191

回帖

83

积分

扈从

Rank: 2Rank: 2

UID
3204651
第纳尔
1522
精华
0
互助
2
荣誉
0
贡献
0
魅力
0
注册时间
2020-10-24

拿破仑正版勋章

鲜花(15) 鸡蛋(0)
 楼主| 发表于 2022-6-28 16:26:13 | 显示全部楼层
stevenxxy007 发表于 2022-6-28 14:56
这个要在module_scene_props里定义一个场景物,那个挥舞的链枷是个场景物

感谢大佬,野战场景可以正常使用了,就是参观城镇/城堡和村子还不知道怎么正常显示

51

主题

191

回帖

83

积分

扈从

Rank: 2Rank: 2

UID
3204651
第纳尔
1522
精华
0
互助
2
荣誉
0
贡献
0
魅力
0
注册时间
2020-10-24

拿破仑正版勋章

鲜花(15) 鸡蛋(0)
 楼主| 发表于 2022-6-28 16:44:34 | 显示全部楼层
stevenxxy007 发表于 2022-6-28 14:56
这个要在module_scene_props里定义一个场景物,那个挥舞的链枷是个场景物

我自己根据这个代码,仿了个中式链枷代码,能不能烦请大佬帮忙看下有没有错误
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", []),

51

主题

191

回帖

83

积分

扈从

Rank: 2Rank: 2

UID
3204651
第纳尔
1522
精华
0
互助
2
荣誉
0
贡献
0
魅力
0
注册时间
2020-10-24

拿破仑正版勋章

鲜花(15) 鸡蛋(0)
 楼主| 发表于 2022-6-28 21:42:06 | 显示全部楼层
代码改好了,但是不知道咋搞的,锤头变成了这个样子
20220628214012_1.jpg

58

主题

957

回帖

545

积分

子爵[版主]

Rank: 7Rank: 7Rank: 7

UID
81513
第纳尔
5143
精华
1
互助
18
荣誉
5
贡献
100
魅力
123
注册时间
2008-6-26
QQ
鲜花(104) 鸡蛋(0)
发表于 2022-6-29 09:37:48 | 显示全部楼层
MikeBullock 发表于 2022-6-28 21:42
代码改好了,但是不知道咋搞的,锤头变成了这个样子

han_blunt_head是图片中的什么东西呀,位置错了吗?位置不对要openbrf里对照着之前那个链枷把han_blunt_head调整好。至于代码,你红色标注下改了哪里

51

主题

191

回帖

83

积分

扈从

Rank: 2Rank: 2

UID
3204651
第纳尔
1522
精华
0
互助
2
荣誉
0
贡献
0
魅力
0
注册时间
2020-10-24

拿破仑正版勋章

鲜花(15) 鸡蛋(0)
 楼主| 发表于 2022-6-29 14:01:28 | 显示全部楼层
本帖最后由 MikeBullock 于 2022-6-29 14:04 编辑
stevenxxy007 发表于 2022-6-29 09:37
han_blunt_head是图片中的什么东西呀,位置错了吗?位置不对要openbrf里对照着之前那个链枷把han_blunt_h ...
han_blunt_head是图里的锤头,锤头托在地上走
(
       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_han_blunt_head, 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_han_blunt_head_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, ":han_blunt_head_id", 1),
                    (prop_instance_animate_to_position, ":han_blunt_head_id", pos2, 0),#如果是挥砍动作中,则用顶点动画操作来调整锤头的姿态,并附着在如此的position上
                                                                                                           #由于是非平衡武器,所以可以在挥击时给链和锤加上甩出的顶点动画
                  (else_try),
                    (prop_instance_deform_to_time, ":han_blunt_head_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, ":han_blunt_head_id", pos3, 0),#如果不是挥砍,则用顶点动画操作来调整锤头的姿态,并附着在如此的position上
                                                                                                           #对动作的判断和对应的顶点动画控制可以更细化:走、跑时链子和锤头可以甩动摇摆
                  (try_end),
               (try_end),
           (try_end),
       ]),

58

主题

957

回帖

545

积分

子爵[版主]

Rank: 7Rank: 7Rank: 7

UID
81513
第纳尔
5143
精华
1
互助
18
荣誉
5
贡献
100
魅力
123
注册时间
2008-6-26
QQ
鲜花(104) 鸡蛋(0)
发表于 2022-7-1 14:10:27 | 显示全部楼层
MikeBullock 发表于 2022-6-29 14:01
han_blunt_head是图里的锤头,锤头托在地上走
(
       0,0,0,[],

代码貌似没啥问题~你检查下你的那个锄头在openbrf里的位置有没有问题~角度、大小、位置等都要仿照着链枷去放

51

主题

191

回帖

83

积分

扈从

Rank: 2Rank: 2

UID
3204651
第纳尔
1522
精华
0
互助
2
荣誉
0
贡献
0
魅力
0
注册时间
2020-10-24

拿破仑正版勋章

鲜花(15) 鸡蛋(0)
 楼主| 发表于 2022-7-2 12:38:00 | 显示全部楼层
stevenxxy007 发表于 2022-7-1 14:10
代码貌似没啥问题~你检查下你的那个锄头在openbrf里的位置有没有问题~角度、大小、位置等都要仿照着链枷 ...

改好了,感谢大佬
您需要登录后才可以回帖 登录 | 注册(Register!)

本版积分规则

Archiver|手机版|小黑屋|骑马与砍杀中文站

GMT+8, 2024-6-26 00:06 , Processed in 0.130915 second(s), 25 queries , Gzip On, MemCached On.

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表