Seafaring

From Mount&Blade Modding Wiki
Jump to: navigation, search


Disclaimer: Due to the amount of the code i cant be entirely sure whether everything needed was included, if you should have trouble implementing the entire package (i cant help with parts of it alone), please send me a pm or use the discussion feature in here. I might add a topic into the Forge as well, but for now this shall do. Thank you for understanding and possibly helping ;)

[edit] Seafaring V.0.9

The seafaring kit consists of 3 parts:

This kit is meant to be used together. While Seatrade works as a standalone the other 2 will need quite a bit of tweaking by whoever wants to use them, if they are used outside of this kit. I developed this with the Floris Expanded Mod Pack, which is why certain troops may not appear in your game, if you arent using FEMP - you can easily tweak this yourself though. Another snippet of code will fuse PBOD and CC with this code (mainly by disabling them at sea), if you arent using PBOD or CC, you can ignore that part. Using this kit in your mod requires you to give credit where its due.

Features



Seatrade

The original topic about Seatrade can be found in the forge (link: http://forums.taleworlds.com/index.php/topic,163671.0.html). This version has a slightly updated spawn rate to improve the overall balance. In the Seafaring section, we also added these parties into the loot block of caravans as well as included them in the caravan dialogs. The Seatrade code spawns Royal Traders next to coastal towns, uses the Merchant AI and pathfinding for them and adds a bonus to city prosperity for trade conducted.


Module party_templates:

##Floris addon seatrade
  ("sea_traders","Royal Traders",icon_ship|pf_is_ship|carries_goods(50)|pf_show_faction,0,fac_commoners,merchant_personality,[(trp_caravan_master,1,1),(trp_mercenary_enforcer,20,30),(trp_mercenary_crossbowman,5,20),(trp_mercenary_gendarme,5,10),(trp_mercenary_axeman,5,10)]),
##Floris addon seatrade end

Module Constants:

#slot_party_type values
##spt_caravan            = 1
spt_castle             = 2
spt_town               = 3
spt_village            = 4
##spt_forager            = 5
##spt_war_party          = 6
##spt_patrol             = 7 #Activated in Diplomacy
##spt_messenger          = 8 #Activated in Diplomacy
##spt_raider             = 9
##spt_scout              = 10 #Activated in Diplomacy
spt_kingdom_caravan    = 11
##spt_prisoner_train     = 12 #Activated in Diplomacy  as dplmc_spt_recruiter
spt_kingdom_hero_party = 13
spt_merchant_caravan     = 14     #Seatrader
spt_village_farmer     = 15
spt_ship               = 16
spt_cattle_herd        = 17
spt_bandit_lair       = 18
#spt_deserter           = 20    #19 is dplmc_spouse
spt_entrenchment      = 22      #TEMPERED ADDED FOR ENTRENCHMENT PARTIES  #21 USED IN DIPLOMACY FOR "Gift Caravan"[/code]
## Seatrade
slot_town_is_coastal = slot_party_follow_me #63  (any other new or unused slot can ofc be used as well)
##

Module Triggers:

#Kingdom Parties
  (1.0, 0, 0.0, [],
   [(try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end),
      (faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active),
##      (neq, ":cur_kingdom", "fac_player_supporters_faction"),
##      (try_begin),
##        (store_random_in_range, ":random_no", 0, 100),
##        (lt, ":random_no", 10),
##        (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_forager),
##      (try_end),
##      (try_begin),
##        (store_random_in_range, ":random_no", 0, 100),
##        (lt, ":random_no", 10),
##        (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_scout),
##      (try_end),
##      (try_begin),
##        (store_random_in_range, ":random_no", 0, 100),
##        (lt, ":random_no", 10),
##        (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_patrol),
##      (try_end),
##      (try_begin),
##        (store_random_in_range, ":random_no", 0, 100),
##        (lt, ":random_no", 10),
##        (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_messenger),
##      (try_end),
      (try_begin),
        (store_random_in_range, ":random_no", 0, 100),
        (lt, ":random_no", 10),
        (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_kingdom_caravan),
      (try_end),
     (try_begin),                        #SEATRADE
        (store_random_in_range, ":random_no", 0, 100),       #Disable these for faster testing
        (lt, ":random_no", 10),                              #Disable these for faster testing 
        (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_merchant_caravan),
      (try_end),
##      (try_begin),
##        (store_random_in_range, ":random_no", 0, 100),
##        (lt, ":random_no", 10),
##        (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_prisoner_train),
##      (try_end),
    (try_end),
    ]),

Module Scripts:

    # script_create_kingdom_party_if_below_limit
    # Input: arg1 = faction_no, arg2 = party_type (variables beginning with spt_)
    # Output: reg0 = party_no
    ("create_kingdom_party_if_below_limit",
      [
        (store_script_param_1, ":faction_no"),
        (store_script_param_2, ":party_type"),
 
        (call_script, "script_count_parties_of_faction_and_party_type", ":faction_no", ":party_type"),
        (assign, ":party_count", reg0),
 
        (assign, ":party_count_limit", 0),
 
        (faction_get_slot, ":num_towns", ":faction_no", slot_faction_num_towns),
 
        (try_begin),
          ##        (eq, ":party_type", spt_forager),
          ##        (assign, ":party_count_limit", 1),
          ##      (else_try),
          ##        (eq, ":party_type", spt_scout),
          ##        (assign, ":party_count_limit", 1),
          ##      (else_try),
          ##        (eq, ":party_type", spt_patrol),
          ##        (assign, ":party_count_limit", 1),
          ##      (else_try),
          ##        (eq, ":party_type", spt_messenger),
          ##        (assign, ":party_count_limit", 1),
          ##      (else_try),
          (this_or_next|eq, ":party_type", spt_merchant_caravan),    #### This is our sea trader  ##THIS INSTEAD
          (eq, ":party_type", spt_kingdom_caravan),
          (try_begin),
            (eq, ":num_towns", 0),
            (assign, ":party_count_limit", 0),
          (else_try),
            (eq, ":num_towns", 1),
            (assign, ":party_count_limit", 1),
          (else_try),
            (eq, ":num_towns", 2),
            (assign, ":party_count_limit", 3),
          (else_try),
            (assign, ":party_count_limit", 5),
          (try_end),
          ##      (else_try),
          ##        (eq, ":party_type", spt_prisoner_train),
          ##        (assign, ":party_count_limit", 1),
        (try_end),
 
	(try_begin),
		(eq, ":party_type", spt_merchant_caravan),
		(try_begin),
			(eq, ":num_towns", 0),
			(assign, ":party_count_limit", 0),
		(else_try),	
			(eq, ":num_towns", 1),
            (assign, ":party_count_limit", 1),
		(else_try),
			(eq, ":num_towns", 2),
            (assign, ":party_count_limit", 1),
		(else_try),	
            (assign, ":party_count_limit", 2),
		(try_end),
		(try_end),
 
        (assign, reg0, -1),
        (try_begin),
          (lt, ":party_count", ":party_count_limit"),
          (call_script,"script_cf_create_kingdom_party", ":faction_no", ":party_type"),
        (try_end),
    ]),
    # script_cf_create_kingdom_party
    # Input: arg1 = faction_no, arg2 = party_type (variables beginning with spt_)
    # Output: reg0 = party_no
    ("cf_create_kingdom_party",
      [
        (store_script_param_1, ":faction_no"),
        (store_script_param_2, ":party_type"),
 
        (str_store_faction_name, s7, ":faction_no"),
        (assign, ":party_name_str", "str_no_string"),
 
        ##      (faction_get_slot, ":reinforcements_a", ":faction_no", slot_faction_reinforcements_a),
        (faction_get_slot, ":reinforcements_b", ":faction_no", slot_faction_reinforcements_b),
        ##      (faction_get_slot, ":reinforcements_c", ":faction_no", slot_faction_reinforcements_c),
 
        (try_begin),
          ##        (eq, ":party_type", spt_forager),
          ##        (assign, ":party_template", "pt_forager_party"),
          #        (assign, ":party_name_str", "str_s7_foragers"),
          ##      (else_try),
          ##        (eq, ":party_type", spt_scout),
          ##        (assign, ":party_template", "pt_scout_party"),
          #        (assign, ":party_name_str", "str_s7_scouts"),
          ##      (else_try),
          ##        (eq, ":party_type", spt_patrol),
          ##        (assign, ":party_template", "pt_patrol_party"),
          #        (assign, ":party_name_str", "str_s7_patrol"),
          ##      (else_try),
          (eq, ":party_type", spt_kingdom_caravan),
          (assign, ":party_template", "pt_kingdom_caravan_party"),
          #        (assign, ":party_name_str", "str_s7_caravan"),
        (else_try),
          (eq, ":party_type", spt_merchant_caravan),
          (assign, ":party_template", "pt_sea_traders"),            #####SEATRADE Marker#####
          ##      (else_try),
          ##        (eq, ":party_type", spt_messenger),
          ##        (assign, ":party_template", "pt_messenger_party"),
          #        (assign, ":party_name_str", "str_s7_messenger"),
          ##      (else_try),
          ##        (eq, ":party_type", spt_raider),
          ##        (assign, ":party_template", "pt_raider_party"),
          ##        (assign, ":party_name_str", "str_s7_raiders"),
          ##      (else_try),
          ##        (eq, ":party_type", spt_prisoner_train),
          ##        (assign, ":party_template", "pt_prisoner_train_party"),
          #        (assign, ":party_name_str", "str_s7_prisoner_train"),
        (try_end),
 
        (assign, ":result", -1),
        (try_begin),
          (try_begin),
            (this_or_next|eq, ":party_type", spt_merchant_caravan),   ##SEA TRADE
            (eq, ":party_type", spt_kingdom_caravan),
            (call_script,"script_cf_select_random_town_with_faction", ":faction_no", -1),
            (set_spawn_radius, 0),
          (else_try), #not used at the moment
            (call_script,"script_cf_select_random_walled_center_with_faction", ":faction_no", -1),
            (set_spawn_radius, 1),
          (try_end),
          (assign, ":spawn_center", reg0),
          (is_between, ":spawn_center", centers_begin, centers_end),
        (assign, ":continue", 0), ## SEA TRADE
        (try_begin),
            (eq, ":party_type", spt_kingdom_caravan),
            (spawn_around_party,":spawn_center",":party_template"),
            (assign, ":result", reg0),
            (assign, ":continue", 1),
        (else_try),        
            (eq, ":party_type", spt_merchant_caravan),
            (party_slot_ge, ":spawn_center", slot_town_is_coastal, 1),
            (party_get_slot, ":radius", ":spawn_center", slot_town_is_coastal),
            (party_get_position, pos0 , ":spawn_center"),
            (map_get_water_position_around_position, pos1, pos0, ":radius"),
            (spawn_around_party,":spawn_center",":party_template"),
            (assign, ":result", reg0),
            (party_set_position, ":result", pos1),
            (assign, ":continue", 1),
        (try_end),    
        (eq, ":continue", 1), ## SEA TRADE END
 
          (party_set_faction, ":result", ":faction_no"),
          (try_begin),
            (this_or_next|eq, ":party_type", spt_merchant_caravan), ##SEA TRADE
            (eq, ":party_type", spt_kingdom_caravan),
            (party_set_slot, ":result", slot_party_home_center, ":spawn_center"),
            (party_set_slot, ":result", slot_party_last_traded_center, ":spawn_center"),
          (try_end),
          (party_set_slot, ":result", slot_party_type, ":party_type"),
          (party_set_slot, ":result", slot_party_ai_state, spai_undefined),
          (try_begin),
            (neq, ":party_name_str", "str_no_string"),
            (party_set_name, ":result", ":party_name_str"),
          (try_end),
 
          (try_begin),
            ##          (eq, ":party_type", spt_forager),
            ##          (party_add_template, ":result", ":reinforcements_a"),
            ##        (else_try),
            ##          (eq, ":party_type", spt_scout),
            ##          (party_add_template, ":result", ":reinforcements_c"),
            ##        (else_try),
            ##          (eq, ":party_type", spt_patrol),
            ##          (party_add_template, ":result", ":reinforcements_a"),
            ##          (party_add_template, ":result", ":reinforcements_b"),
            ##        (else_try),
            (this_or_next|eq, ":party_type", spt_merchant_caravan),   ##SEA TRADE
            (eq, ":party_type", spt_kingdom_caravan),
            (try_begin),
              (eq, ":faction_no", "fac_player_supporters_faction"),
              (party_get_slot, ":reinforcement_faction", ":spawn_center", slot_center_original_faction),
              (faction_get_slot, ":reinforcements_b", ":reinforcement_faction", slot_faction_reinforcements_b),
            (try_end),
            (party_add_template, ":result", ":reinforcements_b"),
            (party_add_template, ":result", ":reinforcements_b"),
            (party_set_ai_behavior,":result",ai_bhvr_travel_to_party),
            (party_set_ai_object,":result",":spawn_center"),
            (party_set_flags, ":result", pf_default_behavior, 1),
            (store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin),
            (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
              (store_add, ":cur_goods_price_slot", ":cur_goods", ":item_to_price_slot"),
              (party_set_slot, ":result", ":cur_goods_price_slot", average_price_factor),
            (try_end),
	  (party_set_bandit_attraction, ":result", 75), ##ADDED THIS LINE
            ##        (else_try),
            ##          (eq, ":party_type", spt_messenger),
            ##          (faction_get_slot, ":messenger_troop", ":faction_no", slot_faction_messenger_troop),
            ##          (party_add_leader, ":result", ":messenger_troop"),
            ##          (party_set_ai_behavior,":result",ai_bhvr_travel_to_party),
            ##          (party_set_ai_object,":result",":spawn_center"),
            ##          (party_set_flags, ":result", pf_default_behavior, 0),
            ##        (else_try),
            ##          (eq, ":party_type", spt_raider),
            ##          (party_add_template, ":result", ":reinforcements_c"),
            ##          (party_add_template, ":result", ":reinforcements_b"),
            ##          (party_add_template, ":result", "pt_raider_captives"),
            ##        (else_try),
            ##          (eq, ":party_type", spt_prisoner_train),
            ##          (party_add_template, ":result", ":reinforcements_b"),
            ##          (party_add_template, ":result", ":reinforcements_a"),
            ##          (try_begin),
            ##            (call_script,"script_cf_faction_get_random_enemy_faction",":faction_no"),
            ##            (store_random_in_range,":r",0,3),
            ##            (try_begin),
            ##              (lt, ":r", 1),
            ##              (faction_get_slot, ":captive_reinforcements", reg0, slot_faction_reinforcements_b),
            ##            (else_try),
            ##              (faction_get_slot, ":captive_reinforcements", reg0, slot_faction_reinforcements_a),
            ##            (try_end),
            ##            (party_add_template, ":result", ":captive_reinforcements",1),
            ##          (else_try),
            ##            (party_add_template, ":result", "pt_default_prisoners"),
            ##          (try_end),
          (try_end),
        (try_end),
        (ge, ":result", 0),
        (assign, reg0, ":result"),
    ]),
      # Towns:
      (try_for_range, ":item_no", trade_goods_begin, trade_goods_end),
        (store_sub, ":offset", ":item_no", trade_goods_begin),
        (val_add, ":offset", slot_town_trade_good_prices_begin),
        (try_for_range, ":center_no", centers_begin, centers_end),
          (party_set_slot, ":center_no", ":offset", average_price_factor), #1000
        (try_end),
        ##        (party_set_slot, "p_zendar", ":offset", average_price_factor),
        ##        (party_set_slot, "p_salt_mine", ":offset", average_price_factor),
        ##        (party_set_slot, "p_four_ways_inn", ":offset", average_price_factor),
      (try_end),
 
      (call_script, "script_initialize_trade_routes"),
      (call_script, "script_initialize_sea_trade_routes"), ###Seatrade Marker
      (call_script, "script_initialize_town_arena_info"),
      #start some tournaments
      (try_for_range, ":town_no", towns_begin, towns_end),
        (store_random_in_range, ":rand", 0, 100),
        (lt, ":rand", 20),
        (store_random_in_range, ":random_days", 12, 15),
        (party_set_slot, ":town_no", slot_town_has_tournament, ":random_days"),
      (try_end),
  ("initialize_sea_trade_routes",
    [
     (party_set_slot, "p_town_1", slot_town_is_coastal, 4), #Sargoth
     (party_set_slot, "p_town_2", slot_town_is_coastal, 2), #Thir
     (party_set_slot, "p_town_6", slot_town_is_coastal, 3), #Praven
     (party_set_slot, "p_town_12", slot_town_is_coastal, 3), #Wercheg
     (party_set_slot, "p_town_13", slot_town_is_coastal, 5), #Rivacheg
     (party_set_slot, "p_town_15", slot_town_is_coastal, 4), #Yalen
     (party_set_slot, "p_town_19", slot_town_is_coastal, 8), #Shariz
      #RIVACHEG - 2 Routes
      (call_script, "script_set_trade_route_between_centers", "p_town_13", "p_town_2"), #Rivacheg - Thir
      (call_script, "script_set_trade_route_between_centers", "p_town_13", "p_town_6"), #Rivacheg - Praven
 
      #WERCHEG - 2 Routes
      (call_script, "script_set_trade_route_between_centers", "p_town_12", "p_town_2"), #Wercheg - Thir
      (call_script, "script_set_trade_route_between_centers", "p_town_12", "p_town_1"), #Wercheg - Sargoth
 
      #SARGOTH - 2 routes
      #Wercheg
      (call_script, "script_set_trade_route_between_centers", "p_town_1", "p_town_2"), #Sargoth - Tihr
 
      #TIHR - 4 Routes
      #Rivacheg, Wercheg, Sargoth
      (call_script, "script_set_trade_route_between_centers", "p_town_2", "p_town_6"), #Tihr - Praven
 
      #Praven - 3 Routes
      #Rivacheg, Thir
      (call_script, "script_set_trade_route_between_centers", "p_town_6", "p_town_15"), #Praven - Yalen
 
      #Yalen - 2 Routes
      #Praven
      (call_script, "script_set_trade_route_between_centers", "p_town_15", "p_town_19"), #Yalen - Shariz
 
      #Shariz - 1 Route
      #Yalen
  ]),
    ("cf_select_most_profitable_coastal_town_at_peace_with_faction_in_trade_route",
      [
        (store_script_param, ":town_no", 1),
        (store_script_param, ":faction_no", 2),
 
        (assign, ":result", -1),
        (assign, ":best_town_score", 0),
        (store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin),
 
        (try_for_range, ":cur_slot", slot_town_trade_routes_begin, slot_town_trade_routes_end),
          (party_get_slot, ":cur_town", ":town_no", ":cur_slot"),
          (gt, ":cur_town", 0),
          (party_slot_ge, ":cur_town", slot_town_is_coastal, 1), #Seatrade
 
          (store_faction_of_party, ":cur_faction", ":cur_town"),
          (store_relation, ":reln", ":cur_faction", ":faction_no"),
          (ge, ":reln", 0),
 
          (assign, ":cur_town_score", 0),
          (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
            (neq, ":cur_goods", "itm_butter"), #Don't count perishables
            (neq, ":cur_goods", "itm_cattle_meat"),
            (neq, ":cur_goods", "itm_chicken"),
            (neq, ":cur_goods", "itm_pork"),
 
            (store_add, ":cur_goods_price_slot", ":cur_goods", ":item_to_price_slot"),
            (party_get_slot, ":origin_price", ":town_no", ":cur_goods_price_slot"),
            (party_get_slot, ":destination_price", ":cur_town", ":cur_goods_price_slot"),
 
            (gt, ":destination_price", ":origin_price"),
            (store_sub, ":price_dif", ":destination_price", ":origin_price"),
 
            (try_begin), #weight luxury goods double
              (this_or_next|eq, ":cur_goods", "itm_spice"),
              (eq, ":cur_goods", "itm_velvet"),
              (val_mul, ":price_dif", 2),
            (try_end),
            (val_add, ":cur_town_score", ":price_dif"),
          (try_end),
 
          ##        (try_begin),
          ##            (eq, "$cheat_mode", 1),
          ##            (str_store_party_name, s10, ":town_no"),
          ##            (str_store_party_name, s11, ":cur_town"),
          ##            (assign, reg3, ":cur_town_score"),
          ##            (display_message, "str_caravan_in_s10_considers_s11_total_price_dif_=_reg3"),
          ##        (try_end),
 
          (gt, ":cur_town_score", ":best_town_score"),
          (assign, ":best_town_score", ":cur_town_score"),
          (assign, ":result", ":cur_town"),
 
        (try_end),
 
        (gt, ":result", -1), #Fail if there are no towns
 
        (assign, reg0, ":result"),
 
        #      (store_current_hours, ":hour"),
        #      (party_set_slot, ":result", slot_town_caravan_last_visit, ":hour"),
 
        # (try_begin),
        ###(eq, "$cheat_mode", 1),
        # (assign, reg3, ":best_town_score"),
        # (str_store_party_name, s3, ":town_no"),
        # (str_store_party_name, s4, ":result"),
        # (display_message, "str_test__caravan_in_s3_selects_for_s4_trade_score_reg3"),
        # (try_end),
 
    ]),

Module simple_triggers:

  #Troop AI: Merchants thinking
  (8,
   [
       (try_for_parties, ":party_no"),
        (try_begin),
         (party_slot_eq, ":party_no", slot_party_type, spt_kingdom_caravan),
         (party_is_in_any_town, ":party_no"),
 
         (store_faction_of_party, ":merchant_faction", ":party_no"),
         (faction_get_slot, ":num_towns", ":merchant_faction", slot_faction_num_towns),
         (try_begin),
           (le, ":num_towns", 0),
           (remove_party, ":party_no"),
         (else_try),
           (party_get_cur_town, ":cur_center", ":party_no"),
 
           (store_random_in_range, ":random_no", 0, 100),                               
 
           (try_begin),
             (party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
 
             (game_get_reduce_campaign_ai, ":reduce_campaign_ai"),
             (try_begin),
               (eq, ":reduce_campaign_ai", 0), #hard (less money from tariffs)
               (assign, ":tariff_succeed_limit", 35),
             (else_try),
               (eq, ":reduce_campaign_ai", 1), #medium (normal money from tariffs)
               (assign, ":tariff_succeed_limit", 45),
             (else_try),
               (eq, ":reduce_campaign_ai", 2), #easy (more money from tariffs)
               (assign, ":tariff_succeed_limit", 60),
             (try_end),               
           (else_try),
             (assign, ":tariff_succeed_limit", 45),
           (try_end),
 
           (lt, ":random_no", ":tariff_succeed_limit"),                 
 
           (assign, ":can_leave", 1),
           (try_begin),
             (is_between, ":cur_center", walled_centers_begin, walled_centers_end),
             (neg|party_slot_eq, ":cur_center", slot_center_is_besieged_by, -1),
             (assign, ":can_leave", 0),
           (try_end),
           (eq, ":can_leave", 1),
 
           (assign, ":do_trade", 0),
           (try_begin),
             (party_get_slot, ":cur_ai_state", ":party_no", slot_party_ai_state),
             (eq, ":cur_ai_state", spai_trading_with_town),
             (party_get_slot, ":cur_ai_object", ":party_no", slot_party_ai_object),
             (eq, ":cur_center", ":cur_ai_object"),
             (assign, ":do_trade", 1),
           (try_end),
 
           (assign, ":target_center", -1),
 
           (try_begin), #Make sure escorted caravan continues to its original destination.
             (eq, "$caravan_escort_party_id", ":party_no"),
             (neg|party_is_in_town, ":party_no", "$caravan_escort_destination_town"),
             (assign, ":target_center", "$caravan_escort_destination_town"),
           (else_try),         
             (call_script, "script_cf_select_most_profitable_town_at_peace_with_faction_in_trade_route", ":cur_center", ":merchant_faction"),
             (assign, ":target_center", reg0),
           (try_end),
           (is_between, ":target_center", towns_begin, towns_end),
           (neg|party_is_in_town, ":party_no", ":target_center"),
 
           (try_begin),
             (eq, ":do_trade", 1),
             (str_store_party_name, s7, ":cur_center"),             
             (call_script, "script_do_merchant_town_trade", ":party_no", ":cur_center"),
           (try_end),
           (party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_party),
           (party_set_ai_object, ":party_no", ":target_center"),
           (party_set_flags, ":party_no", pf_default_behavior, 0),
           (party_set_slot, ":party_no", slot_party_ai_state, spai_trading_with_town),
           (party_set_slot, ":party_no", slot_party_ai_object, ":target_center"),
         (try_end),
        (else_try), ## SEA TRADE
         (party_slot_eq, ":party_no", slot_party_type, spt_merchant_caravan),
         (get_party_ai_object, ":object_town", ":party_no"),
         (party_slot_ge, ":object_town", slot_town_is_coastal, 1),
         (store_distance_to_party_from_party, ":dist", ":party_no", ":object_town"),
         (party_get_position, pos0, ":object_town"),     
         (party_get_slot, ":radius", ":object_town", slot_town_is_coastal),
         (val_add, ":radius", 3),
         (lt, ":dist", ":radius"),               
         (assign, ":cur_center", ":object_town"),
         (store_faction_of_party, ":merchant_faction", ":party_no"),
         (faction_get_slot, ":num_towns", ":merchant_faction", slot_faction_num_towns),
         (try_begin),
           (le, ":num_towns", 0),
           (remove_party, ":party_no"),
         (else_try),         
           (store_random_in_range, ":random_no", 0, 100),                             
 
           (try_begin),
             (party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
 
             (game_get_reduce_campaign_ai, ":reduce_campaign_ai"),
             (try_begin),
               (eq, ":reduce_campaign_ai", 0), #hard (less money from tariffs)
               (assign, ":tariff_succeed_limit", 35),
             (else_try),
               (eq, ":reduce_campaign_ai", 1), #medium (normal money from tariffs)
               (assign, ":tariff_succeed_limit", 45),
             (else_try),
               (eq, ":reduce_campaign_ai", 2), #easy (more money from tariffs)
               (assign, ":tariff_succeed_limit", 60),
             (try_end),               
           (else_try),
             (assign, ":tariff_succeed_limit", 45),
           (try_end),
 
           (lt, ":random_no", ":tariff_succeed_limit"),                 
 
           (assign, ":can_leave", 1),
           (try_begin),
             (is_between, ":cur_center", walled_centers_begin, walled_centers_end),
             (neg|party_slot_eq, ":cur_center", slot_center_is_besieged_by, -1),
             (assign, ":can_leave", 0),
           (try_end),
           (eq, ":can_leave", 1),
 
           (assign, ":do_trade", 0),
           (try_begin),
             (party_get_slot, ":cur_ai_state", ":party_no", slot_party_ai_state),
             (eq, ":cur_ai_state", spai_trading_with_town),
             (party_get_slot, ":cur_ai_object", ":party_no", slot_party_ai_object),
             (eq, ":cur_center", ":cur_ai_object"),
             (assign, ":do_trade", 1),
           (try_end),
 
           (assign, ":target_center", -1),
 
           (try_begin), #Make sure escorted caravan continues to its original destination.
             #(eq, "$caravan_escort_party_id", ":party_no"),
             #(neg|party_is_in_town, ":party_no", "$caravan_escort_destination_town"),
             #(assign, ":target_center", "$caravan_escort_destination_town"),
           #(else_try),                                 #Calling altered script for seatrade
             (call_script, "script_cf_select_most_profitable_coastal_town_at_peace_with_faction_in_trade_route", ":cur_center", ":merchant_faction"),
             (assign, ":target_center", reg0),
           (try_end),
           (is_between, ":target_center", towns_begin, towns_end),
           (store_distance_to_party_from_party, ":target_dist", ":party_no", ":target_center"),
           (party_get_position, pos0, ":target_center"),
           (party_get_slot, ":radius", ":target_center", slot_town_is_coastal),
           (map_get_water_position_around_position, pos1, pos0, ":radius"),
           (val_add, ":radius", 2),           
           (gt, ":target_dist", ":radius"), #was 5 #Ensures that they aren't already at the target party...just a redundancy check, as there is with caravans
 
           (try_begin),
             (eq, ":do_trade", 1),
             (str_store_party_name, s7, ":cur_center"),           
             (call_script, "script_do_merchant_town_trade", ":party_no", ":cur_center"),
           (try_end),
 
           (party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_point),
           (party_set_ai_target_position, ":party_no", pos1),
           # (party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_party),
           (party_set_ai_object, ":party_no", ":target_center"),
           (party_set_flags, ":party_no", pf_default_behavior, 0),
           (party_set_slot, ":party_no", slot_party_ai_state, spai_trading_with_town),
           (party_set_slot, ":party_no", slot_party_ai_object, ":target_center"), 
         (try_end),           
        (try_end), ## Caravan vs Sea Trade
       (try_end), #Party Loop
    ]),

Credits go to



Ruthvens Scenes and Battles
The original topic can be found in the forge (link: http://forums.taleworlds.com/index.php/topic,136095.msg3275277.html#msg3275277). In this kit however we only use parts of what is being listed in the topic and a few things have been updated to further integrate fighting into the game - therefore i will first copy-paste the necessary lines here and then display the updated code.

Quote:
__________________________________________
First of all, let's add the new scenes. Download this: http://www.mbrepository.com/file.php?id=2258 It includes the ship scenes, and the scenes for the island, the mountain pass, and Sarranid city. Right now, you only need to pay attention to the scenes named "sea_scene_X". Extract those three scenes (ignoring that they go 1, 2, then 4, as sea scene 3 was too lolzy to include) to your mod's SceneObj folder, and we'll just let those sit there for now.

With that done, you can actually add those scenes into the game. So open up module_scenes, and at the bottom add:

#Wulf begin
  ("sea_1",sf_generate,"none", "none", (0,0),(240,240),-0.5,"0x0000000030000000c00d2348000000008000000000000000",
   [],[]),
  ("sea_4",sf_generate,"none", "none", (0,0),(240,240),-0.5,"0x0000000030000000c00d2348000000008000000000000000",
   [],[]),
  ("sea_2",sf_generate,"none", "none", (0,0),(240,240),-0.5,"0x0000000030000000c00d2348000000008000000000000000",
   [],[]),
#Wulf end

[...] then open module_party_templates. Look for a small code called "sea_raider", and underneath it, put:

#wulf
  ("sea_raiders_ships","Sea Raiders",icon_ship|pf_is_ship|carries_goods(2),0,fac_outlaws,bandit_personality,[(trp_sea_raider,50,100)]),
#wulf end

What this is is a party of Sea Raiders, but on a ship. You can change the number of troops and the type of troop by editing the last box in the tuple, the "trp_sea_raider,5,50". trp_sea_raider (obviously) means Sea Raider troops. The 5 is the minimum number of Sea Raiders in a party, and 50 is the maximum. Now we need somewhere for them to spawn from, so open up module_parties and look for "Bridge 14". Underneath it, paste this code:

#Wulf
 ("ship_raider_spawn_point_1"   ,"the_ocean",pf_disabled|pf_is_static, no_menu, pt_none, fac_outlaws,0,ai_bhvr_hold,0,(-106.4,126.4),[(trp_looter,15,0)]),
#Wulf

Now [...] open module_scripts. Search for "spawn_bandits", and scroll down just a bit and look for a code that looks like this:

         (try_begin),
           (store_num_parties_of_template, ":num_parties", "pt_mountain_bandits"),
           (lt,":num_parties",18), #was 14 at mount&blade, 18 in warband
           (store_random,":spawn_point",num_mountain_bandit_spawn_points),
           (val_add,":spawn_point","p_mountain_bandit_spawn_point"),
           (set_spawn_radius, 25),
           (spawn_around_party,":spawn_point","pt_mountain_bandits"),
         (try_end),

Now, just leave that one alone, but right underneath the (try_end), add this:

     #Wulf
     (try_begin),
       (store_num_parties_of_template, ":num_parties", "pt_sea_raiders_ships"),
       (lt,":num_parties",25),
       (store_random,":spawn_point",num_mountain_bandit_spawn_points),
       (val_add,":spawn_point","p_ship_raider_spawn_point_1"),
       (spawn_around_party,":spawn_point","pt_sea_raiders_ships"),
     (try_end),
     #Wulf end

__________________________________________

This is largely it for Ruthvens Scenes and Seabattles (Credits obviously go to Ruthven), but the following code is useful and necessary for them as well. You can view it as both - a part of Seafaring as well as an addition to Ruthvens Scenes.
We will start with the simple_encounter game menu.

  (
    "simple_encounter",mnf_enable_hot_keys|mnf_scale_picture,
    "{s2} You have {reg10} troops fit for battle against their {reg11}. {s4}^{s15}", ## Floris adds {s4}.
    "none",
    [
#TEMPERED CHANGES BEGIN
		(str_clear,s15),
		(str_store_string,s15,"@_"),
		(try_begin),
			(party_get_slot,":party_entrenched","p_main_party",slot_party_entrenched),
			(this_or_next|ge,":party_entrenched",1),
			(party_slot_eq,"p_main_party",slot_party_siege_camp,1),
			(str_store_string,s15,"str_entrench"),
			(assign, "$cant_leave_encounter", 1),
		(try_end),
#TEMPERED CHANGES END
		(assign, "$g_enemy_party", "$g_encountered_party"),
        (assign, "$g_ally_party", -1),
        (call_script, "script_encounter_calculate_fit"),
        (try_begin),
          (eq, "$new_encounter", 1),
          (assign, "$new_encounter", 0),
          (assign, "$g_encounter_is_in_village", 0),
          (assign, "$g_encounter_type", 0),
          (try_begin),
            (party_slot_eq, "$g_enemy_party", slot_party_ai_state, spai_raiding_around_center),        
            (party_get_slot, ":village_no", "$g_enemy_party", slot_party_ai_object),
 
            (store_distance_to_party_from_party, ":dist", ":village_no", "$g_enemy_party"),
 
            (try_begin),
              (lt, ":dist", raid_distance),
              (assign, "$g_encounter_is_in_village", ":village_no"),
              (assign, "$g_encounter_type", enctype_fighting_against_village_raid),
            (try_end),
          (try_end),
          (try_begin),
            (gt, "$g_player_raiding_village", 0),
            (assign, "$g_encounter_is_in_village", "$g_player_raiding_village"),
            (assign, "$g_encounter_type", enctype_catched_during_village_raid),
            (party_quick_attach_to_current_battle, "$g_encounter_is_in_village", 1), #attach as enemy
            (str_store_string, s1, "@Villagers"),
            (display_message, "str_s1_joined_battle_enemy"),
          (else_try),
            (eq, "$g_encounter_type", enctype_fighting_against_village_raid),
            (party_quick_attach_to_current_battle, "$g_encounter_is_in_village", 0), #attach as friend
            (str_store_string, s1, "@Villagers"),
            (display_message, "str_s1_joined_battle_friend"),
            # Let village party join battle at your side
          (try_end),
 
          ## CC
          (try_begin),
            (party_get_template_id, ":template_id", "$g_enemy_party"),
            (neq, ":template_id", "pt_routed_warriors"),
            (call_script, "script_let_nearby_parties_join_current_battle", 0, 0),
          (try_end),
          ## CC
          (call_script, "script_encounter_init_variables"),
          (assign, "$encountered_party_hostile", 0),
          (assign, "$encountered_party_friendly", 0),
          (try_begin),
            (gt, "$g_encountered_party_relation", 0),
            (assign, "$encountered_party_friendly", 1),
          (try_end),
          ## CC
          (try_begin),
            (party_get_template_id, ":template_id", "$g_enemy_party"),
            (eq, ":template_id", "pt_routed_warriors"),
            (assign, "$encountered_party_friendly", 0),
          (try_end),
          ## CC
          (try_begin),
            (lt, "$g_encountered_party_relation", 0),
            (assign, "$encountered_party_hostile", 1),
            (try_begin),
              (encountered_party_is_attacker),
              (assign, "$cant_leave_encounter", 1),
            (try_end),
          (try_end),
          (assign, "$talk_context", tc_party_encounter),
          (call_script, "script_setup_party_meeting", "$g_encountered_party"),
        (else_try), #second or more turn
#          (try_begin),
#            (call_script, "script_encounter_calculate_morale_change"),
#          (try_end),
          (try_begin),
            # We can leave battle only after some troops have been killed. 
            (eq, "$cant_leave_encounter", 1),
			(party_get_current_terrain, ":terrain", "p_main_party"), #No fleeing at sea / Seafaring
			(neq, ":terrain", 0), 
            (call_script, "script_party_count_members_with_full_health", "p_main_party_backup"),
            (assign, ":org_total_party_counts", reg0),
            (call_script, "script_party_count_members_with_full_health", "p_encountered_party_backup"),
            (val_add, ":org_total_party_counts", reg0),
 
            (call_script, "script_party_count_members_with_full_health", "p_main_party"),
            (assign, ":cur_total_party_counts", reg0),
            (call_script, "script_party_count_members_with_full_health", "p_collective_enemy"),
            (val_add, ":cur_total_party_counts", reg0),
 
            (store_sub, ":leave_encounter_limit", ":org_total_party_counts", 10),
            (lt, ":cur_total_party_counts", ":leave_encounter_limit"),
            (assign, "$cant_leave_encounter", 0),
          (try_end),
          (eq, "$g_leave_encounter",1),
          (change_screen_return),
        (try_end),
 
        #setup s2
        (try_begin),
          (party_is_active, "$g_encountered_party"),
          (str_store_party_name, s1,"$g_encountered_party"),
          (try_begin),
            (eq, "$g_encounter_type", 0),
            (str_store_string, s2,"@You have encountered {s1}."),
          (else_try),
            (eq, "$g_encounter_type", enctype_fighting_against_village_raid),
            (str_store_party_name, s3, "$g_encounter_is_in_village"),
            (str_store_string, s2,"@You have engaged {s1} while they were raiding {s3}."),
          (else_try),
            (eq, "$g_encounter_type", enctype_catched_during_village_raid),
            (str_store_party_name, s3, "$g_encounter_is_in_village"),
            (str_store_string, s2,"@You were caught by {s1} while your forces were raiding {s3}."),
          (try_end),
        (try_end),
        (try_begin),
          (call_script, "script_party_count_members_with_full_health", "p_collective_enemy"),
          (assign, ":num_enemy_regulars_remaining", reg0),
          (assign, ":enemy_finished", 0),
          (try_begin),
            (eq, "$g_battle_result", 1), #battle won
 
            (this_or_next|le, ":num_enemy_regulars_remaining", 0), #battle won ##1.132, new line
            (le, ":num_enemy_regulars_remaining",  "$num_routed_enemies"), #replaced for above line because we do not want routed agents to spawn again in next turn of battle.
 
            (assign, ":enemy_finished",1),
          (else_try),
            (eq, "$g_engaged_enemy", 1), 
 
            (this_or_next|le, ":num_enemy_regulars_remaining", 0), ##1.132, new line
            (le, "$g_enemy_fit_for_battle", "$num_routed_enemies"),  #replaced for above line because we do not want routed agents to spawn again in next turn of battle.
 
            (ge, "$g_friend_fit_for_battle",1),
            (assign, ":enemy_finished",1),
          (try_end),
 
          (this_or_next|eq, ":enemy_finished",1),
          (eq,"$g_enemy_surrenders",1),
          (assign, "$g_next_menu", -1),
          (jump_to_menu, "mnu_total_victory"),
        (else_try),       
          (call_script, "script_party_count_members_with_full_health", "p_main_party"),        
          (assign, ":num_our_regulars_remaining", reg0),
          (assign, ":friends_finished",0),
          (try_begin),
            (eq, "$g_battle_result", -1),
 
            #(eq, ":num_our_regulars_remaining", 0), #battle lost
            (le, ":num_our_regulars_remaining",  "$num_routed_us"), #replaced for above line because we do not want routed agents to spawn again in next turn of battle.
 
            (assign,  ":friends_finished", 1),
          (else_try),
            (eq, "$g_engaged_enemy", 1),
            (ge, "$g_enemy_fit_for_battle",1),
            (le, "$g_friend_fit_for_battle",0),
            (assign,  ":friends_finished",1),
          (try_end),
 
          (this_or_next|eq,  ":friends_finished",1),
          (eq,"$g_player_surrenders",1),
          (assign, "$g_next_menu", "mnu_captivity_start_wilderness"),
          (jump_to_menu, "mnu_total_defeat"),
        (try_end),
 
 
        (try_begin),
          (eq, "$g_encountered_party_template", "pt_looters"),
          (set_background_mesh, "mesh_pic_bandits"),
        (else_try),
          (eq, "$g_encountered_party_template", "pt_mountain_bandits"),
          (set_background_mesh, "mesh_pic_mountain_bandits"),
        (else_try),
          (eq, "$g_encountered_party_template", "pt_steppe_bandits"),
          (set_background_mesh, "mesh_pic_steppe_bandits"),
        (else_try),
          (eq, "$g_encountered_party_template", "pt_taiga_bandits"),
          (set_background_mesh, "mesh_pic_steppe_bandits"),
        (else_try),
          (eq, "$g_encountered_party_template", "pt_sea_raiders"),
          (set_background_mesh, "mesh_pic_sea_raiders"),
        (else_try),
          (eq, "$g_encountered_party_template", "pt_forest_bandits"),
          (set_background_mesh, "mesh_pic_forest_bandits"),
        (else_try),
          (eq, "$g_encountered_party_template", "pt_deserters"),
          (set_background_mesh, "mesh_pic_deserters"),
        (else_try),
          (eq, "$g_encountered_party_template", "pt_kingdom_hero_party"),
		  (party_stack_get_troop_id, ":leader_troop", "$g_encountered_party", 0),
		  (ge, ":leader_troop", 1),
		  (troop_get_slot, ":leader_troop_faction", ":leader_troop", slot_troop_original_faction),
		  (try_begin),
			(eq, ":leader_troop_faction", fac_kingdom_1),
            (set_background_mesh, "mesh_pic_swad"),
		  (else_try),
			(eq, ":leader_troop_faction", fac_kingdom_2),
            (set_background_mesh, "mesh_pic_vaegir"),
		  (else_try),
			(eq, ":leader_troop_faction", fac_kingdom_3),
            (set_background_mesh, "mesh_pic_khergit"),
		  (else_try),
			(eq, ":leader_troop_faction", fac_kingdom_4),
            (set_background_mesh, "mesh_pic_nord"),
		  (else_try),
			(eq, ":leader_troop_faction", fac_kingdom_5),
            (set_background_mesh, "mesh_pic_rhodock"),
		  (else_try),
			(eq, ":leader_troop_faction", fac_kingdom_6),
            (set_background_mesh, "mesh_pic_sarranid_encounter"),
		  (try_end),
        (try_end),
		## CC for Floris
		(str_store_troop_name,s7,"$g_player_troop"),
        (set_player_troop, "$g_player_troop"),
		(str_store_string, s4, "@^^Current Commander: {s7}"),
		## CC for Floris
		## Pre-Battle Orders & Deployment Begin
		(try_begin),
		    (party_slot_eq, "p_main_party", slot_party_prebattle_customized_deployment, 1),
			(str_store_string, s4, "@{s4}^^The troops you selected are ready to join you in battle."),
		(else_try),			
			(str_store_string, s4, "@{s4}^^Your captains will deal with troop assignments."),
		(try_end),
		(try_begin),
            (party_slot_eq, "p_main_party", slot_party_prebattle_plan, 1),
			(str_store_string, s4, "@{s4}^^Your orders have been sent to your captains."),
		(else_try),
		#Wulf / not available for sea battles
        (party_get_current_terrain,":terrain","p_main_party"),
        (neq,":terrain",0),
        #Wulf end      
			(str_store_string, s4, "@{s4}^^There is no tactical plan in place."),
		(try_end),
		## Pre-Battle Orders & Deployment End	
    ],
    [
	## CC
      ("change_commander_simple_encounter",
        [
          (set_player_troop, "$g_player_troop"),
        ],
        "Change commander.",
        [
          (start_presentation, "prsnt_change_commander"),
        ]),
   ## CC	  
	 	 ("access_crew", 			#Seafaring reassign crew before battle	#Floris
		[	(party_get_current_terrain, ":terrain", "p_main_party"),
			(eq, ":terrain", 0),
		],
      "Reassign your crew for battle.",
      [
	#	 (try_for_parties, ":ship_no"),
	#		(try_begin),
	#			(party_slot_eq, ":ship_no", slot_ship_center, 250),
	#			(party_get_num_companions, reg1, ":ship_no"),
	#			(gt, reg1, 1),
	#				(try_begin),
	#					(set_encountered_party, ":ship_no"),
	#					(change_screen_exchange_members, 0),
	#				(try_end),
	#			(assign, "$g_next_menu", "mnu_simple_encounter"),
	#		(else_try),
	#			(display_message, "@All your troops are already assigned to fight in the battle."),
	#		(try_end),
	#	 (try_end),
 
		(party_get_slot, ":ship_no", "p_main_party", slot_town_has_ship),
		(party_get_num_companions, reg1, ":ship_no"),
		(try_begin),
			(gt, reg1, 1),
			(change_screen_exchange_members, 0, ":ship_no"),
			(assign, "$g_next_menu", "mnu_simple_encounter"),
		(else_try),
			(display_message, "@All your troops are already assigned to fight in the battle."),
		(try_end),
     ]),
 
## Prebattle Orders & Deployment v0.751 by Caba'drin Begin
	  ("encounter_attack_deployment",
      [
        (eq, "$encountered_party_friendly", 0),
        (neg|troop_is_wounded, "$g_player_troop"), ## CC
		(party_get_skill_level, ":tactics", "p_main_party", skl_tactics),
		(ge, ":tactics", 2),
 
		(call_script, "script_prebattle_calculate_battle_advantage_and_size"),
		(assign, ":friend_count", reg1),
		(assign, ":enemy_count", reg2),
		(store_add, ":total_combatants", ":friend_count", ":enemy_count"),
		(party_get_slot, ":battle_size", "p_main_party", slot_party_prebattle_battle_size),
		(gt, ":total_combatants", ":battle_size"),
      ],
      "Choose who will join you in battle.",
      [
  		(assign, "$g_next_menu", "mnu_simple_encounter"),
		(start_presentation, "prsnt_prebattle_custom_deployment"),
      ]),
 
	  ("encounter_attack_plan",
      [
        (eq, "$encountered_party_friendly", 0),
        (neg|troop_is_wounded, "$g_player_troop"), ## CC
		(neq, "$g_encounter_type", enctype_fighting_against_village_raid),
		(neq, "$g_encounter_type", enctype_catched_during_village_raid),
		(party_get_skill_level, ":tactics", "p_main_party", skl_tactics),
		(ge, ":tactics", 2),
		#Wulf / not available for sea battles
        (party_get_current_terrain,":terrain","p_main_party"),
        (neq,":terrain",0),
        #Wulf end      
      ],
      "Plan your battle with the enemy.",
      [
  		(assign, "$g_next_menu", "mnu_simple_encounter"),		
		(start_presentation, "prsnt_prebattle_orders"),
      ]),
 
 
	  ("encounter_attack_do_plan",
      [
        (party_slot_eq, "p_main_party", slot_party_prebattle_plan, 1),
      ],
      "Enough planning. To battle!",
      [
	    (party_set_slot, "p_main_party", slot_party_prebattle_plan, 0),
 
        (assign, "$g_battle_result", 0),
        (assign, "$g_engaged_enemy", 1),
 
        (party_get_template_id, ":encountered_party_template", "$g_encountered_party"),		
        (try_begin),
		  (eq, ":encountered_party_template", "pt_village_farmers"),
		  (unlock_achievement, ACHIEVEMENT_HELP_HELP_IM_BEING_REPRESSED),
		(try_end),     
 
        (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),
          (assign, "$g_village_raid_evil", 0),
          (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),
          (assign, "$g_village_raid_evil", 0),
          (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_clear_plan",
      [
         (this_or_next|party_slot_eq, "p_main_party", slot_party_prebattle_customized_deployment, 1),
		 (party_slot_eq, "p_main_party", slot_party_prebattle_plan, 1),
		#Wulf / not available for sea battles
        (party_get_current_terrain,":terrain","p_main_party"),
        (neq,":terrain",0),
        #Wulf end      		 
      ],
      "Re-assess the situation.",
      [
        (try_begin),
		    (party_slot_eq, "p_main_party", slot_party_prebattle_customized_deployment, 1),
		    (party_set_slot, "p_main_party", slot_party_prebattle_customized_deployment, 0),
		(try_end),
	    (try_begin),
		    (party_slot_eq, "p_main_party", slot_party_prebattle_plan, 1),
			(party_set_slot, "p_main_party", slot_party_prebattle_plan, 0),
		    (party_set_slot, "p_main_party", slot_party_prebattle_num_orders, 0),
		(try_end),
 
        (jump_to_menu, "mnu_simple_encounter"),
      ]),
 
 
	  ("encounter_attack_hold",
      [
        (eq, "$encountered_party_friendly", 0),
        (neg|troop_is_wounded, "$g_player_troop"), ## CC
		(neq, "$g_encounter_type", enctype_fighting_against_village_raid),
		(neq, "$g_encounter_type", enctype_catched_during_village_raid),
		(party_get_skill_level, ":tactics", "p_main_party", skl_tactics),
		(ge, ":tactics", 1),
		(party_slot_eq, "p_main_party", slot_party_prebattle_plan, 0),
		#Wulf / not available for sea battles
        (party_get_current_terrain,":terrain","p_main_party"),
        (neq,":terrain",0),
        #Wulf end      
      ],
      "Take the field.",
      [
        (assign, "$g_battle_result", 0),
        (assign, "$g_engaged_enemy", 1),
 
        (party_get_template_id, ":encountered_party_template", "$g_encountered_party"),		
        (try_begin),
		  (eq, ":encountered_party_template", "pt_village_farmers"),
		  (unlock_achievement, ACHIEVEMENT_HELP_HELP_IM_BEING_REPRESSED),
		(try_end),     
 
        (party_set_slot, "p_main_party", slot_party_prebattle_num_orders, 1),
	    (party_get_slot, ":first_order", "p_main_party", slot_party_prebattle_order_array_begin),
		(try_begin),
		    (gt, ":first_order", 0),
			(party_set_slot, "p_main_party_backup", slot_party_prebattle_order_array_begin, ":first_order"),
        (try_end),
		(party_set_slot, "p_main_party", slot_party_prebattle_order_array_begin, 910),		
 
        (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_simple_encounter"),
        (jump_to_menu, "mnu_battle_debrief"),
        (change_screen_mission),
      ]),
 
	  ("encounter_attack_follow",
      [
        (eq, "$encountered_party_friendly", 0),
        (neg|troop_is_wounded, "$g_player_troop"), ## CC
		(neq, "$g_encounter_type", enctype_fighting_against_village_raid),
		(neq, "$g_encounter_type", enctype_catched_during_village_raid),
		(party_get_skill_level, ":tactics", "p_main_party", skl_tactics),
		(ge, ":tactics", 1),
		(party_slot_eq, "p_main_party", slot_party_prebattle_plan, 0),
        #Wulf / not available for sea battles
        (party_get_current_terrain,":terrain","p_main_party"),
        (neq,":terrain",0),
        #Wulf end      
	  ],
      "Lead your troops.",
      [
        (assign, "$g_battle_result", 0),
        (assign, "$g_engaged_enemy", 1),
 
        (party_get_template_id, ":encountered_party_template", "$g_encountered_party"),		
        (try_begin),
		  (eq, ":encountered_party_template", "pt_village_farmers"),
		  (unlock_achievement, ACHIEVEMENT_HELP_HELP_IM_BEING_REPRESSED),
		(try_end),     
 
        (party_set_slot, "p_main_party", slot_party_prebattle_num_orders, 1),
		(party_get_slot, ":first_order", "p_main_party", slot_party_prebattle_order_array_begin),
		(try_begin),
		    (gt, ":first_order", 0),
			(party_set_slot, "p_main_party_backup", slot_party_prebattle_order_array_begin, ":first_order"),
        (try_end),
        (party_set_slot, "p_main_party", slot_party_prebattle_order_array_begin, 911),		
 
        (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_simple_encounter"),
        (jump_to_menu, "mnu_battle_debrief"),
        (change_screen_mission),
      ]),
## Prebattle Orders & Deployment End
 
 
      ("encounter_attack",
      [
        (eq, "$encountered_party_friendly", 0),
        (neg|troop_is_wounded, "$g_player_troop"), ## CC
		(party_slot_eq, "p_main_party", slot_party_prebattle_plan, 0), ## Prebattle Orders & Deployment v0.751 by Caba'drin
        #Wulf
        (party_get_current_terrain,":terrain","p_main_party"),
        (neq,":terrain",0),
        #Wulf end
	  ],
      "Charge the enemy.",
      [
        (assign, "$g_battle_result", 0),
        (assign, "$g_engaged_enemy", 1),
 
        (party_get_template_id, ":encountered_party_template", "$g_encountered_party"),		
        (try_begin),
		  (eq, ":encountered_party_template", "pt_village_farmers"),
		  (unlock_achievement, ACHIEVEMENT_HELP_HELP_IM_BEING_REPRESSED),
		(try_end),          
 
        (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),
          (assign, "$g_village_raid_evil", 0),
          (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),
          (assign, "$g_village_raid_evil", 0),
          (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),
          (neg|troop_is_wounded, "trp_player"),
          #Wulf
          (party_get_current_terrain,":terrain","p_main_party"),
         (eq,":terrain",0), #No sea batlles
          #Wulf end
          ],
           "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),
				(assign, "$g_village_raid_evil", 0),
				(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),
				(assign, "$g_village_raid_evil", 0),
				(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),
			#Wulf
				(set_jump_mission,"mt_ship_battle"),
				(try_begin),
					(val_add,reg10,reg11),
					(gt,reg10,60),
					(jump_to_scene, "scn_sea_4"),
				(else_try),
					(val_add,reg10,reg11),
					(gt,reg10,30),
					(jump_to_scene, "scn_sea_2"),
				(else_try),
					(jump_to_scene, "scn_sea_1"),
				(end_try),
			#Wulf end
           (try_end),
    (assign, "$g_next_menu", "mnu_simple_encounter"),
    (jump_to_menu, "mnu_battle_debrief"),
    (change_screen_mission),
    ]),

As mentioned before - this disables parts of PBOD and CC so that i/we dont need to alter their code. You could also do the same thing as what ruthven did with encounter_attack(see below), but i felt that these options where unnecessary. You can rework it yourself though ;)

Next up is encounter_attack, which remained the way Ruthven originally created it. (This code is right below simple_encounter.)

	("encounter_attack",[
          (eq, "$encountered_party_friendly", 0),
          (neg|troop_is_wounded, "trp_player"),
          #Wulf
          (party_get_current_terrain,":terrain","p_main_party"),
         (eq,":terrain",0), #No sea batlles
          #Wulf end
          ],
           "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),
				(assign, "$g_village_raid_evil", 0),
				(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),
				(assign, "$g_village_raid_evil", 0),
				(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),
			#Wulf
				(set_jump_mission,"mt_ship_battle"),
				(try_begin),
					(val_add,reg10,reg11),
					(gt,reg10,60),
					(jump_to_scene, "scn_sea_4"),
				(else_try),
					(val_add,reg10,reg11),
					(gt,reg10,30),
					(jump_to_scene, "scn_sea_2"),
				(else_try),
					(jump_to_scene, "scn_sea_1"),
				(end_try),
			#Wulf end
           (try_end),
    (assign, "$g_next_menu", "mnu_simple_encounter"),
    (jump_to_menu, "mnu_battle_debrief"),
    (change_screen_mission),
    ]),

This loads the correct battle scenes, while you are sailing the sea.

I then decided to also disable "Leave some men behind and flee.", because it seemed unrealistic to me.

      ("encounter_retreat",[
         (eq,"$cant_leave_encounter", 1),
		 (party_get_current_terrain, ":terrain", "p_main_party"), #Cant leave man behind at sea / Seafaring
		 (neq, ":terrain", 0),
         (call_script, "script_get_max_skill_of_player_party", "skl_tactics"),
         (assign, ":max_skill", reg0),
         (val_add, ":max_skill", 4),
 
         (call_script, "script_party_count_members_with_full_health", "p_collective_enemy", 0),
         (assign, ":enemy_party_strength", reg0),
         (val_div, ":enemy_party_strength", 2),
 
         (val_div, ":enemy_party_strength", ":max_skill"),
         (val_max, ":enemy_party_strength", 1),
 
         (call_script, "script_party_count_fit_regulars", "p_main_party"),
         (assign, ":player_count", reg0),
         (ge, ":player_count", ":enemy_party_strength"),
		(party_slot_eq, "p_main_party", slot_party_prebattle_plan, 0), ## Prebattle Orders & Deployment v0.751 by Caba'drin
         ],"Pull back, leaving some soldiers behind to cover your retreat.",[(jump_to_menu, "mnu_encounter_retreat_confirm"),]),

You still need the correct option to attack so here we go:

     ("join_attack",
	  [(party_get_current_terrain,":terrain","p_main_party"),
         (neq,":terrain",0),
#          (neq, "$encountered_party_hostile", 0),
           (neg|troop_is_wounded, "trp_player"),
##          (store_troop_health,reg(5),"trp_player"),
##          (ge,reg(5),20),
          ],
                            "Charge the enemy.",[
                                (party_set_next_battle_simulation_time, "$g_encountered_party", -1),
                                (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",[(party_get_current_terrain,":terrain","p_main_party"),
         (eq,":terrain",0),
#          (neq, "$encountered_party_hostile", 0),
           (neg|troop_is_wounded, "trp_player"),
##          (store_troop_health,reg(5),"trp_player"),
##          (ge,reg(5),20),
          ],
                            "Board the enemy",[
                                (party_set_next_battle_simulation_time, "$g_encountered_party", -1),
                                (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"),
                                (try_begin),
                                   (val_add,reg10,reg11),
                                   (gt,reg10,60),
                                   (jump_to_scene, "scn_sea_4"),
                                 (else_try),
                                   (val_add,reg10,reg11),
                                   (gt,reg10,30),
                                   (jump_to_scene, "scn_sea_2"),
                                 (else_try),
                                   (jump_to_scene, "scn_sea_1"),
                                   (end_try),
                                (assign, "$g_next_menu", "mnu_join_battle"),
                                (jump_to_menu, "mnu_battle_debrief"),
                                (change_screen_mission),
        ]),


Quote:

__________________________________________
Those codes make you jump to the ship scenes when you're fighting someone on the water. Which leads to the next issue; getting someone to fight. Save and exit module_game_menus and open up module_mission_templates. Go to the bottom of the page and add this code: __________________________________________
While you were technically set to go and fight with Ruthvens original code, caba and me figured out that loot is based on the amount of dead enemies. Which is why we updated the original code with a (native) trigger that counts these dead men.

        #Wulf begin
    (
    "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,[]),
    (3,mtef_attackers|mtef_team_1,af_override_horse,aif_start_alarmed,4,[]),
    (4,mtef_attackers|mtef_team_1,af_override_horse,aif_start_alarmed,4,[]),
    (5,mtef_attackers|mtef_team_1,af_override_horse,aif_start_alarmed,4,[]),
    (6,mtef_attackers|mtef_team_1,af_override_horse,aif_start_alarmed,4,[]),     
    (7,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,[]),
    (8,mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,4,[]),
    (9,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,[]),
    (13,mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,4,[]),
    (14,mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,4,[]),
    (15,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"),
         ]),
 
     (ti_on_agent_killed_or_wounded, 0, 0, [],
       [
        (store_trigger_param_1, ":dead_agent_no"),
        (store_trigger_param_2, ":killer_agent_no"),
        (store_trigger_param_3, ":is_wounded"),
 
        (try_begin),
          (ge, ":dead_agent_no", 0),
          (neg|agent_is_ally, ":dead_agent_no"),
          (agent_is_human, ":dead_agent_no"),
          (agent_get_troop_id, ":dead_agent_troop_id", ":dead_agent_no"),
           (str_store_troop_name, s6, ":dead_agent_troop_id"),
           (assign, reg0, ":dead_agent_no"),
           (assign, reg1, ":killer_agent_no"),
           (assign, reg2, ":is_wounded"),
           (agent_get_team, reg3, ":dead_agent_no"),          
          # #(display_message, "@{!}dead agent no : {reg0} ; killer agent no : {reg1} ; is_wounded : {reg2} ; dead agent team : {reg3} ; {s6} is added"), 
          (party_add_members, "p_total_enemy_casualties", ":dead_agent_troop_id", 1), #addition_to_p_total_enemy_casualties
          (eq, ":is_wounded", 1),
          (party_wound_members, "p_total_enemy_casualties", ":dead_agent_troop_id", 1), 
        (try_end),
 
        #(call_script, "script_apply_death_effect_on_courage_scores", ":dead_agent_no", ":killer_agent_no"),
       ]),
 
      (0, 0, ti_once, [], [(assign,"$g_battle_won",0),
                           (assign,"$defender_reinforcement_stage",0),
                           (assign,"$attacker_reinforcement_stage",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,
      common_battle_tab_press,
 
      (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)]),
#Wulf end
      ]),

As this kit includes Sea Trade we will have to implement these merchants in the script_party_calculate_loot, which is called from the game menu total_victory.

   #script_party_calculate_loot:
    # INPUT:
    # param1: Party-id
    # Returns num looted items in reg(0)
    ("party_calculate_loot",
      [
        (store_script_param_1, ":enemy_party"), #Enemy Party_id
 
        (call_script, "script_calculate_main_party_shares"),
        (assign, ":num_player_party_shares", reg0),
        #(assign, ":num_ally_shares", reg1),
        #(store_add, ":num_shares",  ":num_player_party_shares", ":num_ally_shares"),
 
        #Calculate player loot probability
        #(assign, ":loot_probability", 100),
        #(val_mul, ":loot_probability", 10),
        #(val_div, ":loot_probability", ":num_shares"),
 
        (try_for_range, ":i_loot", 0, num_party_loot_slots),
          (store_add, ":cur_loot_slot", ":i_loot", slot_party_looted_item_1),
          (party_get_slot, ":item_no", "$g_enemy_party", ":cur_loot_slot"),
          (gt, ":item_no", 0),
          (party_set_slot, "$g_enemy_party", ":cur_loot_slot", 0),
          (val_sub, ":cur_loot_slot", slot_party_looted_item_1),
          (val_add, ":cur_loot_slot", slot_party_looted_item_1_modifier),
          (party_get_slot, ":item_modifier", "$g_enemy_party", ":cur_loot_slot"),
          (troop_add_item, "trp_temp_troop", ":item_no", ":item_modifier"),
        (try_end),
        (party_set_slot, "$g_enemy_party", slot_party_next_looted_item_slot, 0),
 
        (assign, ":num_looted_items",0),
        (try_begin),
          (this_or_next|party_slot_eq, "$g_enemy_party", slot_party_type, spt_kingdom_caravan),
		  (this_or_next|party_slot_eq, "$g_enemy_party", slot_party_type, spt_merchant_caravan), #Floris Seafaring / Seatrade
          (this_or_next|party_slot_eq, "$g_enemy_party", slot_party_type, spt_bandit_lair),
          (party_slot_eq, "$g_enemy_party", slot_party_type, spt_village_farmer),
          (store_mul, ":plunder_amount", player_loot_share, 30),
          (val_mul, ":plunder_amount", "$g_strength_contribution_of_player"),
          (val_div, ":plunder_amount", 100),
          (val_div, ":plunder_amount", ":num_player_party_shares"),
          (try_begin),
			(this_or_next|party_slot_eq, "$g_enemy_party", slot_party_type, spt_merchant_caravan),
            (party_slot_eq, "$g_enemy_party", slot_party_type, spt_kingdom_caravan),
            (reset_item_probabilities, 100),
            (assign, ":range_min", trade_goods_begin),
            (assign, ":range_max", trade_goods_end),
          (else_try),
            (party_slot_eq, "$g_enemy_party", slot_party_type, spt_bandit_lair),
            (val_div, ":plunder_amount", 2),
            (reset_item_probabilities, 1),
            (assign, ":range_min", food_begin),
            (assign, ":range_max", food_end),
          (else_try),
            (val_div, ":plunder_amount", 5),
            (reset_item_probabilities, 1),
            (assign, ":range_min", food_begin),
            (assign, ":range_max", food_end),
          (try_end),
          (store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin),
          (try_for_range, ":cur_goods", ":range_min", ":range_max"),
            (try_begin),
              (neg|party_slot_eq, "$g_enemy_party", slot_party_type, spt_bandit_lair),
              (store_add, ":cur_price_slot", ":cur_goods", ":item_to_price_slot"),
              (party_get_slot, ":cur_price", "$g_enemy_party", ":cur_price_slot"),
            (else_try),
              (assign, ":cur_price", maximum_price_factor),
              (val_add, ":cur_price", average_price_factor),
              (val_div, ":cur_price", 3),
            (try_end),

We probably still need to work on this a bit more (see the above trigger for raiders), but the basics are done.

__________________________________________
The next big question we have to answer is: What happens to the player, if he loses a battle and is captured?
This is handled in game_menus:

  (
    "captivity_wilderness_taken_prisoner",mnf_scale_picture, #Seafaring added
    "Your enemies take you prisoner.",
    "none",
    [	(try_begin),
			(party_get_current_terrain, ":terrain", "$capturer_party"),
			(neq, ":terrain", 0),
			(set_background_mesh, "mesh_pic_prisoner_wilderness"),
		(try_end),
     ],
    [
      ("continue",[],"Continue...",
       [
         (try_for_range, ":npc", companions_begin, companions_end),
           (main_party_has_troop, ":npc"),
           (store_random_in_range, ":rand", 0, 100),
           (lt, ":rand", 30),
           (remove_member_from_party, ":npc", "p_main_party"),
           (troop_set_slot, ":npc", slot_troop_occupation, 0),
           (troop_set_slot, ":npc", slot_troop_playerparty_history, pp_history_scattered),
           (assign, "$last_lost_companion", ":npc"),
           (store_faction_of_party, ":victorious_faction", "$g_encountered_party"),
           (troop_set_slot, ":npc", slot_troop_playerparty_history_string, ":victorious_faction"),
           (troop_set_health, ":npc", 100),
           (store_random_in_range, ":rand_town", towns_begin, towns_end),
           (troop_set_slot, ":npc", slot_troop_cur_center, ":rand_town"),
           (assign, ":nearest_town_dist", 1000),
           (try_for_range, ":town_no", towns_begin, towns_end),
             (store_faction_of_party, ":town_fac", ":town_no"),
             (store_relation, ":reln", ":town_fac", "fac_player_faction"),
             (ge, ":reln", 0),
             (store_distance_to_party_from_party, ":dist", ":town_no", "p_main_party"),
             (lt, ":dist", ":nearest_town_dist"),
             (assign, ":nearest_town_dist", ":dist"),
             (troop_set_slot, ":npc", slot_troop_cur_center, ":town_no"),
           (try_end),
         (try_end),
 
		 (try_for_parties, ":party_no"),
			(party_slot_eq, ":party_no", slot_ship_center, ship_player_sailing), #Removes the ship that was used by the player, when he lost a battle at sea.
			(remove_party, ":party_no"),
		 (try_end),
 
         (set_camera_follow_party, "$capturer_party"),
         (assign, "$g_player_is_captive", 1),
         (store_random_in_range, ":random_hours", 18, 30),         
         (call_script, "script_event_player_captured_as_prisoner"),
		 (call_script, "script_stay_captive_for_hours", ":random_hours"),
         (assign,"$auto_menu","mnu_captivity_wilderness_check"),  #Floris Escape Sea
         (change_screen_return),
         ]),
      ]
  ),
 
 
  (
    "captivity_wilderness_check",0,
    "stub",
    "none",
    [	(try_begin),
			(party_get_current_terrain, ":terrain", "$capturer_party"),
			(eq, ":terrain", 0),
			(assign, reg1, 0),
			(try_begin),
				(party_get_position, pos1, "$capturer_party"),
				(map_get_land_position_around_position, pos2, pos1, 5),
				(position_get_x, ":coo_x", pos2),
				(position_get_y, ":coo_y", pos2),
				(try_begin),
					(le, ":coo_x", -134),   #Making sure the player is not freed on the northwestern isle 
					(ge, ":coo_y", 116),
					(assign, reg1, 1),
				(else_try),
					(le, ":coo_x", -100),   #Making sure the player is not freed on the southwestern isle
					(le, ":coo_y", 103),
					(assign, reg1, 1),
				(try_end),
				(eq, reg1, 0),
				(jump_to_menu, "mnu_captivity_end_sea_escape"), #Starts seafaring flee menu
			(else_try),
				(call_script, "script_stay_captive_for_hours", 1),
				(assign,"$auto_menu","mnu_captivity_wilderness_check"),
				(change_screen_return),
			(try_end),
		(else_try),
			(jump_to_menu,"mnu_captivity_end_wilderness_escape"),
		(try_end)],  
    []
  ),
 
   (
    "captivity_end_sea_escape", mnf_scale_picture,
    "After painful days of being dragged about as a prisoner, you find a chance and escape from your captors!", #Flee
    "none",
    [
        (play_cue_track, "track_empty_village"),
    ],
    [
      ("continue",[],"Continue...",
       [
			(assign, "$g_player_is_captive", 0),
			(assign, "$g_player_icon_state", pis_normal),
			(party_set_flags, "p_main_party", pf_is_ship, 0),
			(try_begin),
				(party_is_active, "$capturer_party"),
				(party_set_position, "p_main_party", pos2),
			(try_end),
			(call_script, "script_set_parties_around_player_ignore_player", 2, 4),
			(assign, "$g_player_icon_state", pis_normal),
			(set_camera_follow_party, "p_main_party"),
			(rest_for_hours, 0, 0, 0), #stop resting
           ##diplomacy begin
			(assign, "$g_move_fast", 1),
           ##diplomacy end
			(change_screen_return),
        ]),
    ]
  ),

Its been a while since i wrote this part, so i hope i included all of it:


Credits for this part go to:

__________________________________________

Seafaring

To give you an overview:
scannen0001pb.jpg


Lets start by adding the necessary constants:

slot_town_has_ship = 450
 
slot_ship_center = 451
 
slot_ship_choice = 452
 
slot_ship_time = 453
 
ship_wild_no_guard = 100
ship_wild_guarded = 150
ship_player_sailing = 200

and continue with adding a port menu, its submenus and presentation to the town_menu (see Floris 2.5 source [once its released] for exact location):

#Floris Port Menu
 
(
   "port",0,
    "You visit the port of {s1}.\
 While you look around you feel the strong wind from the ocean pulling on your cloth.\
 Many ships are anchored here and you notice the crews are already loading them with native goods, while a group of men is still discharging their cargos.\
 One of them seems to be in charge of the harbor, so you walk up to them and ask him for help.\
 He looks at you and says: What do you want lad? Dont ya see that i am busy?",
    "none",
    [
	#(set_background_mesh,"mesh_pic_port1_floris"), only use this if you have the according mesh/this is a Floris specific artwork
    (str_store_party_name,s1,"$current_town"),
	(try_begin),
		(eq, "$crew_screen_state", 1),
		(change_screen_exchange_members, 0, "$ship"),
		(assign, "$crew_screen_state", 2),
	(else_try),	
		(eq, "$crew_screen_state", 2),
		(assign, "$crew_screen_state", 0),
		(start_presentation, "prsnt_manage_ships"),
	(else_try),
		(eq, "$crew_screen_state", 3),
		(jump_to_menu, "mnu_ship_notes"),
		(assign, "$crew_screen_state", 2),
	(try_end),
    ],
    [
	#Floris buy a ship
 
	("Buy_a_ship",
	[],
	"Purchase a ship (50000 denars)",
    [
	(try_begin),
		(party_get_slot, ":num_ships", "$current_town", slot_town_has_ship),
		(le, ":num_ships", 4),
		(store_troop_gold,":money","trp_player"),
		(ge,":money",50000),
		(troop_remove_gold,"trp_player",50000),
		(val_add, ":num_ships", 1),		
		(party_set_slot, "$current_town", slot_town_has_ship, ":num_ships"),
		(try_begin),
			(set_spawn_radius, 0),
			(spawn_around_party, "$current_town", "pt_ship"),
			(assign, ":new_ship", reg0),
			(party_set_slot, ":new_ship", slot_party_type, spt_ship),
			(party_set_slot, ":new_ship", slot_ship_center, "$current_town"),
			(assign, reg6, ":new_ship"),
		(try_end),
		(display_message,"@You now own a ship and can disembark from this town."),
	(else_try),
		(party_slot_ge, "$current_town", slot_town_has_ship, 5),
		(display_message, "@There is no room for any further ships in this harbor."),
	(else_try),		
		(display_message,"@You don't have enough money to buy a ship."),
	(try_end),
	]),
 
#Wulf + Floris begin
	("sail_from_port",
	[], "Set sail with your ship.(Min. crew 30, Max 90)",
	[
	(try_begin),
		(party_slot_eq, "$current_town", slot_town_has_ship, 1),
		(assign, ":break", 0),
		(try_for_parties, ":ship_no"),
		    (eq, ":break", 0),
		    (party_slot_eq, ":ship_no", slot_party_type, spt_ship),
			(party_slot_eq, ":ship_no", slot_ship_center, "$current_town"),
			(party_get_num_companions, reg6, ":ship_no"),
			(party_get_num_companions, reg7, "p_main_party"),
			(val_add, reg7, reg6),
			(is_between, reg7, 30, 91),
			(party_set_slot, ":ship_no", slot_ship_center, ship_player_sailing), #Represents the player
			(party_set_slot, "p_main_party", slot_town_has_ship, ":ship_no"), #Records that the Player Party has this ship
			(assign, ":break", 1),
		(try_end),	
        (eq, ":break", 1),			
		(party_set_slot, "$current_town", slot_town_has_ship, 0),
		(assign, "$g_player_icon_state", pis_ship),
		(party_set_flags, "p_main_party", pf_is_ship, 1),
		(party_get_position, pos1, "p_main_party"),
		(party_get_slot, ":dist", "$current_town", slot_town_is_coastal),
		(val_add, ":dist", 2),
		(map_get_water_position_around_position, pos2, pos1, ":dist"),
		(party_set_position, "p_main_party", pos2),
		(assign, "$g_main_ship_party", -1),  #CABA - might also store the ship party ID here??
		(change_screen_return),
	(else_try),
		(party_slot_ge, "$current_town", slot_town_has_ship, 2),
		(jump_to_menu, "mnu_choose_ship"), #CABA--move this to a presentation?
	(else_try),
		(display_message,"@You don't own a ship or your your crew exceeds the boundaries."),
	(try_end),
    ]),
 
	("manage_ships",
	[],
	"Manage ships.",
	[	(assign, reg6, -1),
	    (assign, reg8, -1),
	    (str_clear, s11),
		(str_clear, s12),
		(str_clear, s14),
		(start_presentation, "prsnt_manage_ships"),
	]),
 
	("View_notes",
	[],
	"View the ship registry.",
	[(jump_to_menu, "mnu_ship_notes"),
	]),
 
    ("back_to_town_menu",
	[],
	"Head back.",
    [(jump_to_menu,"mnu_town"),
    ]),
	]),
 
#Floris ship notes
 
(
	"Ship_notes",0,
    "The royal trade guild keeps track of all ships in harbor towns. Viewing their registry will tell you where your ships are.^{s3}",
	"none",
	[	(str_clear, s3),
	    (try_for_range, ":town_no", towns_begin, towns_end),
		    (party_slot_ge, ":town_no", slot_town_is_coastal, 1),
			(party_get_slot, reg1, ":town_no", slot_town_has_ship),
			(str_store_party_name, s2, ":town_no"),
			(str_store_string, s3, "@{s3}^You have {reg1} ships in {s2}."),
		(try_end),
	],
	[
	   ("back_to_town_menu",[],"Head back.",
       [
       (jump_to_menu,"mnu_port"),
       ]),
	]),
 
(
	"choose_ship",0,
    "The following list contains all the ships anchored in this town. Select one to set sail, but make sure your crew meets the requirements.",
 
	"none",
	[	(assign, reg1, 0),
		(assign, reg2, 0),
		(assign, reg3, 0),
		(assign, reg4, 0),
		(assign, reg5, 0),
		(try_for_parties, ":ship_no",),
		    (party_slot_eq, ":ship_no", slot_party_type, spt_ship),
			(party_slot_eq, ":ship_no", slot_ship_center, "$current_town"),
			(try_begin),
				(eq, reg1, 0),
				(assign, reg1, ":ship_no"),
			(else_try),
				(eq, reg2, 0),
				(assign, reg2, ":ship_no"),
			(else_try),
				(eq, reg3, 0),
				(assign, reg3, ":ship_no"),
			(else_try),
				(eq, reg4, 0),
				(assign, reg4, ":ship_no"),
			(else_try),
				(eq, reg5, 0),
				(assign, reg5, ":ship_no"),
			(try_end),
		(try_end),	
	],
	[
		("ship_1",[
		    (neq, reg1, 0),
		    (str_store_party_name, s1, reg1),
			(str_store_string, s1, "@Choose {s1}"),
		],"{s1}",
		[
		(assign, ":ship_no", reg1),
		(try_begin),
			(party_get_num_companions, reg6, "p_main_party"),
			(is_between, reg6, 30, 91),				
			(party_get_num_companions, reg7, ":ship_no"),
			(val_add, reg7, reg6),
			(is_between, reg7, 30, 91),
			(party_get_slot, ":num_ships", "$current_town", slot_town_has_ship),
			(val_sub, ":num_ships", 1),
			(party_set_slot, "$current_town", slot_town_has_ship, ":num_ships"),
			(party_set_slot, ":ship_no", slot_ship_center, ship_player_sailing), #Player uses ship
			(party_set_slot, "p_main_party", slot_town_has_ship, ":ship_no"), #Player tracking
			(assign, "$g_player_icon_state", pis_ship),
			(party_set_flags, "p_main_party", pf_is_ship, 1),
			(party_get_position, pos1, "p_main_party"),
			(map_get_water_position_around_position, pos2, pos1, 6),
			(party_set_position, "p_main_party", pos2),
			(assign, "$g_main_ship_party", -1),
			(change_screen_return),
		(else_try),
			(display_message,"@Your crew is either too small or too large."),
		(try_end),	
		]),
 
		("ship_2",[
		    (neq, reg2, 0),
		    (str_store_party_name, s1, reg2),
			(str_store_string, s1, "@Choose {s1}"),
		],"{s1}",
		[
		(assign, ":ship_no", reg2),
		(try_begin),
			(party_get_num_companions, reg6, "p_main_party"),
			(is_between, reg6, 30, 91),				
			(party_get_num_companions, reg7, ":ship_no"),
			(val_add, reg7, reg6),
			(is_between, reg7, 30, 91),
			(party_get_slot, ":num_ships", "$current_town", slot_town_has_ship),
			(val_sub, ":num_ships", 1),
			(party_set_slot, "$current_town", slot_town_has_ship, ":num_ships"),
			(party_set_slot, ":ship_no", slot_ship_center, ship_player_sailing), #Player uses ship
			(party_set_slot, "p_main_party", slot_town_has_ship, ":ship_no"), #Player tracking
			(assign, "$g_player_icon_state", pis_ship),
			(party_set_flags, "p_main_party", pf_is_ship, 1),
			(party_get_position, pos1, "p_main_party"),
			(map_get_water_position_around_position, pos2, pos1, 6),
			(party_set_position, "p_main_party", pos2),
			(assign, "$g_main_ship_party", -1),
			(change_screen_return),
		(else_try),
			(display_message,"@Your crew is either too small or too large."),
		(try_end),		
		]),
 
		("ship_3",[
		    (neq, reg3, 0),
		    (str_store_party_name, s1, reg3),
			(str_store_string, s1, "@Choose {s1}"),
		],"{s1}",
		[
		(assign, ":ship_no", reg3),
		(try_begin),
			(party_get_num_companions, reg6, "p_main_party"),
			(is_between, reg6, 30, 91),				
			(party_get_num_companions, reg7, ":ship_no"),
			(val_add, reg7, reg6),
			(is_between, reg7, 30, 91),
			(party_get_slot, ":num_ships", "$current_town", slot_town_has_ship),
			(val_sub, ":num_ships", 1),
			(party_set_slot, "$current_town", slot_town_has_ship, ":num_ships"),
			(party_set_slot, ":ship_no", slot_ship_center, ship_player_sailing), #Player uses ship
			(party_set_slot, "p_main_party", slot_town_has_ship, ":ship_no"), #Player tracking
			(assign, "$g_player_icon_state", pis_ship),
			(party_set_flags, "p_main_party", pf_is_ship, 1),
			(party_get_position, pos1, "p_main_party"),
			(map_get_water_position_around_position, pos2, pos1, 6),
			(party_set_position, "p_main_party", pos2),
			(assign, "$g_main_ship_party", -1),
			(change_screen_return),
		(else_try),
			(display_message,"@Your crew is either too small or too large."),
		(try_end),	
		]),
 
		("ship_4",[
		    (neq, reg4, 0),
		    (str_store_party_name, s1, reg4),
			(str_store_string, s1, "@Choose {s1}"),
		],"{s1}",
		[
		(assign, ":ship_no", reg4),
		(try_begin),
			(party_get_num_companions, reg6, "p_main_party"),
			(is_between, reg6, 30, 91),				
			(party_get_num_companions, reg7, ":ship_no"),
			(val_add, reg7, reg6),
			(is_between, reg7, 30, 91),
			(party_get_slot, ":num_ships", "$current_town", slot_town_has_ship),
			(val_sub, ":num_ships", 1),
			(party_set_slot, "$current_town", slot_town_has_ship, ":num_ships"),
			(party_set_slot, ":ship_no", slot_ship_center, ship_player_sailing), #Player uses ship
			(party_set_slot, "p_main_party", slot_town_has_ship, ":ship_no"), #Player tracking
			(assign, "$g_player_icon_state", pis_ship),
			(party_set_flags, "p_main_party", pf_is_ship, 1),
			(party_get_position, pos1, "p_main_party"),
			(map_get_water_position_around_position, pos2, pos1, 6),
			(party_set_position, "p_main_party", pos2),
			(assign, "$g_main_ship_party", -1),
			(change_screen_return),
		(else_try),
			(display_message,"@Your crew is either too small or too large."),
		(try_end),	
		]),
 
		("ship_5",[
		    (neq, reg5, 0),
		    (str_store_party_name, s1, reg5),
			(str_store_string, s1, "@Choose {s1}"),
		],"{s1}",
		[
		(assign, ":ship_no", reg5),
		(try_begin),
			(party_get_num_companions, reg6, "p_main_party"),
			(is_between, reg6, 30, 91),				
			(party_get_num_companions, reg7, ":ship_no"),
			(val_add, reg7, reg6),
			(is_between, reg7, 30, 91),
			(party_get_slot, ":num_ships", "$current_town", slot_town_has_ship),
			(val_sub, ":num_ships", 1),
			(party_set_slot, "$current_town", slot_town_has_ship, ":num_ships"),
			(party_set_slot, ":ship_no", slot_ship_center, ship_player_sailing), #Player uses ship
			(party_set_slot, "p_main_party", slot_town_has_ship, ":ship_no"), #Player tracking
			(assign, "$g_player_icon_state", pis_ship),
			(party_set_flags, "p_main_party", pf_is_ship, 1),
			(party_get_position, pos1, "p_main_party"),
			(map_get_water_position_around_position, pos2, pos1, 6),
			(party_set_position, "p_main_party", pos2),
			(assign, "$g_main_ship_party", -1),
			(change_screen_return),
		(else_try),
			(display_message,"@Your crew is either too small or too large."),
		(try_end),		
		]),	
 
	   ("back_to_town_menu",[],"Head back.",
       [
       (jump_to_menu,"mnu_port"),
       ]),
	]),	
 
 
#Floris End

And the according presenation in presentations.py:

##Floris Sea Trade - Name your ship
 
("manage_ships", 0, mesh_load_window, [ #Ultra Important#
    (ti_on_presentation_load,
      [
        (presentation_set_duration, 999999),
        (set_fixed_point_multiplier, 1000),
 
		(str_clear, s0), #just in case
		(try_for_range, ":i", 0, 100), #be sure the temp slots are empty
		    (troop_set_slot, "trp_temp_array_a", ":i", 0),
			(troop_set_slot, "trp_temp_array_b", ":i", 0),
		(try_end),
 
		(create_text_overlay, reg0, "@Manage Ship", tf_center_justify),
        (position_set_x, pos1, 500),
        (position_set_y, pos1, 680),
        (overlay_set_position, reg0, pos1),
		(position_set_x, pos1, 1500),
        (position_set_y, pos1, 1500),
        (overlay_set_size, reg0, pos1),
 
		(str_store_string, s11, "@{s12}\
Cogs are large sailing ships with their bows and sterns built at a higher level than the rest of the ship in order to form a castle like structure,\
which is used to defend the ship from enemies using archers. The Cog was the first type of boat that used the new idea of a rudder mounted on the stern\
for steering purpose. However as this is still a rather new idea, many cogs are still equipped with steering oars, which were also known as side rudders.\
The early cogs, weren't very large and had open hulls which didnt offer much sailing capability.^^\
Nowadays the cogs are used for sailing through rough waters and their hull is made from clinker construction, which provides them with\
added strength and robustness. Their hulls also grew in size as they evolved into large cargo carriers.^^\
Cog are ships with flat bottoms. They have a ridge or keel that runs along the lower side of the ship. On both sides of the keel, there\
is lapstrake planking, firmly fixed by iron nails. The stern and stern posts are both straight in shape and attached to the keel plate\
by means of hooks. The plank of the keel is thicker than the lapstrake and planking at the sites and moreover, the stern mounted central\
rudder is an integral part of the cog construction. It is this design, that makes cogs more stable than any other type of ship.^^\
Generally built from oak wood, cogs have only a single long mast, which carries a massive square sail. The size of the sail depends \
on the size of the hull. This means that as the size of cog hull became bigger, the size of sails also increased. The only drawback of this construction\
was that it prevented sailing directly into the wind. However it facilitated the yacht so far, that it could be handled by a small crew,\
reducing the overall operational cost."),
 
		(create_text_overlay, reg0, s11, tf_double_space|tf_scrollable),  ##Describes the ship
        (position_set_x, pos1, 400),
        (position_set_y, pos1, 80),
        (overlay_set_position, reg0, pos1),
        (position_set_x, pos1, 550),
        (position_set_y, pos1, 500),
        (overlay_set_area_size, reg0, pos1),
 
 
        (create_text_overlay, reg0, "@Select ship:", tf_center_justify),
        (position_set_x, pos1, 150),
        (position_set_y, pos1, 550),
        (overlay_set_position, reg0, pos1),
 
		(position_set_x, pos1, 160),
		(position_set_y, pos1, 510),
        (create_combo_button_overlay, "$g_presentation_obj_11"),	#Combo Button for ships
        (overlay_set_position, "$g_presentation_obj_11", pos1),
 
		(assign, ":slot", 0),
		(try_for_parties, ":ship_no"),
			(party_slot_eq, ":ship_no", slot_ship_center, "$current_town"),
			(str_store_party_name, s1, ":ship_no"),
			(overlay_add_item, "$g_presentation_obj_11", s1),
			(overlay_set_val, "$g_presentation_obj_11", reg6),
			(troop_set_slot, "trp_temp_array_a", ":slot", ":ship_no"), #this way the troop slot # = overlay combo box index #
			(val_add, ":slot", 1),
		(try_end),
 
	    (create_text_overlay, reg0, "@Name your ship:", tf_center_justify),
        (position_set_x, pos1, 150),
        (position_set_y, pos1, 475),
        (overlay_set_position, reg0, pos1),
 
		(create_simple_text_box_overlay, "$g_presentation_obj_name_kingdom_1"), #Text box
        (position_set_x, pos1, 50),
        (position_set_y, pos1, 440),
        (overlay_set_position, "$g_presentation_obj_name_kingdom_1", pos1),	
 
        (create_button_overlay, "$g_presentation_obj_13", "@Rename Ship."),
        (position_set_x, pos1, 75),
        (position_set_y, pos1, 400),
        (overlay_set_position, "$g_presentation_obj_13", pos1),
 
 
		(create_text_overlay, reg0, "@Send ship to port:", tf_center_justify),
        (position_set_x, pos1, 150),
        (position_set_y, pos1, 250),
        (overlay_set_position, reg0, pos1),
 
		(position_set_x, pos1, 160),
		(position_set_y, pos1, 210),
        (create_combo_button_overlay, "$g_presentation_obj_12"),	#Combo Button for ships
        (overlay_set_position, "$g_presentation_obj_12", pos1),
 
		(assign, ":slot", 0),
		(try_for_range, ":town_no", towns_begin, towns_end),
			(neq, ":town_no", "$current_town"),
			(party_slot_ge, ":town_no", slot_town_is_coastal, 1),
			(store_faction_of_party, ":faction_1", "p_main_party"),
			(store_faction_of_party, ":faction_2", ":town_no"),
			(store_relation, ":relation", ":faction_1", ":faction_2"), #Cant send to enemy ports
			(ge, ":relation", 0),
			(str_store_party_name, s1, ":town_no"),
			(overlay_add_item, "$g_presentation_obj_12", s1),
			(troop_set_slot, "trp_temp_array_b", ":slot", ":town_no"), #this way the troop slot # = overlay combo box index #
			(val_add, ":slot", 1),
		(try_end),   	
 
		(try_begin), 
         (neq, reg6, -1),
         (overlay_set_val, "$g_presentation_obj_11", reg6),
		 (troop_get_slot, ":ship_no", "trp_temp_array_a", reg6),
		 (str_store_party_name, s13, ":ship_no"),
         (overlay_set_text, "$g_presentation_obj_name_kingdom_1", s13),	
        (try_end),	
		(try_begin),
         (neq, reg8, -1),
         (overlay_set_val, "$g_presentation_obj_12", reg8),
        (try_end),	
##TO MAKE THIS WORK, add:
# (assign, reg6, -1),
# (assign, reg8, -1),
##right before the presentation call in the menu		
 
 
		(create_button_overlay, "$g_presentation_obj_14", "@Verify."), ##Duh - renamed
        (position_set_x, pos1, 75),
        (position_set_y, pos1, 175),
        (overlay_set_position, "$g_presentation_obj_14", pos1),
 
		(create_button_overlay, "$g_presentation_obj_2", "@Manage the crew."),
        (position_set_x, pos1, 75),
        (position_set_y, pos1, 365),
        (overlay_set_position, "$g_presentation_obj_2", pos1),
 
		(create_button_overlay, "$g_presentation_obj_15", "@View the ship registry."),
        (position_set_x, pos1, 75),
        (position_set_y, pos1, 330),
        (overlay_set_position, "$g_presentation_obj_15", pos1),		
 
 
		(create_game_button_overlay, "$g_presentation_obj_custom_battle_designer_19", "@Done", 0),
        (position_set_x, pos1, 880),
        (position_set_y, pos1, 25),
        (overlay_set_position, "$g_presentation_obj_custom_battle_designer_19", pos1),
        ]),
 
	(ti_on_presentation_event_state_change,
      [
        (store_trigger_param_1, ":object"),
        (store_trigger_param_2, ":value"),
 
        (try_begin),
			(eq, ":object", "$g_presentation_obj_11"), #Combo Box - Ship Select
			(assign, reg6, ":value"),
			(troop_get_slot, ":ship_no", "trp_temp_array_a", reg6),
			(str_store_party_name, s13, ":ship_no"),
			(party_get_num_companions, reg7, ":ship_no"),
			(str_store_string, s12, "@This is your ship '{s13}'. The crew is currently made up of {reg7} men.^^"),
            (overlay_set_text, "$g_presentation_obj_name_kingdom_1", s13),
			(start_presentation, "prsnt_manage_ships"),
        (else_try),
			(eq, ":object", "$g_presentation_obj_name_kingdom_1"), #Text Box - Ship Name
			(str_store_string, s14, s0),
		(else_try),
		    (eq, ":object", "$g_presentation_obj_13"), # Rename Ship
			(neq, reg6, -1),
			(troop_get_slot, ":ship_no", "trp_temp_array_a", reg6),
			(party_set_name, ":ship_no", s14),
			(str_store_party_name, s13, ":ship_no"),
			(party_get_num_companions, reg7, ":ship_no"),
			(str_store_string, s12, "@This is your ship '{s13}'. The crew is currently made up of {reg7} men.^^"),
			(start_presentation, "prsnt_manage_ships"),
		(else_try),
			(eq, ":object", "$g_presentation_obj_2"), #Manage crew
			(try_begin),
				(party_get_slot, ":num_ships_current", "$current_town", slot_town_has_ship),
				(ge, ":num_ships_current", 1),	
				(troop_get_slot, ":ship_no", "trp_temp_array_a", reg6),
				(party_get_slot, ":loc_no", ":ship_no", slot_ship_center),
				(eq, ":loc_no", "$current_town"),
				(assign, "$ship", ":ship_no"),
				(assign, "$crew_screen_state", 1),
				(presentation_set_duration, 0),
			(else_try),
				(display_message, "@Make sure you selected a ship"),
			(try_end),
		(else_try),
			(eq, ":object", "$g_presentation_obj_15"), #Registry
			(assign, "$crew_screen_state", 3),
			(presentation_set_duration, 0),
		(else_try),
			(eq, ":object", "$g_presentation_obj_12"), #Combo Box - Port to Send
			(assign, reg8, ":value"),
		(else_try),
			(eq, ":object", "$g_presentation_obj_14"), # Send Ship
			(neq, reg6, -1),
			(neq, reg8, -1),
			(troop_get_slot, ":town_no", "trp_temp_array_b", reg8),
			(troop_get_slot, ":ship_no", "trp_temp_array_a", reg6),
			(try_begin),
				(party_get_num_companions, reg7, ":ship_no"),
				#(ge, reg7, 30),
				#(le, reg7, 90),
				(is_between, reg7, 30, 91),
				(party_get_slot, ":num_ships_current", "$current_town", slot_town_has_ship),
				(ge, ":num_ships_current", 1),												#Making sure there is a ship to send
				(party_get_slot, ":num_ships_target", ":town_no", slot_town_has_ship),
				(lt, ":num_ships_target", 5),												#Making sure the target town has space for another ship
				(val_add, ":num_ships_target", 1),	
				(val_sub, ":num_ships_current", 1),
				(party_set_slot, "$current_town", slot_town_has_ship, ":num_ships_current"),
				(party_set_slot, ":town_no", slot_town_has_ship, ":num_ships_target"),
				(party_set_slot, ":ship_no", slot_ship_center, ":town_no"),
				(str_store_party_name, s15, ":ship_no"),
				(str_store_party_name, s16, ":town_no"),
				(start_presentation, "prsnt_manage_ships"),
				(str_clear, s12),
				(display_message, "@Your ship {s15} succesfully set sail for {s16}."),
			(else_try),
				(display_message, "@Make sure a ship is selected, it has a sufficient crew and there is room for another ship in the target town."),
			(try_end),			
		(else_try),
		    (eq, ":object", "$g_presentation_obj_custom_battle_designer_19"),
			(presentation_set_duration, 0),
		(try_end),       
 
		]),
      ]),

That should provide you with the following things ingame:
mb6hp.jpg mb22o.jpg mb19.jpg

But we want to do more - especially on the world map (this is still in game_menus):

 (
    "disembark",0,
    "Do you wish to disembark?^^\
 Do not to land on cliffs, unless you wish to get stuck.",
    "none",
    [],
    [
      ("disembark_yes", 
	  [    #Pos0 is set as the disembark position by the engine
			(position_get_x, ":x", pos0),
			(position_get_y, ":y", pos0),
			(store_sub, ":min_x", ":x", 1), #Radius of 5 map units...not the radius units from before, I don't think
			(store_add, ":max_x", ":x", 2),
			(store_sub, ":min_y", ":y", 1),
			(store_add, ":max_y", ":y", 2),
			(assign, ":no_cliffs", 1),
			(try_for_range, ":x", ":min_x", ":max_x"),
				(try_for_range, ":y", ":min_y", ":max_y"),
					(position_set_x, pos1, ":x"),
					(position_set_y, pos1, ":y"),
					(party_set_position, "p_temp_party", pos1),
					(party_get_position, pos1, "p_temp_party"),
					(position_get_z, ":z", pos1),
					(gt, ":z", 2), #There be cliffs
					(assign, ":no_cliffs", 0),
					(assign, ":max_y", 0),
					(assign, ":max_x", 0),
				(try_end), #Ys
			(try_end), #Xs
			(init_position, pos1),
			(party_set_position, "p_temp_party", pos1), #Reset Temp Party Position
			(eq, ":no_cliffs", 1),	  
	  ], "Land the ship and leave it here for now.",
       [
		(party_get_slot, ":ship_no", "p_main_party", slot_town_has_ship),
	    (store_party_size, ":party_size", ":ship_no"),
 
		(try_begin),
			(ge, ":party_size", 15),
			(assign, "$g_player_icon_state", pis_normal),
			(party_set_flags, "p_main_party", pf_is_ship, 0),
			(party_get_position, pos1, "p_main_party"),
			(party_set_position, "p_main_party", pos0),
			(party_relocate_near_party, ":ship_no", "p_main_party", 0),
			(party_set_slot, ":ship_no", slot_ship_center, ship_wild_guarded),
			(enable_party, ":ship_no"),
			(party_set_icon, ":ship_no", "icon_ship_on_land"),
			(change_screen_return),
		(else_try),
			(lt, ":party_size", 15),
			(assign, "$g_player_icon_state", pis_normal),
			(party_set_flags, "p_main_party", pf_is_ship, 0),
			(party_get_position, pos1, "p_main_party"),
			(party_set_position, "p_main_party", pos0),
			(party_relocate_near_party, ":ship_no", "p_main_party", 0),
			(party_set_slot, ":ship_no", slot_ship_center, ship_wild_no_guard), #Wilderness
			(store_current_hours, ":time"),
			(val_add, ":time", 96),
			(party_set_slot, ":ship_no", slot_ship_time, ":time"),
			(enable_party, ":ship_no"),
			(party_set_icon, ":ship_no", "icon_ship_on_land"),
			(change_screen_return),
			(display_message, "@You should leave 15 men behind to guard your ship, otherwise it might get stolen."),
		(try_end),
		(party_set_slot, "p_main_party", slot_town_has_ship, 0),
        ]),
 
		("disembark_yes_2",
		[
		],
		"Dock at the port.",
 
		[	
			(assign, reg1, 0),
			(try_for_range, ":town_no", towns_begin, towns_end),
				(party_slot_ge, ":town_no", slot_town_is_coastal, 1), 
				(party_get_slot, ":radius", ":town_no", slot_town_is_coastal),
				(store_distance_to_party_from_party, ":dist", ":town_no", "p_main_party"),
				(val_add, ":radius", 2),
				(le, ":dist", ":radius"),
				(assign, "$g_player_icon_state", pis_normal),
				(party_set_flags, "p_main_party", pf_is_ship, 0),
				(party_relocate_near_party, "p_main_party", ":town_no", 0.5),
				(party_get_slot, ":ship_no", "p_main_party", slot_town_has_ship),
				(party_set_slot, ":ship_no", slot_ship_center, ":town_no"),
				(disable_party, ":ship_no"),
				(party_get_slot, ":num_ships", ":town_no", slot_town_has_ship),
				(val_add, ":num_ships", 1),
				(party_set_slot, ":town_no", slot_town_has_ship, ":num_ships"),
				(assign, reg1, 1),
				(change_screen_return),
			(try_end),
			(try_begin),
				(eq, reg1, 0),
				(display_message, "@There is no port in the surrounding area."),
			(try_end),
		]),		
 
 
		("manage_crew", [], "Manage the crew.",
       [# (assign, ":ship_to_use", -1),
		# (try_for_parties, ":ship_no"),
			# (party_slot_eq, ":ship_no", slot_ship_center, 250),
			# (assign, ":ship_to_use", ":ship_no"),
		# (try_end),
		(party_get_slot, ":ship_to_use", "p_main_party", slot_town_has_ship),
		# (gt, ":ship_to_use", -1),
		#(assign, reg6, ":ship_to_use"),
		#(display_message,"@You now own a ship and can disembark from this town."),
		(set_encountered_party, ":ship_to_use"),
		#(change_screen_exchange_with_party, ":ship_to_use"),
		#(change_screen_give_members, ":ship_to_use"), 
		(change_screen_exchange_members,0),	
        #(party_clear, "p_temp_party"),
        #(call_script, "script_party_copy", "p_temp_party", ":ship_to_use"),		
		#(change_screen_exchange_with_party, "p_temp_party"),
		#(assign, "$g_next_menu", "mnu_disembark"),
		#(jump_to_menu, "mnu_manage_crew_done"),
		#(call_script, "script_party_add_party", ":ship_to_use", "p_temp_party"),
	   ]),
 
	#### Old Code for disembarking
       #   (le, "$g_main_ship_party", 0),
       #   (set_spawn_radius, 0),
       #   (spawn_around_party, "p_main_party", "pt_none"),
       #   (assign, "$g_main_ship_party", reg0),          
       #   (party_set_flags, "$g_main_ship_party", pf_is_static|pf_always_visible|pf_hide_defenders|pf_is_ship, 1),
       #   (str_store_troop_name, s1, "trp_player"),
       #   (party_set_name, "$g_main_ship_party", "@{s1}'s Ship"),
       #   (party_set_icon, "$g_main_ship_party", "icon_ship"),
       #   (party_set_slot, "$g_main_ship_party", slot_party_type, spt_ship),
       # (try_end),
       # (enable_party, "$g_main_ship_party"),
       # (party_set_position, "$g_main_ship_party", pos0),
       # (party_set_icon, "$g_main_ship_party", "icon_ship_on_land"),
       # (assign, "$g_main_ship_party", -1),		
 
		("disembark_yes_3",
		[	
			    #Pos0 is set as the disembark position by the engine
			(position_get_x, ":x", pos0),
			(position_get_y, ":y", pos0),
			(store_sub, ":min_x", ":x", 1), #Radius of 5 map units...not the radius units from before, I don't think
			(store_add, ":max_x", ":x", 2),
			(store_sub, ":min_y", ":y", 1),
			(store_add, ":max_y", ":y", 2),
			(assign, ":no_cliffs", 1),
			(try_for_range, ":x", ":min_x", ":max_x"),
				(try_for_range, ":y", ":min_y", ":max_y"),
					(position_set_x, pos1, ":x"),
					(position_set_y, pos1, ":y"),
					(party_set_position, "p_temp_party", pos1),
					(party_get_position, pos1, "p_temp_party"),
					(position_get_z, ":z", pos1),
					(gt, ":z", 2), #There be cliffs
					(assign, ":no_cliffs", 0),
					(assign, ":max_y", 0),
					(assign, ":max_x", 0),
				(try_end), #Ys
			(try_end), #Xs
			(init_position, pos1),
			(party_set_position, "p_temp_party", pos1), #Reset Temp Party Position
			(eq, ":no_cliffs", 1),
 
			#(party_get_position, pos1, "p_main_party"),
			#(map_get_land_position_around_position, pos2, pos1, 1),
			#(party_set_position, "p_main_party", pos2),
			#(party_get_current_terrain, ":terrain", "p_main_party"),
			#(neq, ":terrain", 1),
			#(assign, reg20, ":terrain"),
			#(display_message, "@Terrain is {reg20}"),
			#(party_set_position, "p_main_party", pos1),
		],
		"Yes, but send the ship to a port.",
 
		[	
		    # (try_for_parties, ":ship_no"),
				# (party_slot_eq, ":ship_no", slot_ship_center, 250),
				# (store_party_size, ":party_size", ":ship_no"),
			# (try_end),
			(try_begin),
			    (party_get_slot, ":ship_no", "p_main_party", slot_town_has_ship),
				(store_party_size, ":party_size", ":ship_no"),
				(ge, ":party_size", 30),		
				(jump_to_menu, "mnu_send_ship_to_town"),
			(else_try),
				(display_message, "@You need at least a 30 men crew to send the ship to a town"),
			(try_end),
		]),
 
 
	("disembark_no", [], "No.",
       [	(party_get_position, pos1, "p_main_party"),	
			(map_get_water_position_around_position, pos2, pos1, 1),
			(party_set_position, "p_main_party", pos2),
			(rest_for_hours_interactive, 1, 1),
			(change_screen_return),
        ]),
    ]
  ),
 
  # ("manage_crew_done",0,
  #  "{!}",
  #  "none",
  #  [],
  #  [("continue", [], "Continue.", [
  #      (assign, ":ship_to_use", -1),
	#	(try_for_parties, ":ship_no"),
	#		(party_slot_eq, ":ship_no", slot_ship_center, 250),
	#		(assign, ":ship_to_use", ":ship_no"),
	#	(try_end),
	#	(gt, ":ship_to_use", -1),	
	#	(party_clear, ":ship_to_use"),
    #    (call_script, "script_party_copy", ":ship_to_use", "p_temp_party"),	
	#	(jump_to_menu, "$g_next_menu")]),
	#]),
 
    #Floris Send ship to town
 
 (
	"Send_ship_to_town",0,
    "Send the ship to",
    "none",
	[	
	],
	[
		("p_town_1",
		[
			(store_faction_of_party, ":faction_1", "p_main_party"),
			(store_faction_of_party, ":faction_2", "p_town_1"),
			(store_relation, ":relation", ":faction_1", ":faction_2"),
			(ge, ":relation", 0),
			(str_store_party_name, s1, "p_town_1"),
		],
		"{s1}",
		[
		(party_get_slot, ":num_ships", "p_town_1", slot_town_has_ship),
		(val_add, ":num_ships", 1),
		(party_set_slot, "p_town_1", slot_town_has_ship, ":num_ships"),
		(assign, "$g_player_icon_state", pis_normal),
        (party_set_flags, "p_main_party", pf_is_ship, 0),
        (party_get_position, pos1, "p_main_party"),
        (party_set_position, "p_main_party", pos0),
		(party_get_slot, ":ship_no", "p_main_party", slot_town_has_ship),
		(party_set_slot, ":ship_no", slot_ship_center, "p_town_1"),
		(party_set_slot, "p_main_party", slot_town_has_ship, 0),
		(disable_party, ":ship_no"),
		# (try_for_parties, ":ship_no"),
			# (party_slot_eq, ":ship_no", slot_ship_center, 250),
			# (party_set_slot, ":ship_no", slot_ship_center, "p_town_1"),
			# (disable_party, ":ship_no"),
		# (try_end),
        (change_screen_return),
		]),
 
		("p_town_2",
		[
			(store_faction_of_party, ":faction_1", "p_main_party"),
			(store_faction_of_party, ":faction_2", "p_town_2"),
			(store_relation, ":relation", ":faction_1", ":faction_2"),
			(ge, ":relation", 0),
			(str_store_party_name, s1, "p_town_2"),
		],
		"{s1}",
		[
		(party_get_slot, ":num_ships", "p_town_2", slot_town_has_ship),
		(val_add, ":num_ships", 1),
		(party_set_slot, "p_town_2", slot_town_has_ship, ":num_ships"),
		(assign, "$g_player_icon_state", pis_normal),
        (party_set_flags, "p_main_party", pf_is_ship, 0),
        (party_get_position, pos1, "p_main_party"),
        (party_set_position, "p_main_party", pos0),
		(party_get_slot, ":ship_no", "p_main_party", slot_town_has_ship),
		(party_set_slot, ":ship_no", slot_ship_center, "p_town_2"),
		(party_set_slot, "p_main_party", slot_town_has_ship, 0),
		(disable_party, ":ship_no"),
		# (try_for_parties, ":ship_no"),
			# (party_slot_eq, ":ship_no", slot_ship_center, 250),
			# (party_set_slot, ":ship_no", slot_ship_center, "p_town_2"),
			# (disable_party, ":ship_no"),
		# (try_end),
        (change_screen_return),
		]),
 
		("p_town_6",
		[
			(store_faction_of_party, ":faction_1", "p_main_party"),
			(store_faction_of_party, ":faction_2", "p_town_6"),
			(store_relation, ":relation", ":faction_1", ":faction_2"),
			(ge, ":relation", 0),
			(str_store_party_name, s1, "p_town_6"),
		],
		"{s1}",
		[
		(party_get_slot, ":num_ships", "p_town_6", slot_town_has_ship),
		(val_add, ":num_ships", 1),
		(party_set_slot, "p_town_6", slot_town_has_ship, ":num_ships"),
		(assign, "$g_player_icon_state", pis_normal),
        (party_set_flags, "p_main_party", pf_is_ship, 0),
        (party_get_position, pos1, "p_main_party"),
        (party_set_position, "p_main_party", pos0),
		(party_get_slot, ":ship_no", "p_main_party", slot_town_has_ship),
		(party_set_slot, ":ship_no", slot_ship_center, "p_town_6"),
		(party_set_slot, "p_main_party", slot_town_has_ship, 0),
		(disable_party, ":ship_no"),
		# (try_for_parties, ":ship_no"),
			# (party_slot_eq, ":ship_no", slot_ship_center, 250),
			# (party_set_slot, ":ship_no", slot_ship_center, "p_town_6"),
			# (disable_party, ":ship_no"),
		# (try_end),
		(change_screen_return),
		]),		
 
		("p_town_12",
		[
			(store_faction_of_party, ":faction_1", "p_main_party"),
			(store_faction_of_party, ":faction_2", "p_town_12"),
			(store_relation, ":relation", ":faction_1", ":faction_2"),
			(ge, ":relation", 0),
			(str_store_party_name, s1, "p_town_12"),
		],
		"{s1}",
		[
		(party_get_slot, ":num_ships", "p_town_12", slot_town_has_ship),
		(val_add, ":num_ships", 1),
		(party_set_slot, "p_town_12", slot_town_has_ship, ":num_ships"),
		(assign, "$g_player_icon_state", pis_normal),
        (party_set_flags, "p_main_party", pf_is_ship, 0),
        (party_get_position, pos1, "p_main_party"),
        (party_set_position, "p_main_party", pos0),
		(party_get_slot, ":ship_no", "p_main_party", slot_town_has_ship),
		(party_set_slot, ":ship_no", slot_ship_center, "p_town_12"),
		(party_set_slot, "p_main_party", slot_town_has_ship, 0),
		(disable_party, ":ship_no"),
		# (try_for_parties, ":ship_no"),
			# (party_slot_eq, ":ship_no", slot_ship_center, 250),
			# (party_set_slot, ":ship_no", slot_ship_center, "p_town_12"),
			# (disable_party, ":ship_no"),
		# (try_end),
		(change_screen_return),
		]),				
 
		("p_town_13",
		[
			(store_faction_of_party, ":faction_1", "p_main_party"),
			(store_faction_of_party, ":faction_2", "p_town_13"),
			(store_relation, ":relation", ":faction_1", ":faction_2"),
			(ge, ":relation", 0),
			(str_store_party_name, s1, "p_town_13"),
		],
		"{s1}",
		[
		(party_get_slot, ":num_ships", "p_town_13", slot_town_has_ship),
		(val_add, ":num_ships", 1),
		(party_set_slot, "p_town_13", slot_town_has_ship, ":num_ships"),
		(assign, "$g_player_icon_state", pis_normal),
        (party_set_flags, "p_main_party", pf_is_ship, 0),
        (party_get_position, pos1, "p_main_party"),
        (party_set_position, "p_main_party", pos0),
		(party_get_slot, ":ship_no", "p_main_party", slot_town_has_ship),
		(party_set_slot, ":ship_no", slot_ship_center, "p_town_13"),
		(party_set_slot, "p_main_party", slot_town_has_ship, 0),
		(disable_party, ":ship_no"),
		# (try_for_parties, ":ship_no"),
			# (party_slot_eq, ":ship_no", slot_ship_center, 250),
			# (party_set_slot, ":ship_no", slot_ship_center, "p_town_13"),
			# (disable_party, ":ship_no"),
		# (try_end),
		(change_screen_return),
		]),		
 
		("p_town_15",
		[
			(store_faction_of_party, ":faction_1", "p_main_party"),
			(store_faction_of_party, ":faction_2", "p_town_15"),
			(store_relation, ":relation", ":faction_1", ":faction_2"),
			(ge, ":relation", 0),
			(str_store_party_name, s1, "p_town_15"),
		],
		"{s1}",
		[
		(party_get_slot, ":num_ships", "p_town_15", slot_town_has_ship),
		(val_add, ":num_ships", 1),
		(party_set_slot, "p_town_15", slot_town_has_ship, ":num_ships"),
		(assign, "$g_player_icon_state", pis_normal),
        (party_set_flags, "p_main_party", pf_is_ship, 0),
        (party_get_position, pos1, "p_main_party"),
        (party_set_position, "p_main_party", pos0),
		(party_get_slot, ":ship_no", "p_main_party", slot_town_has_ship),
		(party_set_slot, ":ship_no", slot_ship_center, "p_town_15"),
		(party_set_slot, "p_main_party", slot_town_has_ship, 0),
		(disable_party, ":ship_no"),
		# (try_for_parties, ":ship_no"),
			# (party_slot_eq, ":ship_no", slot_ship_center, 250),
			# (party_set_slot, ":ship_no", slot_ship_center, "p_town_15"),
			# (disable_party, ":ship_no"),
		# (try_end),
		(change_screen_return),
		]),		
 
		("p_town_19",
		[
			(store_faction_of_party, ":faction_1", "p_main_party"),
			(store_faction_of_party, ":faction_2", "p_town_19"),
			(store_relation, ":relation", ":faction_1", ":faction_2"),
			(ge, ":relation", 0),
			(str_store_party_name, s1, "p_town_19"),
		],
		"{s1}",
		[
		(party_get_slot, ":num_ships", "p_town_19", slot_town_has_ship),
		(val_add, ":num_ships", 1),
		(party_set_slot, "p_town_19", slot_town_has_ship, ":num_ships"),
		(assign, "$g_player_icon_state", pis_normal),
        (party_set_flags, "p_main_party", pf_is_ship, 0),
        (party_get_position, pos1, "p_main_party"),
        (party_set_position, "p_main_party", pos0),
		(party_get_slot, ":ship_no", "p_main_party", slot_town_has_ship),
		(party_set_slot, ":ship_no", slot_ship_center, "p_town_19"),
		(party_set_slot, "p_main_party", slot_town_has_ship, 0),
		(disable_party, ":ship_no"),
		# (try_for_parties, ":ship_no"),
			# (party_slot_eq, ":ship_no", slot_ship_center, 250),
			# (party_set_slot, ":ship_no", slot_ship_center, "p_town_19"),
			# (disable_party, ":ship_no"),
		# (try_end),
		(change_screen_return),
		]),
 
		("abort",
		[],
		"Return to the ship",
		[(change_screen_return),
        ]),
	]),
 
 
  (
    "ship_reembark",0,
    "Do you wish to embark?",
    "none",
    [],
    [
      ("reembark_yes", [], "Yes.(Min crew 30, Max 90)",
       [(try_begin),
			(party_get_num_companions, reg6, "$g_encountered_party"),
			(party_get_num_companions, reg7, "p_main_party"),
			(val_add, reg7, reg6),
			(is_between, reg7, 30, 91),
			(assign, "$g_player_icon_state", pis_ship),
			(party_set_flags, "p_main_party", pf_is_ship, 1),
			(party_get_position, pos1, "p_main_party"),
			(map_get_water_position_around_position, pos2, pos1, 7),
			(party_set_position, "p_main_party", pos2),
			(party_set_slot, "$g_encountered_party", slot_ship_center, ship_player_sailing), #Player uses ship
			(party_set_slot, "p_main_party", slot_town_has_ship, "$g_encountered_party"),
			(disable_party, "$g_encountered_party"),			
			(change_screen_return),
		(else_try),
			(display_message,"@Your crew exceeds the boundaries."),
		(try_end),		
        ]),
 
		("manage_crew", [], "Manage the crew.",
       [	(change_screen_exchange_members,0),	
	   ]),
 
 
      ("reembark_no", [], "No.",
       [(change_screen_return),
        ]),
    ]
  ),
#Floris End

This requires an addition to simple_triggers.py:

	(24, #Floris Seafaring Wilderness Check
	[
		(try_for_parties, ":party_no"),
		    (party_slot_eq, ":party_no", slot_party_type, spt_ship),
			(party_slot_eq, ":party_no", slot_ship_center, ship_wild_no_guard),
			(party_get_slot, ":timer", ":party_no", slot_ship_time),
			(store_current_hours, ":cur_time"),
			(ge, ":cur_time", ":timer"),
			(store_random_in_range, ":luck", 0, 10),
			(ge, ":luck", 5),
			(str_store_party_name, s1, ":party_no"),
			(display_message, "@You have a bad feeling about your ship {s1}."),
			(remove_party, ":party_no"),			
		(try_end),
		]),

It removes your ship (i.e. steals), if you did not assign the necessary amount of troops to guard it.

Another Screenshot:

mb21q.jpg
The options to "land" and "send the ship to a town" will not show up if the player tries to do it at a steep cliff (based on the height difference of the positions), because otherwise the player might get stuck there and break his game. Its still possible to do, but this was the closest we could get to fixing this.

Troops need to be paid wages so we better include all the crews the player assigns to his ships (beware this fuses into the diplomacy presentation):

      ##diplomacy begin
      (try_begin),
        (this_or_next|gt, "$g_player_minister", 0),
        (this_or_next|troop_slot_ge, "trp_player", slot_troop_spouse, 0),
        (this_or_next|gt, "$g_player_chamberlain", 0),
        (gt, "$g_player_constable", 0),
        (val_add, ":num_lines", 1), # staff salary
      (try_end),
 
      (try_begin),
        (gt, "$g_player_chamberlain", 0),
        (val_add, ":num_lines", 2), #earlier cash, new cash
      (try_end),
      ##diplomacy end   
	  #FLORIS BEGIN
      (try_begin),
        (faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active),
        (faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
        (val_add, ":num_lines", 1),
      (try_end),
		(try_for_parties, ":party_no"),
			(party_slot_ge,":party_no", slot_ship_center, 1), #Ships are identified by 4 states, towns/player/wilderness/wilderness w/o guard
			(assign, reg20, 2),
		(try_end),
		(try_begin),
			(eq, reg20,2),
			(val_add, ":num_lines", 1),
		(try_end),
      #FLORIS END  
      (val_add, ":num_lines", 3),
      (store_mul, ":cur_y", 27, ":num_lines"),
      (assign, ":net_change", 0), #this is the amount added
      (try_for_range, ":center_no", centers_begin, centers_end),		
		#Enterprise

          (str_store_string, s0, "str_s0s_party"),
        (try_end),				
        (create_text_overlay, reg1, "str_wages_for_s0", 0),
        (position_set_x, pos1, 900),
        (position_set_y, pos1, 900),
        (overlay_set_size, reg1, pos1),
        (position_set_x, pos1, 25),
        (position_set_y, pos1, ":cur_y"),
        (overlay_set_position, reg1, pos1),
        (try_begin),
          (lt, ":total_wage", 0),
          (assign, reg0, ":total_wage"),
          (create_text_overlay, reg1, "@{!}{reg0}", tf_right_align|tf_single_line),
          (overlay_set_color, reg1, 0xFF0000),
        (else_try),
          (create_text_overlay, reg1, "@None", tf_right_align|tf_single_line),
        (try_end),
        (position_set_x, pos1, 900),
        (position_set_y, pos1, 900),
        (overlay_set_size, reg1, pos1),
        (position_set_x, pos1, 500),
        (position_set_y, pos1, ":cur_y"),
        (overlay_set_position, reg1, pos1),
        (val_sub, ":cur_y", 27),
      (try_end),
 
	  #Floris Addendum / Crew Wages / Seafaring
		(assign, ":crew_wage", 0),	
		(assign, reg20, 0),
		(try_for_parties, ":party_no"),
			(party_slot_ge,":party_no", slot_ship_center, 1), #Ships are identified by 4 states, towns/player/wilderness/wilderness w/o guard
			(party_get_num_companion_stacks, ":num_stacks", ":party_no"), #Calculating Wages
			(try_for_range, ":i_stack", 0, ":num_stacks"),
				(party_stack_get_troop_id, ":stack_troop", ":party_no", ":i_stack"),
				(party_stack_get_size, ":stack_size", ":party_no", ":i_stack"),
				(call_script, "script_game_get_troop_wage", ":stack_troop", ":party_no"),
				(assign, ":cur_wage", reg0),
				(val_mul, ":cur_wage", ":stack_size"),
				(val_mul, ":cur_wage", -1),
				(val_add, ":crew_wage", ":cur_wage"),
			(try_end),
			(assign, reg20, 1),
		(try_end),
		(try_begin),
			(eq, reg20, 1),
			(assign, reg0, ":crew_wage"),
			(val_add, ":net_change", ":crew_wage"),			
			(create_text_overlay, reg1, "@Wages for your Shipcrew/s:", 0),
			(position_set_x, pos1, 900),
			(position_set_y, pos1, 900),
			(overlay_set_size, reg1, pos1),
			(position_set_x, pos1, 25),
			(position_set_y, pos1, ":cur_y"),
			(overlay_set_position, reg1, pos1),
 
			(create_text_overlay, reg1, "@{!}{reg0}", tf_right_align|tf_single_line), #Display Wages
			(overlay_set_color, reg1, 0xFF0000),
			(position_set_x, pos1, 900),
			(position_set_y, pos1, 900),
			(overlay_set_size, reg1, pos1),
			(position_set_x, pos1, 500),
			(position_set_y, pos1, ":cur_y"),
			(overlay_set_position, reg1, pos1),
			(val_sub, ":cur_y", 27),
		(try_end),
 
	#Floris End
 
 
 
      (try_begin),
        (gt, "$g_player_debt_to_party_members", 0),
        (val_sub, ":net_change", "$g_player_debt_to_party_members"),
        (create_text_overlay, reg1, "str_earlier_debts", 0),


To finish off - a few minor menu fixes and additions (be aware this is based on FEMP, you might not have the same code, but you will need to alter "Resume Travelling" and "Wait here for some time"):

     ("camp_wait_here",[],"Wait here for some time.",
       [
           (assign,"$g_camp_mode", 1),
           (assign, "$g_infinite_camping", 0),
           (assign, "$g_player_icon_state", pis_camping),
#		   (party_set_slot,"p_main_party",slot_party_entrenched,0), #TEMPERED ADDED LINE FOR NO ENTRENCHMENT
#		   (assign,"$current_camp_party",-1), #TEMPERED ADDED LINE FOR NO ENTRENCHMENT
 
           (try_begin),
             (party_is_active, "p_main_party"),
             (party_get_current_terrain, ":cur_terrain", "p_main_party"),
             (try_begin),
               (eq, ":cur_terrain", rt_desert),
               (unlock_achievement, ACHIEVEMENT_SARRANIDIAN_NIGHTS),		#Floris Seafaring Addendum
			 (else_try),
				(eq, ":cur_terrain", 0), #Sea
				(assign, "$g_player_icon_state", pis_ship),
				(party_set_flags, "p_main_party", pf_is_ship, 1),
             (try_end),  
           (try_end),  
           (rest_for_hours_interactive, 24 * 365, 5, 1), #rest while attackable                     
            (change_screen_map),
        ]
       ),
 
	   ("camp_fishing", #Floris Fishing
	   [	(party_get_current_terrain, ":terrain", "p_main_party"),
			(eq, ":terrain", 0),
	   ],
	   "Try to catch some fish.",
	   [
			(store_current_hours, ":time"),
			(val_add, ":time", 24),
			(party_set_slot, "p_main_party", slot_ship_time, ":time"),
			(assign,"$g_camp_mode", 1),
			(assign, "$g_infinite_camping", 0),
			(rest_for_hours_interactive, 24 * 365, 5, 1),
			(assign, "$g_player_icon_state", pis_ship),
			(change_screen_map),
		]),	
 
 
#Tempered inspect camp
      ("camp_inspect",
	  [	(party_get_current_terrain, ":terrain", "p_main_party"),
		(neq, ":terrain", 0),
	  ],"Inspect your camp.",
       [
			(call_script,"script_visit_camp"),
        ]
       ),	   
#TEMPERED  CHANGES BEGIN  ADDED ENTRENCHMENT MENU OPTION                                	   
      ("camp_entrench",[ 	(party_get_current_terrain, ":terrain", "p_main_party"),
							(neq, ":terrain", 0),
							(party_slot_eq,"p_main_party",slot_party_entrenched,0),
							(assign,":continue",0),
							(try_for_parties,":camp_site"),
								(eq,":continue",0),
								(party_slot_eq,":camp_site",slot_party_type,spt_entrenchment),
								(store_distance_to_party_from_party, ":distance", ":camp_site", "p_main_party"),
								(try_begin),
									(le,":distance",1),
									(str_store_string,s1,"@Return to your fortifications."),
									(assign,":continue",1),
									(assign,"$current_camp_party",":camp_site"),
								(try_end),
							(try_end),		
							(try_begin),
								(eq,":continue",0),
								(call_script,"script_party_entrench_time"),
								(str_store_string,s1,"@Spend {reg5} hours entrenching your camp site."),
								(assign,"$current_camp_party",-1),
							(try_end),													
						],"{s1}",
       [	
			(assign,":continue",0),
			(store_current_hours,":cur_hour"),
			(try_begin),
				(player_has_item,"itm_tools"),
				(assign,":continue",1),
			(try_end),
			(try_begin),
				(eq,":continue",1),
				(try_begin),
					(lt,"$current_camp_party",0),
					(call_script,"script_party_entrench_time"),
					(store_add,"$entrench_time",":cur_hour",reg5),
					(call_script,"script_change_player_party_morale",-10),					
					(party_set_slot,"p_main_party",slot_party_entrenched,-1),
					(assign,"$g_camp_mode", 1),
					(assign, "$g_infinite_camping", 0),
					(assign, "$g_player_icon_state", pis_camping),												
					(rest_for_hours_interactive, 24 * 7, 5, 1), #rest while attackable
					(change_screen_return),					
				(else_try),
					(gt,"$current_camp_party",0),
					(party_set_slot,"p_main_party",slot_party_entrenched,1),
					(display_message,"@_You have returned to a fortified position."),
					(party_set_slot,"$current_camp_party",slot_village_state,1),
					(party_clear_particle_systems, "$current_camp_party"),
					(assign,"$entrench_time",0),
					(assign,"$g_camp_mode", 1),
					(assign, "$g_infinite_camping", 0),
					(assign, "$g_player_icon_state", pis_camping),												
					(jump_to_menu,"mnu_camp"),					
				(try_end),
			(else_try),
				(eq,":continue",0),
				(display_message,"@_You must have tools in inventory to entrench your camp site."),
				(jump_to_menu,"mnu_camp"),
			(try_end),
        ]
       ),
 
#	   ("game_options",[],"Adjust mod settings.",
#       [
#			(jump_to_menu,"mnu_options"),
#        ]
#       ),
#TEMPERED  CHANGES END
 
      ("camp_cheat",
       [(ge, "$cheat_mode", 1)
        ], "CHEAT MENU!",
       [(jump_to_menu, "mnu_camp_cheat"),
        ],
       ),
      ("resume_travelling",[],"Resume travelling.",
       [
			(party_get_current_terrain, ":terrain", "p_main_party"), #Floris Addendum / Seafaring
			(try_begin),
				(neq, ":terrain", 0),
				(assign, "$g_player_icon_state", pis_normal),
				(assign,"$g_camp_mode", 0),
			(else_try),
				(assign, "$g_player_icon_state", pis_ship),
				(assign,"$g_camp_mode", 0),
			(try_end),
			(change_screen_map),
        ]
       ),
      ]
  ),

For the fishing option (which is based on the foraging skill) we need to go back into simple_triggers and add:

	(1, #Floris fishing
	[	
		(try_begin),
			(party_get_current_terrain, ":terrain", "p_main_party"),
			(eq, ":terrain", 0),
			(neq, "$g_player_icon_state", pis_ship),
			(assign, "$g_player_icon_state", pis_ship),
		(try_end),
 
		(try_begin),
			(party_get_slot, ":timer", "p_main_party", slot_ship_time),
			(store_current_hours, ":cur_time"),			
			(eq, ":cur_time", ":timer"),
			(try_begin),
				(party_get_current_terrain, ":terrain", "p_main_party"),
				(eq, ":terrain", 0),
				(store_skill_level, ":skill", skl_foraging,"trp_player"),
				(val_mul, ":skill", 10),
				(store_random_in_range, ":luck", 0, 100),
				(ge, ":skill", ":luck"),
				(store_free_inventory_capacity, ":i_space", "trp_player"),
				(try_begin),
					(ge, ":i_space", 1),
					(display_message, "@You caught some fish."),
					(troop_add_item, "trp_player", "itm_smoked_fish"),
					#(troop_add_merchandise, "trp_player", "itm_smoked_fish", 1),
				(else_try),
					(display_message, "@Due to insufficient space, you had to throw the fish back into the ocean"),
				(try_end),				
				(assign,"$g_camp_mode", 0),
				(rest_for_hours_interactive, 0, 5, 1),
				(party_set_slot, "p_main_party", slot_ship_time, 0),
			(else_try),
				(display_message, "@All you caught were some seaweeds."),
				(assign,"$g_camp_mode", 0),
				(rest_for_hours_interactive, 0, 5, 1),
				(party_set_slot, "p_main_party", slot_ship_time, 0),
			(try_end),
		(try_end),
	]),

...and we are done. Good job reading through all this ;)


Plans for the future:



Credits for Seafaring:

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox