Problem with adding a new ship

Users who are viewing this thread

pan-boroda

Knight at Arms
Good afternoon. Tell me if anyone knows.
I decided to add a new ship based Floris mod. Conditionally zebec.
Made changes to the party_templates, party, constantes.
Change by analogy ship Information in games_menus
was as follows:
("Buy_a_ship",
[],
"Purchase a cog (10000 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",10000),
(troop_remove_gold,"trp_player",10000),
(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),

further added that:
        ("Buy_a_ship",
[],
"Purchase a zebec (7000 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",7000),
(troop_remove_gold,"trp_player",7000),
(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_zebec"),
(assign, ":new_ship", reg0),
(party_set_slot, ":new_ship", slot_party_type, spt_zebec),
(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 20, Max 71)",
[
(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_zebec),
(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, 20, 71),
(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_zebec),
(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, 3),
(jump_to_menu, "mnu_choose_ship"), #CABA--move this to a presentation?
(else_try),
(display_message,"@You don't own a ship or your crew exceeds the boundaries."),
(try_end),
    ]),
       
Errors missing when compiling. However, when I buy this zebec in town, this message pops up "You don't own a ship or your crew exceeds the boundaries". While if the before and after I buy cog, xebec just takes, but on the map icon appears cog
What's the problem?
 
Back
Top Bottom