骑马与砍杀中文站论坛

 找回密码
 注册(Register!)

QQ登录

只需一步,快速开始

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

[讨论] [已解决]战场场景操作报错求助

[复制链接]

46

主题

627

回帖

492

积分

骑士

Rank: 4Rank: 4

UID
3398051
第纳尔
1841
精华
0
互助
48
荣誉
5
贡献
10
魅力
341
注册时间
2022-8-13
鲜花(57) 鸡蛋(0)
发表于 2023-6-8 01:19:32 | 显示全部楼层 |阅读模式
本帖最后由 ggfgfgf 于 2023-6-8 13:48 编辑

一个mission_templates的触发器,斩首功能,可以正常实现,但是刷红字
At Mission Template mst_quick_battle_battle trigger no: 10 consequences. At Mission Template mst_quick_battle_battle trigger no: 10 consequences. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 554; LINE NO: 2:
At Mission Template mst_quick_battle_battle trigger no: 11 consequences. At Mission Template mst_quick_battle_battle trigger no: 11 consequences. SCRIPT WARNING ON OPCODE 1704: Invalid Agent ID: 554; LINE NO: 2:
At Mission Template mst_quick_battle_battle trigger no: 26 consequences. At Mission Template mst_quick_battle_battle trigger no: 26 consequences. SCRIPT WARNING ON OPCODE 545: Invalid Agent ID: 554; LINE NO: 3:
At Mission Template mst_quick_battle_battle trigger no: 26 consequences. At Mission Template mst_quick_battle_battle trigger no: 26 consequences. SCRIPT WARNING ON OPCODE 1750: Invalid Agent ID: 182; LINE NO: 53:
At Mission Template mst_quick_battle_battle trigger no: 10 consequences. At Mission Template mst_quick_battle_battle trigger no: 10 consequences. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 568; LINE NO: 2:
At Mission Template mst_quick_battle_battle trigger no: 11 consequences. At Mission Template mst_quick_battle_battle trigger no: 11 consequences. SCRIPT WARNING ON OPCODE 1704: Invalid Agent ID: 568; LINE NO: 2:
At Mission Template mst_quick_battle_battle trigger no: 26 consequences. At Mission Template mst_quick_battle_battle trigger no: 26 consequences. SCRIPT WARNING ON OPCODE 545: Invalid Agent ID: 568; LINE NO: 3:
At Mission Template mst_quick_battle_battle trigger no: 26 consequences. At Mission Template mst_quick_battle_battle trigger no: 26 consequences.
请教下大佬原因,鲜花附上!
cut_body = (
        ti_on_agent_hit, 0, 0, [],
        [
        (store_trigger_param_1,":hiter"),
        (store_trigger_param_2, ":agent"),
        (store_trigger_param_3,":injury"),
        (store_trigger_param, ":hit_bone", 4),
        (copy_position,pos1,pos0),
        (assign, ":attacker_item", reg0),
        (agent_is_human, ":agent"),
        (agent_is_non_player, ":agent"),

        (try_begin),
                # (eq, ":hit_bone", hb_head),#head
                # (try_begin),
                        # (ge, ":injury", 25),
                        # (neq, ":attacker_item", "itm_mace_1"), ### List of weapons that cannot decapitate
                        # (neq, ":attacker_item", "itm_mace_2"), ### This would be easier to do with a preperty check (for damage type), but I don't know if that is possible or not
                        # (neq, ":attacker_item", "itm_mace_3"),
                        # (neq, ":attacker_item", "itm_staff"),
                        
                        # (agent_get_action_dir, ":attack_dir", ":hiter"), ### Makes sure the attack is either a left or right swing
                        # (this_or_next|eq, ":attack_dir", 1), ### Right swing
                        # (eq, ":attack_dir", 2), ### Left swing
                        (eq,1,1),
                        (display_message,"@h",0x000000),
                        (store_agent_hit_points, ":hp", ":agent", 1),
                        # (is_between, ":hp", 0, 20),
                        (gt, ":hp", 0),
                                  (agent_get_item_slot, ":item", ":agent", 4), #head slot
                  (try_begin),
                         (ge, ":item", 1), ### Does it?
                         (agent_unequip_item, ":agent", ":item"), ### Yes it does. Unequip it to allow replacement by the invisible helmet further down
                         (try_begin),
                                (assign, ":prunetime", 360),
                                (spawn_item, ":item", 0, ":prunetime"), ### Spawns the agent's currently equipped headgear on the dropped head's position
                         (try_end),
                  (try_end),
         
                (agent_equip_item, ":agent", "itm_invisible_head"),
               
                (agent_get_position, pos4, ":agent"),
                        (agent_get_horse, ":is_mounted", ":agent"),
                          (try_begin), ### If the agent is on horseback, these values are used (note that these values will not be exactly correct if the horse is very large or very small)
                                (ge, ":is_mounted", 0), ### Will be -1 if no horse is to be found, so anything above means that the agent is mounted
                                (assign, ":min_distance", 240), ### Minimum distance from the agent's horse's hooves from which the hit is valid (240 is an approximate value)
                          (else_try),  ### If the agent is on foot, these values are used
                                (assign, ":min_distance", 160), ### Minimum distance from the agent's feet from which the hit is valid (160 = slightly below the neck)
                          (try_end),
                          (position_move_z, pos4, ":min_distance"),
                          (store_random_in_range, ":z_rotation", 0, 360),
                                  (store_random_in_range, ":y_rotation", -60, 60),
                                  (store_random_in_range, ":x_pos", -90, 90),
                                  (store_random_in_range, ":y_pos", -90, 90),
                                  (position_rotate_z, pos4,":z_rotation"),
                                  (position_rotate_y, pos4,":y_rotation"),
                                  (position_move_x, pos4, ":x_pos"),
                                  (position_move_y, pos4, ":y_pos"),
                                  (position_set_z_to_ground_level, pos4),
                                  (position_move_z, pos4, 5),
                                  (set_spawn_position, pos4),
                                 
                ### Blood effects! The last variable is the strength. Lower or increase it for more/less blood (or tweak the particle effects themselves in "module_particle_systems.py").
                  (particle_system_burst, "psys_blood_decapitation", pos4, 40),
                  (particle_system_burst, "psys_game_blood", pos4, 10),
                  (particle_system_burst, "psys_game_blood_2", pos4, 10),
                  (play_sound_at_position, "snd_decapitation", pos1),
                  (agent_play_sound, "snd_broken"),
                  (assign, ":head_type", "spr_head_dynamic_male"),
                                (agent_get_troop_id, ":victim_troop", ":agent"),
                                (try_begin),
                                        (ge, ":victim_troop", 0),
                                        (troop_get_type,":victim_gender",":victim_troop"),
                                        (eq, ":victim_gender", 1),
                                        (assign, ":head_type", "spr_head_dynamic_female"),
                                (try_end),
                        (position_move_z, pos4, 20),
                  (set_spawn_position, pos4),
                  (spawn_scene_prop, ":head_type"),
                # (try_end),
        # (val_mul,":injury",0.4),
        (else_try),
                (is_between, ":hit_bone", hb_shoulder_l, hb_hand_r + 1),# arms
                (val_mul,":injury",0.2),
        (else_try),
                (is_between, ":hit_bone", hb_thigh_l, hb_foot_r + 1),# legs
                (store_agent_hit_points,":hp",":agent",1),
                (store_agent_hit_points,":hp2",":agent",0),
                (try_begin),
                        (gt,":hp2",0),
                        (store_div,":now",":injury",":hp2"),
                        (try_begin),
                                (this_or_next|gt,":now",0.3),
                                (lt,":hp",41),
                                (agent_set_speed_modifier,":agent",":hp"),
                        (try_end),
                        (val_mul,":injury",0.2),
                (try_end),
         (try_end),
        (store_agent_hit_points,":now_hp", ":agent",1),
        (val_sub,":now_hp",":injury"),
        (agent_set_hit_points, ":agent",":now_hp",1),
        ])


("head_dynamic_male",sokf_moveable|sokf_dynamic_physics,"cut_off_head_male_dynamic","bo_cut_off_head_dynamic", []),
("head_dynamic_female",sokf_moveable|sokf_dynamic_physics,"cut_off_head_female_dynamic","bo_cut_off_head_dynamic", []),

标红的问题,已解决

41

主题

94

回帖

221

积分

见习骑士

Rank: 3

UID
3199602
第纳尔
1162
精华
0
互助
36
荣誉
0
贡献
1
魅力
227
注册时间
2020-9-4
鲜花(60) 鸡蛋(0)
发表于 2023-6-8 03:20:53 | 显示全部楼层
本帖最后由 奥杜因阿卡托什 于 2023-6-8 03:22 编辑

你这个代码的前两个store_trigger_param_是不是写反了?我看header里这个触发器词条是这么写的
ti_on_agent_hit               = -28.0 # Agent has been damaged with a weapon attack
    # trigger param 1 = damage inflicted agent_id
    # trigger param 2 = attacker agent_id
第一个是被打的人,第二个是打人的人,但你这里好像把打人的人脑袋砍了。实际测试真的没问题吗?

鲜花鸡蛋

ggfgfgf  在2023-6-8 13:34  送朵鲜花  并说:还是刷红字,,,
ggfgfgf  在2023-6-8 12:11  送朵鲜花  并说:我非常同意你的观点,送朵鲜花鼓励一下

46

主题

627

回帖

492

积分

骑士

Rank: 4Rank: 4

UID
3398051
第纳尔
1841
精华
0
互助
48
荣誉
5
贡献
10
魅力
341
注册时间
2022-8-13
鲜花(57) 鸡蛋(0)
 楼主| 发表于 2023-6-8 12:11:17 | 显示全部楼层
奥杜因阿卡托什 发表于 2023-6-8 03:20
你这个代码的前两个store_trigger_param_是不是写反了?我看header里这个触发器词条是这么写的
ti_on_agen ...

emm,好像是,感谢提醒,不过还是刷红字,,

29

主题

738

回帖

565

积分

骑士

Rank: 4Rank: 4

UID
3322408
第纳尔
1748
精华
0
互助
67
荣誉
0
贡献
0
魅力
6
注册时间
2022-2-3
鲜花(57) 鸡蛋(0)
发表于 2023-6-8 12:52:07 来自手机 | 显示全部楼层
你把hiter和agent都检测一下是不是人类、是不是活着看看。来自: Android客户端

46

主题

627

回帖

492

积分

骑士

Rank: 4Rank: 4

UID
3398051
第纳尔
1841
精华
0
互助
48
荣誉
5
贡献
10
魅力
341
注册时间
2022-8-13
鲜花(57) 鸡蛋(0)
 楼主| 发表于 2023-6-8 13:23:44 | 显示全部楼层
112233lyh 发表于 2023-6-8 12:52
你把hiter和agent都检测一下是不是人类、是不是活着看看。

确实都是,
现在确定是这段有问题,但是报错似乎和这操作没关系。。。
# (assign, ":head_type", "spr_head_dynamic_male"),
                                # (agent_get_troop_id, ":victim_troop", ":agent"),
                                # (try_begin),
                                        # (ge, ":victim_troop", 0),
                                        # (troop_get_type,":victim_gender",":victim_troop"),
                                        # (eq, ":victim_gender", 1),
                                        # (assign, ":head_type", "spr_head_dynamic_female"),
                                # (try_end),
                        # (position_move_z, pos4, 20),
                  # (set_spawn_position, pos4),
                  # (spawn_scene_prop, ":head_type"),

46

主题

627

回帖

492

积分

骑士

Rank: 4Rank: 4

UID
3398051
第纳尔
1841
精华
0
互助
48
荣誉
5
贡献
10
魅力
341
注册时间
2022-8-13
鲜花(57) 鸡蛋(0)
 楼主| 发表于 2023-6-8 13:33:00 | 显示全部楼层
112233lyh 发表于 2023-6-8 12:52
你把hiter和agent都检测一下是不是人类、是不是活着看看。

可能是module_scene_props里的有问题?
请教下,鲜花附上!
("head_dynamic_male",sokf_moveable|sokf_dynamic_physics,"cut_off_head_male_dynamic","bo_cut_off_head_dynamic", [

        (ti_on_init_scene_prop,
        [
         (store_trigger_param_1, ":prop_instance_no"),
       
         #(particle_system_emit,"psys_game_blood",90000), ### Blood originating form the head (test, don't think this worked)
         #(particle_system_emit,"psys_game_blood_2",90000),
         #(particle_system_add_new, "psys_game_blood"),
         
         # (scene_prop_set_prune_time, ":prop_instance_no", 60), ### Don't think this operation works like I would want it to either. Will try to find another way of getting rid of limbs laying around for too long.
         (set_fixed_point_multiplier, 100),
         
         ### Physics Properties
         (position_set_x, pos0, 1000), # mass = 10.0
         (position_set_y, pos0, 80), # friction coefficient = 0.8
         (position_set_z, pos0, 0), # reserved variable
         (prop_instance_dynamics_set_properties, ":prop_instance_no", pos0), # Set Properties
         
         ### Rotational velocities
         (store_random_in_range, ":rndm", -2000, 2000), ### The final value is a random one between these two values
         (position_set_x, pos0, ":rndm"),
         (store_random_in_range, ":rndm", -2000, 2000),
         (position_set_y, pos0, ":rndm"),
         (store_random_in_range, ":rndm", -2000, 2000),
         (position_set_z, pos0, ":rndm"),
         (prop_instance_dynamics_set_omega, ":prop_instance_no", pos0), # Set Rotation
         
         ### Movement velocities
         (store_random_in_range, ":rndm", -2000, 2000),
         (position_set_x, pos0, ":rndm"),
         (store_random_in_range, ":rndm", -2000, 2000),
         (position_set_y, pos0, ":rndm"),
         (store_random_in_range, ":rndm", 30, 1000),
         (position_set_z, pos0, ":rndm"),
         (prop_instance_dynamics_apply_impulse, ":prop_instance_no", pos0), # Set Movement
        ]),
        ]),
       
   ("head_dynamic_female",sokf_moveable|sokf_dynamic_physics,"cut_off_head_female_dynamic","bo_cut_off_head_dynamic", [

        (ti_on_init_scene_prop,
        [
         (store_trigger_param_1, ":prop_instance_no"),
       
         #(particle_system_emit,"psys_game_blood",90000), ### Blood originating form the head (test, don't think this worked)
         #(particle_system_emit,"psys_game_blood_2",90000),
         #(particle_system_add_new, "psys_game_blood"),
         
         # (scene_prop_set_prune_time, ":prop_instance_no", 60), ### Don't think this operation works like I would want it to either. Will try to find another way of getting rid of limbs laying around for too long.
         (set_fixed_point_multiplier, 100),
         
         ### Physics Properties
         (position_set_x, pos0, 1000), # mass = 10.0
         (position_set_y, pos0, 80), # friction coefficient = 0.8
         (position_set_z, pos0, 0), # reserved variable
         (prop_instance_dynamics_set_properties, ":prop_instance_no", pos0), # Set Properties
         
         ### Rotational velocities
         (store_random_in_range, ":rndm", -2000, 2000), ### The final value is a random one between these two values
         (position_set_x, pos0, ":rndm"),
         (store_random_in_range, ":rndm", -2000, 2000),
         (position_set_y, pos0, ":rndm"),
         (store_random_in_range, ":rndm", -2000, 2000),
         (position_set_z, pos0, ":rndm"),
         (prop_instance_dynamics_set_omega, ":prop_instance_no", pos0), # Set Rotation
         
         ### Movement velocities
         (store_random_in_range, ":rndm", -2000, 2000),
         (position_set_x, pos0, ":rndm"),
         (store_random_in_range, ":rndm", -2000, 2000),
         (position_set_y, pos0, ":rndm"),
         (store_random_in_range, ":rndm", 30, 800),
         (position_set_z, pos0, ":rndm"),
         (prop_instance_dynamics_apply_impulse, ":prop_instance_no", pos0), # Set Movement
    ]),
        ]),

41

主题

94

回帖

221

积分

见习骑士

Rank: 3

UID
3199602
第纳尔
1162
精华
0
互助
36
荣誉
0
贡献
1
魅力
227
注册时间
2020-9-4
鲜花(60) 鸡蛋(0)
发表于 2023-6-8 21:08:25 | 显示全部楼层
和props应该没关系吧?它报错说的是
1710→agent_get_position
1704→agent_is_human
545→agent_slot_eq
1750→agent_play_sound
都是和agent有关的东西,而且是用了不存在的agent序号(568、182、554),所以我说要你检测一下用到的agent是不是真的都是agent,别到时候输入的其实是什么props的序号或者别的。

评分

参与人数 1互助 +2 收起 理由
agjib + 2 乐于助人!

查看全部评分

鲜花鸡蛋

ggfgfgf  在2023-6-8 21:42  送朵鲜花  并说:我非常同意你的观点,送朵鲜花鼓励一下

46

主题

627

回帖

492

积分

骑士

Rank: 4Rank: 4

UID
3398051
第纳尔
1841
精华
0
互助
48
荣誉
5
贡献
10
魅力
341
注册时间
2022-8-13
鲜花(57) 鸡蛋(0)
 楼主| 发表于 2023-6-8 21:43:19 | 显示全部楼层
奥杜因阿卡托什 发表于 2023-6-8 21:08
和props应该没关系吧?它报错说的是
1710→agent_get_position
1704→agent_is_human

确实,我把sense_prop的改了就好了。。。
您需要登录后才可以回帖 登录 | 注册(Register!)

本版积分规则

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

GMT+8, 2024-11-19 10:26 , Processed in 0.128985 second(s), 24 queries , Gzip On, MemCached On.

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

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