2
« on: January 08, 2011, 06:56:40 PM »
Since I still actually use this thread for a reference, the module_game_menus.py code should be this:
("sail_from_port",[(party_slot_eq,"$current_town",slot_party_type, spt_town),
# (party_slot_eq,"$current_town",slot_town_near_shore, 1), #Should remain commented when code implemented. ~CO
], "Buy a ship (2000 denars)", #Note: (--Code needs to be revised to check if player has gold. ~CO--) <--DONE! ~CO
[(store_troop_gold, ":gold", "trp_player"),
(assign, "$g_player_icon_state", pis_ship),
(try_begin), #begin check if player has gold
(ge, ":gold", 2000), #if players gold is 2000 or greater, then give ship
(party_set_flags, "p_main_party", pf_is_ship, 1),
(troop_remove_gold, "trp_player", 2000),
(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), #if not, then display message
(display_message, "@You don't have enough denars!"),
(try_end),
]),
Otherwise, you can buy the ship even if you don't have 2000 denars.