Прежде всего, вам необходимо скачать файлы кораблей и сцену морской битвы:
]]>http://www.mbreposit...n...=6&lid=1402]]>
Разместите все файлы по их местам и зарегистрируйте BRF-ку в module.ini, не забудьте также поставить в строчке "scan_module_textures" цифру 1.
Теперь вставим корабли в игру. Откройте module_scene_props:
##########################################################SEA BATTLES BEGIN################################################# ("ship",sokf_moveable,"longship","bo_longship", [ (ti_on_scene_prop_init, [ (set_position_delta,0,0,0), (store_trigger_param_1, ":instance_no"), (party_set_slot,"p_ship_colisions",":instance_no",0), ]),]), ("ships_end",0,0,0,[]), ("enemy_ship",sokf_moveable,"longship","bo_longship", [ (ti_on_scene_prop_init, [ (set_position_delta,0,0,0), (store_trigger_param_1, ":instance_no"), (party_set_slot,"p_ship_colisions",":instance_no",0), ]),]), ("enemy_ships_end",0,0,0,[]), ("universal_end",0,0,0,[]), ("ship_protect",0,0,"bo_gourd_spike",[]), ("enemy_ship_protect",0,0,"bo_gourd_spike",[]),##########################################################SEA BATTLES END#################################################Этот код добавлял корабли, теперь же добавим сами сцены. Откройте module_scenes и добавьте это:
("sea_b",sf_generate,"none", "none", (0,0),(240,240),-0.5,"0x0000000030000000c00d2348000000008000000000000000", [],[]), ("sea_land",sf_generate,"none", "none", (0,0),(240,240),-0.5,"0x0000000030000000c00d2348000000008000000000000000", [],[]),И наконец, для того, чтобы вылавливать баги, добавьте это в module_parties:
("burning_buildings","If you see me, report the fire bug.", pf_disabled|icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0, -50),[], 170), ("ship_colisions","If you see me, report the colision bug.", pf_disabled|icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0, -50),[], 170),Теперь нужно определиться, какой тип почвы мы заменим на воду, которой придется заменить воду стандартную. Ваш выбор состоит из этих типов почвы:
rt_steppe = 2
rt_plain = 3
rt_snow = 4
rt_desert = 5
rt_river = 8
rt_mountain_forest = 9
rt_steppe_forest = 10
rt_forest = 11
rt_snow_forest = 12
rt_desert_forest = 13
Замените текстуру выбранной почвы текстурой океана. Далее красным цветом помечена моя почва, вместо неё подставляйте свою.
Теперь откройте module_game_menus и замените меню "encounter_attack" этим:
Сделайте то же самое для join_attack menu:("encounter_attack",[
(eq, "$encountered_party_friendly", 0),
(store_troop_health,reg(5)),(party_get_current_terrain,":terrain","p_main_party"),
(neq,":terrain",rt_steppe),
],
"Charge the enemy.",[
(assign, "$g_battle_result", 0),
(assign, "$g_engaged_enemy", 1),
(call_script, "script_calculate_renown_value"),
(call_script, "script_calculate_battle_advantage"),
(set_battle_advantage, reg0),
(set_party_battle_mode),
(try_begin),
(eq, "$g_encounter_type", enctype_fighting_against_village_raid),
(set_jump_mission,"mt_village_raid"),
(party_get_slot, ":scene_to_use", "$g_encounter_is_in_village", slot_castle_exterior),
(jump_to_scene, ":scene_to_use"),
(else_try),
(eq, "$g_encounter_type", enctype_catched_during_village_raid),
(set_jump_mission,"mt_village_raid"),
(party_get_slot, ":scene_to_use", "$g_encounter_is_in_village", slot_castle_exterior),
(jump_to_scene, ":scene_to_use"),
(else_try),
(set_jump_mission,"mt_lead_charge"),
(call_script, "script_setup_random_scene"),
(try_end),
(assign, "$g_next_menu", "mnu_simple_encounter"),
(jump_to_menu, "mnu_battle_debrief"),
(change_screen_mission),
]),
("encounter_attack",[
(eq, "$encountered_party_friendly", 0),
(store_troop_health,reg(5)),(party_get_current_terrain,":terrain","p_main_party"),
(eq,":terrain",rt_steppe),
],
"Close in and board the enemy.",[
(assign, "$g_battle_result", 0),
(assign, "$g_engaged_enemy", 1),
(call_script, "script_calculate_renown_value"),
(call_script, "script_calculate_battle_advantage"),
(set_battle_advantage, reg0),
(set_party_battle_mode),
(try_begin),
(eq, "$g_encounter_type", enctype_fighting_against_village_raid),
(set_jump_mission,"mt_village_raid"),
(party_get_slot, ":scene_to_use", "$g_encounter_is_in_village", slot_castle_exterior),
(jump_to_scene, ":scene_to_use"),
(else_try),
(eq, "$g_encounter_type", enctype_catched_during_village_raid),
(set_jump_mission,"mt_village_raid"),
(party_get_slot, ":scene_to_use", "$g_encounter_is_in_village", slot_castle_exterior),
(jump_to_scene, ":scene_to_use"),
(else_try),
(set_jump_mission,"mt_ship_battle"),
(try_begin),
(val_add,reg10,reg11),
(gt,reg10,30),
(jump_to_scene, "scn_sea_b"),
(else_try),
(jump_to_scene, "scn_sea_b"),
(end_try),
(try_end),
(assign, "$g_next_menu", "mnu_simple_encounter"),
(jump_to_menu, "mnu_battle_debrief"),
(change_screen_mission),
]),
("encounter_attack",[
(eq, "$encountered_party_friendly", 0),
(store_troop_health,reg(5)),(party_get_current_terrain,":terrain","p_main_party"),
(eq,":terrain",rt_steppe),
],
"Go ashore.",[
(assign, "$g_battle_result", 0),
(assign, "$g_engaged_enemy", 1),
(call_script, "script_calculate_renown_value"),
(call_script, "script_calculate_battle_advantage"),
(set_battle_advantage, reg0),
(set_party_battle_mode),
(try_begin),
(eq, "$g_encounter_type", enctype_fighting_against_village_raid),
(set_jump_mission,"mt_village_raid"),
(party_get_slot, ":scene_to_use", "$g_encounter_is_in_village", slot_castle_exterior),
(jump_to_scene, ":scene_to_use"),
(else_try),
(eq, "$g_encounter_type", enctype_catched_during_village_raid),
(set_jump_mission,"mt_village_raid"),
(party_get_slot, ":scene_to_use", "$g_encounter_is_in_village", slot_castle_exterior),
(jump_to_scene, ":scene_to_use"),
(else_try),
(set_jump_mission,"mt_ship_battle"),
(try_begin),
(val_add,reg10,reg11),
(gt,reg10,30),
(jump_to_scene, "scn_sea_land"),
(else_try),
(jump_to_scene, "scn_sea_land"),
(end_try),
(try_end),
(assign, "$g_next_menu", "mnu_simple_encounter"),
(jump_to_menu, "mnu_battle_debrief"),
(change_screen_mission),
]),
("join_attack",[
# (neq, "$encountered_party_hostile", 0),
(neg|troop_is_wounded, "trp_player"),
## (store_troop_health,reg(5),"trp_player"),
## (ge,reg(5),20),
(party_get_current_terrain,":terrain","p_main_party"),
(neq,":terrain",rt_steppe),
],
"Charge the enemy.",[
(assign, "$g_battle_result", 0),
(call_script, "script_calculate_renown_value"),
(call_script, "script_calculate_battle_advantage"),
(set_battle_advantage, reg0),
(set_party_battle_mode),
(set_jump_mission,"mt_lead_charge"),
(call_script, "script_setup_random_scene"),
(assign, "$g_next_menu", "mnu_join_battle"),
(jump_to_menu, "mnu_battle_debrief"),
(change_screen_mission),
]),
("join_attack",[
# (neq, "$encountered_party_hostile", 0),
(neg|troop_is_wounded, "trp_player"),
## (store_troop_health,reg(5),"trp_player"),
## (ge,reg(5),20),
(party_get_current_terrain,":terrain","p_main_party"),
(eq,":terrain",rt_steppe),
],
"Engage the enemy.",[
(assign, "$g_battle_result", 0),
(call_script, "script_calculate_renown_value"),
(call_script, "script_calculate_battle_advantage"),
(set_battle_advantage, reg0),
(set_party_battle_mode),
(set_jump_mission,"mt_ship_battle"),
(call_script, "script_setup_random_scene"),
(assign, "$g_next_menu", "mnu_join_battle"),
(jump_to_menu, "mnu_battle_debrief"),
(try_begin),
(val_add,reg10,reg11),
(gt,reg10,30),
(jump_to_scene, "scn_sea_b"),
(else_try),
(jump_to_scene, "scn_sea_b"),
(end_try),
(change_screen_mission),
]),
Откройте module_mission_templates и добавьте в конец это:
##################################SEA BATTLE MISSION TEMPLATE################################# ( "ship_battle",mtf_battle_mode,-1, "You close in and board the enemy ships", [(0,mtef_attackers|mtef_team_1,af_override_horse,aif_start_alarmed,4,[]), (1,mtef_attackers|mtef_team_1,af_override_horse,aif_start_alarmed,4,[]), (2,mtef_attackers|mtef_team_1,af_override_horse,aif_start_alarmed,4,[]), (10,mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,4,[]), (11,mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,4,[]), (12,mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,4,[]), ], [ (ti_on_agent_spawn, 0, 0, [], [ (store_trigger_param_1, ":agent_no"), (call_script, "script_agent_reassign_team", ":agent_no"), ]), common_battle_tab_press, (ti_question_answered, 0, 0, [], [(store_trigger_param_1,":answer"), (eq,":answer",0), (assign, "$pin_player_fallen", 0), (try_begin), (store_mission_timer_a, ":elapsed_time"), (gt, ":elapsed_time", 20), (str_store_string, s5, "str_retreat"), (call_script, "script_simulate_retreat", 10, 20), (try_end), (call_script, "script_count_mission_casualties_from_agents"), (finish_mission,0),]), (ti_before_mission_start, 0, 0, [], [ (team_set_relation, 0, 2, 1), (team_set_relation, 1, 3, 1), (call_script, "script_place_player_banner_near_inventory_bms"), ]), (0, 0, ti_once, [], [(assign,"$battle_won",0), (assign,"$defender_reinforcement_stage",0), (assign,"$attacker_reinforcement_stage",0), (assign,"$g_presentation_battle_active", 0), (call_script, "script_place_player_banner_near_inventory"), (call_script, "script_combat_music_set_situation_with_culture"), ]), common_music_situation_update, common_battle_check_friendly_kills, (1, 0, 5, [(lt,"$defender_reinforcement_stage",2), (store_mission_timer_a,":mission_time"), (ge,":mission_time",10), (store_normalized_team_count,":num_defenders", 0), (lt,":num_defenders",6),# (assign, reg2, ":num_defenders"),# (display_message,"@num_defenders = {reg2}") ], [(add_reinforcements_to_entry,0,7),(val_add,"$defender_reinforcement_stage",1)]), (1, 0, 5, [(lt,"$attacker_reinforcement_stage",2), (store_mission_timer_a,":mission_time"), (ge,":mission_time",10), (store_normalized_team_count,":num_attackers", 1), (lt,":num_attackers",6),# (assign, reg2, ":num_attackers"),# (display_message,"@num_attackers = {reg2}") ], [(add_reinforcements_to_entry,3,7),(val_add,"$attacker_reinforcement_stage",1)]), common_battle_check_victory_condition, common_battle_victory_display, (1, 4, ti_once, [(main_hero_fallen)], [ (assign, "$pin_player_fallen", 1), (str_store_string, s5, "str_retreat"), (call_script, "script_simulate_retreat", 10, 20), (assign, "$g_battle_result", -1), (set_mission_result,-1), (call_script, "script_count_mission_casualties_from_agents"), (finish_mission,0)]), ]),Теперь, когда вы путешествуете по воде должеы появиться меню "close in and board the enemy" и\или "go ashore". Осталось только сделать триггер, который превращает вас в корабль. Добавьте это в конец module_triggers:
Надеюсь, это работает.(0.1, 0, 0, [(party_get_current_terrain,":terrain","p_main_party"),
(eq,":terrain",rt_steppe),],
[(party_set_icon,"p_main_party", "icon_ship"),]),
(0.1, 0, 0, [(party_get_current_terrain,":terrain","p_main_party"),
(neq,":terrain",rt_steppe),],
[(party_set_icon,"p_main_party", "icon_player"),]),
(0.1, 0, 0.0, [],
[(try_for_parties, ":cur_party"),
(party_get_current_terrain, ":terrain", ":cur_party"),
(eq, ":terrain", rt_steppe),
(party_get_template_id, ":cur_template", ":cur_party"),
(this_or_next|eq, ":cur_template", "pt_kingdom_hero_party"),
(this_or_next|eq, ":cur_template", "pt_kingdom_caravan_party"),
(this_or_next|eq, ":cur_template", "pt_manhunters"),
(this_or_next|eq, ":cur_template", "pt_village_farmers"),
(this_or_next|eq, ":cur_template", "pt_deserters"),
(this_or_next|eq, ":cur_template", "pt_looters"),
(this_or_next|eq, ":cur_template", "pt_forest_bandits"),
(this_or_next|eq, ":cur_template", "pt_steppe_bandits"),
(this_or_next|eq, ":cur_template", "pt_mountain_bandits"),
(eq, ":cur_template", "pt_sea_raiders"),
(party_set_icon, ":cur_party", "icon_ship"),
(else_try),
(neq,":terrain",rt_steppe),
(party_get_template_id, ":cur_template", ":cur_party"),
(eq, ":cur_template", "pt_kingdom_hero_party"),
(party_set_icon,":cur_party","icon_flagbearer_a"),
(else_try),
(eq, ":cur_template", "pt_kingdom_caravan_party"),
(party_set_icon,":cur_party","icon_mule"),
(else_try),
(eq, ":cur_template", "pt_deserters"),
(party_set_icon,":cur_party","icon_vaegir_knight"),
(else_try),
(eq, ":cur_template", "pt_manhunters"),
(party_set_icon,":cur_party","icon_gray_knight"),
(else_try),
(eq, ":cur_template", "pt_village_farmers"),
(party_set_icon,":cur_party","icon_peasant"),
(else_try),
(this_or_next|eq, ":cur_template", "pt_looters"),
(this_or_next|eq, ":cur_template", "pt_forest_bandits"),
(this_or_next|eq, ":cur_template", "pt_steppe_bandits"),
(this_or_next|eq, ":cur_template", "pt_mountain_bandits"),
(eq, ":cur_template", "pt_sea_raiders"),
(party_set_icon,":cur_party","icon_axeman"),
(else_try),
(eq, ":cur_template", "pt_cattle_herd"),
(party_set_icon,":cur_party","icon_cattle"),
(try_end),]),
-Ruthven