- 好友
- 0
- 在线时间
- 1 小时
- 最后登录
- 2024-10-29
平民
- UID
- 3134356
- 第纳尔
- 350
- 精华
- 0
- 互助
- 0
- 荣誉
- 0
- 贡献
- 0
- 魅力
- 0
- 注册时间
- 2020-2-7
鲜花( 1) 鸡蛋( 0)
|
自己找到了二战的场景触发器代码,将其移植到汉匈决战,但是只好使一次,就是进入游戏的第一次,退出不保存重新进档也不好使,代码如下,卡在刷出子弹的最后一步,
是与场景的装备备份有关吗,各位大大如果没时间,给个大致方向,修改哪个文件,小弟感谢,连发枪移植一直是小弟的夙愿,上代码,
(get_player_agent_no, ":var_0"),
(agent_is_human, ":var_0"),
(agent_is_alive, ":var_0"),
(agent_get_wielded_item, ":var_1", ":var_0"),
(gt, ":var_1", 0),
(item_get_slot, ":var_2", ":var_1", 72),
(eq, ":var_2", 4),
(agent_get_attack_action, ":var_3", ":var_0"),
(item_get_type, ":var_4", ":var_1"),
(try_begin),
(neg|eq, ":var_3", 1),
(neg|eq, ":var_3", 2),
(agent_get_item_cur_ammo, ":var_5", ":var_0"),
(agent_set_slot, ":var_0", 302, ":var_5"),
(try_end),
(item_get_type, ":var_4", ":var_1"),
(try_begin),
(try_begin),
(this_or_next|key_is_down, key_left_mouse_button),
(key_clicked, key_left_mouse_button),
(eq, ":var_4", 17),
(agent_get_slot, ":var_6", ":var_0", 34),
(try_begin),
(neg|gt, ":var_6", 0),
(item_get_slot, ":var_6", ":var_1", 32),
(val_max, ":var_6", 1),
(store_div, ":var_6", 2, ":var_6"),
(agent_set_slot, ":var_0", 34, ":var_6"),
(agent_get_item_cur_ammo, ":var_5", ":var_0"),
(gt, ":var_5", 0),
(assign, ":var_7", -1),
(assign, ":var_8", 4),
(try_for_range, ":var_9", 0, ":var_8"),
(agent_get_item_slot, ":var_10", ":var_0", ":var_9"),
(item_get_slot, ":var_11", ":var_10", 72),
(item_get_type, ":var_4", ":var_10"),
(eq, ":var_4", 18),
(neg|eq, ":var_11", 1),
(neg|eq, ":var_11", 9),
(neg|eq, ":var_11", 22),
(neg|eq, ":var_11", 23),
(neg|eq, ":var_11", 24),
(neg|eq, ":var_11", 26),
(assign, ":var_7", ":var_10"),
(try_end),
(agent_get_look_position, pos66, ":var_0"),
(copy_position, pos88, pos66),
(position_move_y, pos88, 10, 1),
(agent_get_horse, ":var_12", ":var_0"),
(agent_get_animation, ":var_13", ":var_0", 0),
(try_begin),
(this_or_next|eq, ":var_13", "anim_walk_forward_crouch"),
(this_or_next|eq, ":var_13", "anim_crouch_ready_pistol"),
(eq, ":var_13", "anim_stand_to_crouch"),
(position_move_z, pos88, 118, 1),
(else_try),
(neg|ge, ":var_12", 0),
(position_move_z, pos88, 165, 1),
(else_try),
(position_move_z, pos88, 253, 1),
(try_end),
(2076, 67, ":var_0", 19, 1),
(position_copy_origin, pos66, pos67),
(position_copy_rotation, pos66, pos67),
(set_fixed_point_multiplier, 100),
(set_fixed_point_multiplier, 1),
(item_get_slot, ":var_14", ":var_1", 68),
(position_move_y, pos66, ":var_14"),
(position_move_y, pos66, 30),
(position_move_x, pos66, 10),
(position_move_z, pos66, 18, 1),
(agent_get_horse, ":var_12", ":var_0"),
(agent_get_animation, ":var_13", ":var_0", 0),
(try_begin),
(this_or_next|eq, ":var_13", "anim_walk_forward_crouch"),
(this_or_next|eq, ":var_13", "anim_crouch_ready_pistol"),
(eq, ":var_13", "anim_stand_to_crouch"),
(position_move_z, pos66, 0, 1),
(try_end),
(copy_position, pos68, pos66),
(item_get_slot, ":var_15", ":var_1", 71),
(item_get_slot, ":var_16", ":var_1", 28),
(agent_get_item_cur_ammo, ":var_17", ":var_0"),
(agent_get_slot, ":var_18", ":var_0", 302),
(store_sub, ":var_19", ":var_18", ":var_17"),
(store_mul, ":var_20", ":var_19", 3),
(val_min, ":var_20", 50),
(assign, ":var_21", ":var_16"),
(store_sub, ":var_16", ":var_21", ":var_20"),
(val_max, ":var_16", 25),
(agent_get_troop_id, ":var_22", ":var_0"),
(store_proficiency_level, ":var_23", ":var_22", wpt_firearm),
(val_div, ":var_23", 18),
(val_add, ":var_16", ":var_23"),
(store_div, ":var_24", 8000, ":var_16"),
(store_sub, ":var_25", 0, ":var_24"),
(store_random_in_range, ":var_26", ":var_25", ":var_24"),
(store_random_in_range, ":var_27", ":var_25", ":var_24"),
(set_fixed_point_multiplier, 1),
(store_add, ":var_28", 0, "$reserved_100"),
(assign, reg43, "$reserved_100"),
(set_fixed_point_multiplier, 100),
(val_div, ":var_26", 4),
(position_move_z, pos88, ":var_26"),
(position_rotate_x_floating, pos88, ":var_27"),
(agent_set_animation, ":var_0", "anim_release_musket", 1),
(item_get_slot, ":var_29", ":var_1", 29),
(item_get_slot, ":var_30", ":var_1", 31),
(set_fixed_point_multiplier, 1),
(try_begin),
(neg|eq, ":var_15", 1),
(set_fixed_point_multiplier, 1000),
(agent_set_slot, ":var_0", 36, 0),
(set_fixed_point_multiplier, 1),
(this_or_next|key_is_down, key_left_mouse_button),
(key_clicked, key_left_mouse_button),
(gt, ":var_7", 0),//卡在这一步,局部变量7不大于零,7是物品栏里子弹类型的物品id,
(add_missile, ":var_0", 88, ":var_30", ":var_1", 0, ":var_7", 0),
(agent_set_animation, ":var_0", "anim_release_musket", 1),
(val_sub, ":var_5", 1),
(agent_set_ammo, ":var_0", ":var_1", ":var_5"),
(store_random_in_range, ":var_31", 0, 20),
(try_begin),
(neg|gt, ":var_31", 15),
(particle_system_burst_no_sync, "psys_gun_fire", pos66, 3),
(try_end),
(particle_system_burst, "psys_rifle_smoke", pos66, 1),
(play_sound_at_position, ":var_29", pos66),
(else_try),
(eq, ":var_15", 1),
(set_fixed_point_multiplier, 1000),
(agent_set_slot, ":var_0", 36, 0),
(set_fixed_point_multiplier, 1),
(this_or_next|key_is_down, key_left_mouse_button),
(key_clicked, key_left_mouse_button),
(gt, ":var_7", 0),
(add_missile, ":var_0", 69, ":var_30", ":var_1", 0, ":var_7", 0),
(play_sound_at_position, "snd_vaegir_mg_shot", pos69),
(val_mul, ":var_14", -2),
(position_move_y, pos66, ":var_14"),
(particle_system_burst, "psys_gun_fire", pos66, 3),
(val_sub, ":var_5", 1),
(agent_set_ammo, ":var_0", ":var_1", ":var_5"),
(try_end),
(try_begin),
(agent_is_non_player, ":var_0"),
(agent_ai_get_look_target, ":var_32", ":var_0"),
(agent_is_alive, ":var_32"),
(gt, ":var_32", 0),
(agent_get_position, pos52, ":var_32"),
(agent_get_position, pos53, ":var_0"),
(get_distance_between_positions_in_meters, ":var_33", pos52, pos53),
(try_begin),
(neg|ge, ":var_33", 10),
(ge, ":var_19", 7),
(neg|eq, ":var_1", "itm_cannonhand"),
(agent_set_defend_action, ":var_0", 2, 1),
(else_try),
(is_between, ":var_33", 10, 100),
(ge, ":var_19", 5),
(agent_set_defend_action, ":var_0", 2, 1),
(else_try),
(ge, ":var_33", 100),
(ge, ":var_19", 3),
(agent_set_defend_action, ":var_0", 2, 1),
(try_end),
(try_end),
(else_try),
(val_sub, ":var_6", 1),
(agent_set_slot, ":var_0", 34, ":var_6"),
(try_end),
(try_end),
(try_begin),
(eq, ":var_4", 17),
(neg|eq, ":var_3", 1),
(item_get_slot, ":var_6", ":var_1", 32),
(val_max, ":var_6", 1),
(store_div, ":var_6", 4, ":var_6"),
(agent_set_slot, ":var_0", 34, ":var_6"),
(try_end),
(try_end),
(try_begin),
(eq, ":var_5", 0),
(set_fixed_point_multiplier, 100),
(set_zoom_amount, 0),
(set_fixed_point_multiplier, 1),
(try_end),
这是物品触发器,
(item_set_slot,"itm_txz_weapon_a03_04",29,0),
(item_set_slot,"itm_txz_weapon_a03_04",31,300),
(item_set_slot,"itm_txz_weapon_a03_04",32,200),
(item_set_slot,"itm_txz_weapon_a03_04",68,75),
(item_set_slot,"itm_txz_weapon_a03_04",28,100),
(item_set_slot,"itm_txz_weapon_a03_04",72,4),
|
|