Всадники Кальрадии
Модификации => Обмен опытом (в помощь мододелу) => Тема начата: ARIMA от 27 Мая, 2016, 19:20
-
Есть module_mission_temlase, mission_script, animation можете обьяснить как определить куда вставить эти скрипты
mission_temlase>>>
common_find_hero_1 = ( #find hero 1
ti_on_agent_spawn, 1, 0, [],
[
(try_begin),
(assign, reg11, 0),
(try_for_agents, ":agent_temp"),
(agent_is_human, ":agent_temp"),
(agent_is_alive, ":agent_temp"),
(agent_has_item_equipped, ":agent_temp", "itm_sword_two_handed_a"), #hero 1 is the man who has this item
(assign, reg11, ":agent_temp"),
(try_end),
(try_end),
])
common_find_hero_2 = ( #find hero 2
ti_on_agent_spawn, 1, 0, [],
[
(try_begin),
(assign, reg12, 0),
(try_for_agents, ":agent_temp"),
(agent_is_human, ":agent_temp"),
(agent_is_alive, ":agent_temp"),
(agent_has_item_equipped, ":agent_temp", "itm_glaive"), #hero 2 is the man who has this item
(assign, reg12, ":agent_temp"),
(try_end),
(try_end),
])
common_find_enemy_around1 = ( #Find enemy around hero 1 and decide what hero1 do
0.1, 0.2, 0, [], #hero 1 respond time (lower is better)
[
(neg|eq, reg11, 0),
(assign, ":hero1", reg11),
(assign, ":count1", 0),
(try_for_agents, ":agent_temp"),
(agent_is_human, ":agent_temp"),
(agent_is_alive, ":agent_temp"),
(neg|eq, ":agent_temp", ":hero1"),
(agent_get_position, pos16, ":agent_temp"),
(agent_get_position, pos11, ":hero1"),
(get_sq_distance_between_positions, ":sq_distance1", pos11, pos16),
(try_begin),
(le, ":sq_distance1", 1600), # Square in cm2
(store_add, ":count1", ":count1", 1),
(assign, ":enemy1", ":agent_temp"),
(get_distance_between_positions, ":distance1", pos11, pos16), #i use this later
(try_end),
(try_end),
(agent_is_active, ":hero1"),
(agent_is_active, ":enemy1"),
(try_begin),
(val_add, reg21, 0),
(assign, reg21, ":count1"),
(agent_get_attack_action, ":hero1_attack", ":hero1"),
(agent_get_attack_action, ":enemy_attack", ":enemy1"),
(agent_get_action_dir, ":enemy_attack_direction", ":enemy1"),
(try_begin),
(eq, reg21, 0),
(neg|eq, reg21, ":count1"),
(display_message,"@there are no enemy"),
(else_try),
(eq, reg21, 1),
(call_script, "script_hero_moving1", ":hero1", ":hero1_attack", ":enemy_attack", ":enemy_attack_direction"),
(else_try),
(gt, reg21, 1),
(agent_set_animation, ":hero1", "anim_roll_backward"),
(try_end),
(try_end),
])
common_find_enemy_around2 = ( #Find enemy around hero 2 and decide what hero2 do
0.3, 0.3, 0, [], #hero 2 response time (lower is better)
[
(neg|eq, reg12, 0),
(assign, ":hero1", reg12),
(assign, ":count1", 0),
(try_for_agents, ":agent_temp"),
(agent_is_human, ":agent_temp"),
(agent_is_alive, ":agent_temp"),
(neg|eq, ":agent_temp", ":hero1"),
(agent_get_position, pos17, ":agent_temp"),
(agent_get_position, pos12, ":hero1"),
(get_sq_distance_between_positions, ":sq_distance1", pos12, pos17),
(try_begin),
(le, ":sq_distance1", 2500), # Square in cm2, 2500 because the glaive is long than the sword
(store_add, ":count1", ":count1", 1),
(assign, ":enemy1", ":agent_temp"),
(get_distance_between_positions, ":distance1", pos12, pos17),
(try_end),
(try_end),
(agent_is_active, ":hero1"),
(agent_is_active, ":enemy1"),
(try_begin),
(val_add, reg21, 0),
(assign, reg21, ":count1"),
(agent_get_attack_action, ":hero1_attack", ":hero1"),
(agent_get_attack_action, ":enemy_attack", ":enemy1"),
(agent_get_action_dir, ":enemy_attack_direction", ":enemy1"),
(try_begin),
(eq, reg21, 0),
(neg|eq, reg21, ":count1"),
(display_message,"@there are no enemy"),
(else_try),
(eq, reg21, 1),
(call_script, "script_hero_moving1", ":hero1", ":hero1_attack", ":enemy_attack", ":enemy_attack_direction"),
(else_try),
(gt, reg21, 1),
(agent_set_animation, ":hero1", "anim_roll_backward"),
(try_end),
(try_end),
])
module_script>>>
("hero_moving1",
[
(store_script_param, ":hero1", 1),
(store_script_param, ":hero1_attack", 2),
(store_script_param, ":enemy_attack", 3),
(store_script_param, ":enemy_attack_direction", 4),
(try_begin),
(eq, ":hero1_attack", 0),
(try_begin),
(eq, ":enemy_attack", 0),
(agent_set_animation, ":hero1", "anim_fighting_stance"),
(else_try),
(eq, ":enemy_attack", 1),
(agent_set_animation, ":hero1", "anim_fighting_stance"),
(agent_set_attack_action, ":hero1", 1, 0),
(else_try),
(eq, ":enemy_attack", 2),
(call_script, "script_hero_blocking1", ":hero1", ":enemy_attack_direction"),
(else_try),
(eq, ":enemy_attack", 3),
(agent_set_animation, ":hero1", "anim_roll_backward"),
(else_try),
(ge, ":enemy_attack", 4),
(agent_set_animation, ":hero1", "anim_fighting_stance"),
(agent_set_attack_action, ":hero1", 0, 0),
(try_end),
(else_try),
(eq, ":hero1_attack", 1),
(try_begin),
(eq, ":enemy_attack", 0),
(agent_set_animation, ":hero1", "anim_fighting_stance"),
(agent_set_attack_action, ":hero1", 0, 0),
(else_try),
(eq, ":enemy_attack", 1),
(agent_set_animation, ":hero1", "anim_fighting_stance"),
(agent_set_attack_action, ":hero1", 1, 0),
(else_try),
(eq, ":enemy_attack", 2),
(call_script, "script_hero_blocking1", ":hero1", ":enemy_attack_direction"),
(else_try),
(ge, ":enemy_attack", 3),
(agent_set_animation, ":hero1", "anim_fighting_stance"),
(agent_set_attack_action, ":hero1", 1, 0),
(try_end),
(else_try),
(eq, ":hero1_attack", 2),
(try_begin),
(eq, ":enemy_attack", 0),
(display_message,"@free"),
(else_try),
(eq, ":enemy_attack", 1),
(display_message,"@free"),
(else_try),
(eq, ":enemy_attack", 2),
(call_script, "script_hero_blocking1", ":hero1", ":enemy_attack_direction"),
(else_try),
(eq, ":enemy_attack", 3),
(agent_set_attack_action, ":hero1", 1, 0),
(else_try),
(ge, ":enemy_attack", 4),
(agent_set_attack_action, ":hero1", 1, 0),
(try_end),
(else_try),
(eq, ":hero1_attack", 3),
(try_begin),
(eq, ":enemy_attack", 0),
(agent_set_attack_action, ":hero1", 2, 0),
(else_try),
(eq, ":enemy_attack", 1),
(agent_set_attack_action, ":hero1", 2, 0),
(else_try),
(eq, ":enemy_attack", 2),
(call_script, "script_hero_blocking1", ":hero1", ":enemy_attack_direction"),
(else_try),
(eq, ":enemy_attack", 3),
(agent_set_attack_action, ":hero1", 1, 0),
(else_try),
(ge, ":enemy_attack", 4),
(agent_set_attack_action, ":hero1", 1, 0),
(try_end),
(else_try),
(eq, ":hero1_attack", 4),
(try_begin),
(eq, ":enemy_attack", 0),
(agent_set_attack_action, ":hero1", 2, 0),
(else_try),
(eq, ":enemy_attack", 1),
(agent_set_attack_action, ":hero1", 1, 0),
(else_try),
(eq, ":enemy_attack", 2),
(call_script, "script_hero_blocking1", ":hero1", ":enemy_attack_direction"),
(else_try),
(eq, ":enemy_attack", 3),
(agent_set_attack_action, ":hero1", 1, 0),
(else_try),
(ge, ":enemy_attack", 4),
(agent_set_attack_action, ":hero1", 1, 0),
(try_end),
(try_end),
]),
("hero_blocking1",
[
(store_script_param, ":hero1", 1),
(store_script_param, ":enemy_attack_direction", 2),
(try_begin),
(eq, ":enemy_attack_direction", 0),
(agent_set_defend_action, ":hero1", 0, 100),
(else_try),
(eq, ":enemy_attack_direction", 1),
(agent_set_defend_action, ":hero1", 1, 100),
(else_try),
(eq, ":enemy_attack_direction", 2),
(agent_set_defend_action, ":hero1", 2, 100),
(else_try),
(eq, ":enemy_attack_direction", 3),
(agent_set_defend_action, ":hero1", 3, 100),
(try_end),
]),
module_animation>>>>>
],
["roll_backward", acf_enforce_all|acf_displace_position, amf_priority_equip|amf_play|amf_client_prediction,
[1.0, "roll_backward", 0, 26, arf_blend_in_4, 0, (0, -5.0, 0), 0], #|arf_end_pos_0_25],
],
["fighting_stance", acf_enforce_lowerbody|acf_displace_position, amf_priority_jump_end|amf_play|amf_client_prediction,
[0.3, "fighting_stance", 0, 28, arf_blend_in_4, 0, (0, 0.0, 0), 0], #|arf_end_pos_0_25],
],
["unused_human_anim_49", 0, 0, [1.0, "anim_human", 0, 1, 0]],
-
куда вставить эти скрипты
для начала в спойлер