巨大怪兽实现范围攻击与击落下马,参考来源:
1.[狂人的知识]较为精细的特技攻击判定方法 - MOD制作技术区 - 骑马与砍杀中文站论坛 - Powered by Discuz! (mountblade.com.cn)
2.骨骼拼接理论及应用---火影须佐能乎(代码) - MOD制作技术区 - 骑马与砍杀中文站论坛 - Powered by Discuz! (mountblade.com.cn)
3.纠正关于部分人对模型对应游戏程序对象的pos概念的错误理解 - MOD制作技术区 - 骑马与砍杀中文站论坛 - Powered by Discuz! (mountblade.com.cn)
4.动作地摊 - 模型贴图制作与交流区 - 骑马与砍杀中文站论坛 - Powered by Discuz! (mountblade.com.cn)
5. 花糕大佬关于动作的咨询解答
效果展示:巨大怪兽-攻击击飞-击落下马_哔哩哔哩bilibili_骑马与砍杀_游戏集锦
使用的动作包见附件:
一、动作核心主要是:amf_priority_die(优先级在死亡之前)、amf_priority_striked(优先级在被打击之前)、acf_displace_position(初为位移)
- ["fall_rider_right_forward_one", acf_enforce_all|acf_displace_position|acf_lock_camera, amf_play|amf_priority_mount|amf_accurate_body|amf_client_prediction,
- [2.2, "anim_human", blow+200, blow+275, arf_blend_in_3|arf_make_custom_sound, pack2f(0.8, 0.0), (0,0,0), 0.3],
- ],
- ["fall_right_front_one", acf_enforce_all|acf_align_with_ground|acf_displace_position|acf_lock_camera, amf_play|amf_priority_mount|amf_accurate_body|amf_client_prediction,
- [2.0, "death2", 0, 53, arf_blend_in_16|arf_make_custom_sound, pack2f(0.65, 0.0), (0,0,0), 1.0],
- ],
-
- ["strike_down_y", acf_enforce_all|acf_align_with_ground|acf_displace_position|acf_lock_camera, amf_play|amf_priority_die|amf_start_instantly|amf_priority_striked|amf_priority_mount|amf_accurate_body|amf_client_prediction,
- [1.5, "strike_down_y",0,17,arf_make_custom_sound,0, (0, -1.5, 0), 0.0],
- ],
-
- ["strike_down_yb", acf_enforce_all|acf_align_with_ground|acf_displace_position|acf_lock_camera, amf_play|amf_priority_die|amf_start_instantly|amf_priority_striked|amf_priority_mount|amf_accurate_body|amf_client_prediction,
- [1.5, "strike_down_yb",0,16,arf_make_custom_sound,0, (0, -1.5, 0), 0.0],
- ],
-
- ["ani_fall_flyback1_near_rise", acf_enforce_all|acf_align_with_ground|acf_displace_position|acf_lock_camera, amf_play|amf_priority_die|amf_start_instantly|amf_priority_striked|amf_priority_mount|amf_accurate_body|amf_client_prediction,
- [1.5, "ani_fall_flyback1_near_rise",0,43,arf_make_custom_sound,0, (0, -1.5, 0), 0.0],
- ],
-
- ["ani_fall_flyback1_med_rise", acf_enforce_all|acf_align_with_ground|acf_displace_position|acf_lock_camera, amf_play|amf_priority_die|amf_start_instantly|amf_priority_striked|amf_priority_mount|amf_accurate_body|amf_client_prediction,
- [2, "ani_fall_flyback1_med_rise",0,53,arf_make_custom_sound,0, (0, -2.5, 0), 0.0],
- ],
-
- ["ani_fall_flyback2_med_rise", acf_enforce_all|acf_align_with_ground|acf_displace_position|acf_lock_camera, amf_play|amf_priority_die|amf_start_instantly|amf_priority_striked|amf_priority_mount|amf_accurate_body|amf_client_prediction,
- [2, "ani_fall_flyback2_med_rise",0,53,arf_make_custom_sound,0, (1, -2.5, 0), 0.0],
- ],
-
- ["ani_fall_flyback1_med_rise_from_left", acf_enforce_all|acf_align_with_ground|acf_displace_position|acf_lock_camera, amf_play|amf_priority_die|amf_start_instantly|amf_priority_striked|amf_priority_mount|amf_accurate_body|amf_client_prediction,
- [2, "ani_fall_flyback1_med_rise_from_left",0,53,arf_make_custom_sound,0, (0, -2.5, 0), 0.0],
- ],
-
- ["ani_fall_flyback2_med_rise_from_left", acf_enforce_all|acf_align_with_ground|acf_displace_position|acf_lock_camera, amf_play|amf_priority_die|amf_start_instantly|amf_priority_striked|amf_priority_mount|amf_accurate_body|amf_client_prediction,
- [2, "ani_fall_flyback2_med_rise_from_left",0,49,arf_make_custom_sound,0, (-1, -2.5, 0), 0.0],
- ],
-
- ["ani_fall_flyback3_med_rise", acf_enforce_all|acf_align_with_ground|acf_displace_position|acf_lock_camera, amf_play|amf_priority_die|amf_start_instantly|amf_priority_striked|amf_priority_mount|amf_accurate_body|amf_client_prediction,
- [2.5, "ani_fall_flyback3_med_rise",0,64,arf_make_custom_sound,0, (0, -4, 0), 0.0],
- ],
-
- ["ani_fall_flyback1_far_rise", acf_enforce_all|acf_align_with_ground|acf_displace_position|acf_lock_camera, amf_play|amf_priority_die|amf_start_instantly|amf_priority_striked|amf_priority_mount|amf_accurate_body|amf_client_prediction,
- [2.5, "ani_fall_flyback1_far_rise",0,56,arf_make_custom_sound,0, (0, -4, 0), 0.0],
- ],
-
- ["ani_fall_flyback2_far_rise", acf_enforce_all|acf_align_with_ground|acf_displace_position|acf_lock_camera, amf_play|amf_priority_die|amf_start_instantly|amf_priority_striked|amf_priority_mount|amf_accurate_body|amf_client_prediction,
- [2.5, "ani_fall_flyback2_far_rise",0,49,arf_make_custom_sound,0, (1, -4, 0), 0.0],
- ],
-
- ["death_face_y", acf_enforce_all|acf_align_with_ground|acf_displace_position|acf_lock_camera, amf_play|amf_priority_die|amf_start_instantly|amf_priority_striked|amf_priority_mount|amf_accurate_body|amf_client_prediction,
- [2.5, "death_face_y",0,49,arf_make_custom_sound,0, (1, -4, 0), 0.0],
- ],
-
- ["ani_fall_flyback3_far_rise", acf_enforce_all|acf_align_with_ground|acf_displace_position|acf_lock_camera, amf_play|amf_priority_die|amf_start_instantly|amf_priority_striked|amf_priority_mount|amf_accurate_body|amf_client_prediction,
- [2.5, "ani_fall_flyback3_far_rise",0,64,arf_make_custom_sound,0, (0, -4, 0), 0.0],
- ],
-
- ["ani_fall_flyback1_far_rise_from_left", acf_enforce_all|acf_align_with_ground|acf_displace_position|acf_lock_camera, amf_play|amf_priority_die|amf_start_instantly|amf_priority_striked|amf_priority_mount|amf_accurate_body|amf_client_prediction,
- [2.5, "ani_fall_flyback1_far_rise_from_left",0,56,arf_make_custom_sound,0, (0, -4, 0), 0.0],
- ],
-
- ["strike_down_y2b", acf_enforce_all|acf_align_with_ground|acf_displace_position|acf_lock_camera, amf_play|amf_priority_die|amf_start_instantly|amf_priority_striked|amf_priority_mount|amf_accurate_body|amf_client_prediction,
- [2.5, "strike_down_y2b",0,21,arf_make_custom_sound,0, (0, -4, 0), 0.0],
- ],
-
-
- ["human_salto_hit", acf_enforce_all|acf_align_with_ground|acf_displace_position|acf_lock_camera, amf_play|amf_priority_die|amf_start_instantly|amf_priority_striked|amf_priority_striked|amf_start_instantly|amf_priority_mount|amf_accurate_body|amf_client_prediction,
- [2.5, "human_salto_hit",0,53,arf_make_custom_sound,0, (0, -2.5, 0), 0.0],
- ],
-
- ["human_be_strike_down_end", acf_enforce_all|acf_align_with_ground|acf_displace_position|acf_lock_camera, amf_play|amf_start_instantly|amf_priority_striked|amf_priority_mount|amf_accurate_body|amf_client_prediction,
- [2.5, "human_salto_hit",0,53,arf_make_custom_sound,0, (0, -2.5, 0), 0.0],
- ],
-
- ["ani_fall_flyfront_rise", acf_enforce_all|acf_align_with_ground|acf_displace_position|acf_lock_camera, amf_play|amf_priority_die|amf_start_instantly|amf_priority_striked|amf_priority_mount|amf_accurate_body|amf_client_prediction,
- [2, "ani_fall_flyfront_rise",0,85,arf_make_custom_sound,0, (0, 2, 0), 0.0],
- ],
复制代码 二、module_constants
- #agent被击飞保护SLOT
- slot_agent_be_sweep_weapon_hit = 101
复制代码
三、module_script:
- ("cf_attack_agent_play_sound",
- [
- (store_script_param, ":agent_no", 1),
- (store_script_param, ":value", 2),
-
- (agent_is_human,":agent_no"),
- (agent_get_troop_id,":troop_id",":agent_no"),
- (troop_get_type,":type",":troop_id"),
-
- (try_begin),
- (eq,":type",tf_female),
- (agent_play_sound,":agent_no", "snd_woman_hit"),
- (else_try),
- (is_between,":type",tf_undead,tf_undead_giant),
- (agent_play_sound,":agent_no", "snd_undead_hit"),
- (else_try),
- (eq,":type",tf_undead_giant),
- (agent_play_sound,":agent_no", "snd_undead_giant_hit"),
- (else_try),
- (agent_play_sound,":agent_no", "snd_man_hit"),
- (try_end),
-
- (ge,":value",1),
- (agent_get_horse,":horse",":agent_no"),
- (try_begin),
- (gt,":horse",-1),
- (ge,":value",2),
- (agent_start_running_away,":horse"),#horse 逃跑agent落马
- (agent_set_animation,":agent_no","anim_fall_right_front_one"),
- (agent_set_slot, ":agent_no", slot_agent_be_sweep_weapon_hit, 28),#保护值,防止多次促发
- (else_try),
- (eq,":value",4),#agent向前倒地
- (agent_set_animation,":agent_no","anim_ani_fall_flyfront_rise"),
- (agent_set_slot, ":agent_no", slot_agent_be_sweep_weapon_hit, 24),#保护值,防止多次促发
- (else_try),
- (eq,":value",2),
- (store_random_in_range,":range","anim_ani_fall_flyback1_med_rise","anim_ani_fall_flyback3_med_rise"),
- (agent_set_animation,":agent_no",":range"),
- (agent_set_slot, ":agent_no", slot_agent_be_sweep_weapon_hit, 24),#保护值,防止多次促发
- (else_try),
- (eq,":value",3),
- (store_random_in_range,":range","anim_ani_fall_flyback3_med_rise","anim_human_be_strike_down_end"),
- (agent_set_animation,":agent_no",":range"),
- (agent_set_slot, ":agent_no", slot_agent_be_sweep_weapon_hit, 28),#保护值,防止多次促发
- (else_try),
- (store_random_in_range,":range","anim_strike_down_yb","anim_ani_fall_flyback1_med_rise"),
- (agent_set_animation,":agent_no",":range"),
- (agent_set_slot, ":agent_no", slot_agent_be_sweep_weapon_hit, 20),#保护值,防止多次促发
- (try_end),
-
- ]
- ),
复制代码 四、module_mission_templates:
攻击定时器
- init_weep_weapon_hit_check = (
- 0.05,0,0,
- [],
- [
- #非玩家 玩家使用按键Y开启效果
- (try_begin),
- (eq,"$key_y_skill",1),
- (get_player_agent_no, ":player_agent"),
- (agent_get_attack_action, ":attack_action", ":player_agent"),
- (eq, ":attack_action",1),
- (store_skill_level, ":power_strike", "skl_power_strike", "trp_player"),
- (store_skill_level, ":power_magic", "skl_power_magic", "trp_player"),
- (store_mul,":harm",":power_strike",4),
- (store_mul,":harm_add",":harm",":power_magic"),
- (val_div,":harm_add",10),
- (store_add,":harm",":harm",":harm_add"),
- (agent_get_bone_position, pos1, ":player_agent", hb_item_r, 1),#item.R
- (agent_get_position, pos3, ":player_agent"),
- (agent_get_wielded_item, ":weapon_no", ":player_agent", 0),
- (item_get_weapon_length, ":weapon_length", ":weapon_no"),
- (position_move_y, pos1, ":weapon_length"),
-
- (try_begin),
- (item_get_type, ":type_no", ":weapon_no"),
- (eq, ":type_no", itp_type_polearm),
- (store_mul,":sub_value",70,1.0),#0.7meter 根据skin 的放大比例
- (val_sub, ":weapon_length", ":sub_value"),
- (try_end),
-
- (assign,":num",5),
- (agent_get_team,":team", ":player_agent"),
- (try_for_agents,":enemies"),#get target
- (gt,":num",0),
- (agent_is_alive,":enemies"),
- (agent_is_human,":enemies"),
- (agent_slot_eq, ":enemies", slot_agent_be_sweep_weapon_hit, 0),
- (agent_get_team,":team_enemie", ":enemies"),
- (neg|eq,":team_enemie",":team"),
- (agent_get_troop_id,":troop_enemies",":enemies"),
- (troop_get_type,":type_enemies",":troop_enemies"),
- (neg|eq,":type_enemies",tf_undead_giant_pluse),
- (neg|eq,":type_enemies",tf_undead_giant),
-
- (assign,":return",0),
- (agent_get_rider,":horse",":enemies"),
- (try_begin),
- (gt,":horse",-1),
- (agent_get_item_id,":item_id",":horse"),
- (is_between,":item_id","itm_griffin","itm_arrows"),
- (assign,":return",1),
- (try_end),
- (eq,":return",0),
-
- (agent_get_position, pos2, ":enemies"),
- (position_move_z, pos2, 100),
-
- (assign,":value",2),
- (try_begin),#判断玩家是否在敌人后面,在value 给定 4
- (position_is_behind_position,pos3,pos2),
- (assign,":value",4),
- (try_end),
-
- (call_script, "script_cf_position_check_hit"),
- (eq, reg1, 1),
- (agent_deliver_damage_to_agent, ":player_agent", ":enemies",":harm",":weapon_no"),
- (agent_deliver_damage_to_agent, ":player_agent", ":enemies",-1),
- (call_script,"script_cf_attack_agent_play_sound",":enemies",":value"),
- (val_sub,":num",1),
- (try_end),
- (try_end),
- #非玩家 这里我使用的单位类型为 tf_undead_giant 在module_skins中的的放大比例1.5 根据玩家代码修改
- (try_for_agents,":agent"),
- (agent_is_alive,":agent"),
- (agent_is_human,":agent"),
- (agent_get_troop_id,":troop",":agent"),
- (troop_get_type,":type",":troop"),
- (eq|this_or_next,":type",tf_undead_giant),
- (eq,":type",tf_undead_giant_pluse),
- (agent_get_combat_state, ":combat_state", ":agent"),#获取战斗状态
- #4 = releasing a melee attack or reloading a crossbow
- #(agent_get_attack_action, ":attack_action", ":agent"),
- # Retrieves agent's current attack action. Possible values: free = 0, readying_attack = 1, releasing_attack = 2, completing_attack_after_hit = 3, attack_parried = 4, reloading = 5, after_release = 6, cancelling_attack = 7.
- (eq, ":combat_state",4),
- (agent_get_troop_id,":troop_id",":agent"),
- (store_skill_level, ":cur_skill", "skl_power_strike", ":troop_id"),
- (agent_get_bone_position, pos1, ":agent", hb_item_r, 1),#item.R
- (agent_get_position, pos3, ":agent"),
-
- #与为玩家最大不同就这里,要根据skin的骨骼比例放大
- (assign,":mul_scale",13),
- (assign,":div_scale",10),
- (assign,":max_agent",3),
- (assign,":value",1),
- (try_begin),
- (eq,":type",tf_undead_giant_pluse),
- (assign,":mul_scale",20),
- (assign,":div_scale",10),
- (assign,":max_agent",6),
- (assign,":value",3),
- (try_end),
-
- (position_get_x, ":var_34", pos3),
- (position_get_y, ":var_35", pos3),
- (position_get_z, ":var_36", pos3),
- (position_get_x, ":var_37", pos1),
- (position_get_y, ":var_38", pos1),
- (position_get_z, ":var_39", pos1),
- (store_sub, ":var_40", ":var_37", ":var_34"), #用pos1 pos3的xyz坐标作差
- (store_sub, ":var_41", ":var_38", ":var_35"),
- (store_sub, ":var_42", ":var_39", ":var_36"),
- (val_mul, ":var_40", ":mul_scale"), #以上xyz差值乘1.5即为1.5倍人实际的头部骨骼坐标与位置坐标的xyz各差值
- (val_mul, ":var_41", ":mul_scale"),
- (val_mul, ":var_42", ":mul_scale"),
- (val_div, ":var_40", ":div_scale"), #以上xyz差值乘1.5即为1.5倍人实际的头部骨骼坐标与位置坐标的xyz各差值
- (val_div, ":var_41", ":div_scale"),
- (val_div, ":var_42", ":div_scale"),
- (store_add, ":var_43", ":var_40", ":var_34"), #人体位置xyz坐标加上实际的须佐人susanoo实际的头部骨骼坐标与位置坐标的xyz各差值得到 6倍骨骼大小的人体头部骨骼坐标xyz值
- (store_add, ":var_44", ":var_41", ":var_35"),
- (store_add, ":var_45", ":var_42", ":var_36"),
- (position_set_x, pos1, ":var_43"),
- (position_set_y, pos1, ":var_44"),
- (position_set_z, pos1, ":var_45"), #将实际6倍骨骼大小的人种须佐susanoo的头部骨骼坐标设为pos43
- (agent_get_wielded_item, ":weapon_no", ":agent", 0),
- (item_get_weapon_length, ":weapon_length", ":weapon_no"),
- (val_mul,":weapon_length",":mul_scale"),#根据skin 的放大比例
- (val_div,":weapon_length",":div_scale"),#根据skin 的放大比例
- (position_move_y, pos1, ":weapon_length"),
-
- (try_begin),
- (item_get_type, ":type_no", ":weapon_no"),
- (eq, ":type_no", itp_type_polearm),
- (store_mul,":sub_value",70,":mul_scale"),#0.7meter 根据skin 的放大比例
- (val_div,":sub_value",":div_scale"),
- (val_sub, ":weapon_length", ":sub_value"),
- (try_end),
-
- (agent_ai_get_num_cached_enemies, ":num", ":agent"),
- (try_begin),#触发上限设置
- (gt, ":num",":max_agent"),
- (assign,":num",":max_agent"),
- (try_end),
-
- (agent_get_team,":team", ":agent"),
- (try_for_range,":index",0,":num"),#get target
- (agent_ai_get_cached_enemy, ":enemies", ":agent", ":index"),
- (gt,":enemies",-1),
- (agent_is_alive,":enemies"),
- (agent_is_human,":enemies"),
- (agent_slot_eq, ":enemies", slot_agent_be_sweep_weapon_hit, 0),
- (agent_get_team,":team_enemie", ":enemies"),
- (neg|eq,":team_enemie",":team"),
- (agent_get_troop_id,":troop_enemies",":enemies"),
- (troop_get_type,":type_enemies",":troop_enemies"),
- (neg|eq,":type_enemies",tf_undead_giant_pluse),
- (neg|eq,":type_enemies",tf_undead_giant),
-
- (assign,":return",0),
- (agent_get_rider,":horse",":enemies"),
- (try_begin),
- (gt,":horse",-1),
- (agent_get_item_id,":item_id",":horse"),
- (is_between,":item_id","itm_griffin","itm_arrows"),
- (assign,":return",1),
- (try_end),
- (eq,":return",0),
-
- (agent_get_position, pos2, ":enemies"),
- (position_move_z, pos2, 100),
-
- (assign,":value",2),
- (try_begin),
- (position_is_behind_position,pos3,pos2),
- (assign,":value",4),
- (try_end),
-
-
- (call_script, "script_cf_position_check_hit"),
- (eq, reg1, 1),
- (assign,":harm",":cur_skill"),
- (val_mul,":harm",5),
- (agent_deliver_damage_to_agent, ":agent", ":enemies",":harm",":weapon_no"),
- (agent_deliver_damage_to_agent, ":agent", ":enemies",-1),
- (call_script,"script_cf_attack_agent_play_sound",":enemies",":value"),
- (try_end),
- (try_end),
-
- ])
复制代码 清空slot_agent_be_sweep_weapon_hit 0.1s一次
- time_task_01s = (
- 0.1,0,0,[],
- [
-
- (try_for_agents,":agent_no"),
- (agent_is_alive,":agent_no"),
- (agent_is_human,":agent_no"),
- (agent_get_slot, ":vlue", ":agent_no", slot_agent_be_sweep_weapon_hit),
- (gt,":vlue",0),
- (val_sub,":vlue",1),
- (agent_set_slot,":agent_no",slot_agent_be_sweep_weapon_hit,":vlue"),
- (try_end),
- ]
- )
复制代码 使用Y开启玩家击飞agennt效果:
- init_the_key_y_skills = (
- #强击魔法 (0, 0, 3 _3秒检测一次,(key_clicked, key_x) ,即点击y键时触发,
- 0,0,3,[
- (store_skill_level,":power_magic","skl_power_magic","trp_player"),
- (gt,":power_magic",0),
- (key_clicked,key_y),
- ],
- [
- (assign,"$key_y_skill",1),
- ]
- )
复制代码
将以上三个个定时器实在lead_charger 等其他需要的地方
|