I have found another issue, if you try and sell prisoners to the constable from the dungeon and you have prisoners in your party as well, those prisoners may disappear.
Try with this save file selling prisoners in the dungeon from Dhirim, while having prisoners in your party as well. The prisoners in your party disappear.
It can solved using p_temp_party_2 instead of p_temp_party.
Relevant code in "module_dialogs.py"...
[anyone|plyr,"dplmc_constable_talk",
[(store_num_regular_prisoners,":prisoners", "p_main_party"),(ge,":prisoners",1)],
"I have some prisoners -- can you sell them for me?", "dplmc_constable_prisoner",[]],
##SB : convenience feature of selling prisoners in garrison
[anyone|plyr,"dplmc_constable_talk",
[(party_get_num_prisoners,":prisoners", "$current_town"),(ge,":prisoners",1)],
"We have prisoners in the dungeon -- let's have a look over them.", "dplmc_constable_garrison_prisoner_manage",[
#move prisoner
(party_clear, "p_temp_party_2"),
(assign, "$g_move_heroes", 1),
(call_script, "script_party_prisoners_add_party_prisoners", "p_temp_party_2", "p_main_party"),
(call_script, "script_party_remove_all_prisoners", "p_main_party"),
#mark global variable here to allow player to hold all the prisoners
(party_get_num_prisoners, "$diplomacy_var2", "$current_town"),
(assign, "$diplomacy_var", DPLMC_CURRENT_VERSION_CODE),
(call_script, "script_party_prisoners_add_party_prisoners", "p_main_party", "$current_town"),
(assign, "$g_move_heroes", 0),
]],
[anyone,"dplmc_constable_garrison_prisoner_manage", [
(call_script, "script_dplmc_print_subordinate_says_sir_madame_to_s0"),
(party_get_num_prisoners, ":num_prisoners", "p_main_party"),
(store_num_regular_prisoners,reg0, "p_main_party"), #does this skip over heroes?
(store_sub, reg1, ":num_prisoners", reg0),
],
"Of course, {s0}. There are {reg0} prisoners left and {reg1} nobles incarcerated}.", "dplmc_constable_garrison_prisoner_sell",
[(change_screen_trade_prisoners)]],
[anyone|plyr,"dplmc_constable_garrison_prisoner_sell", [
# (call_script, "script_dplmc_print_subordinate_says_sir_madame_to_s0"),
(party_get_num_prisoners, ":num_prisoners", "p_main_party"),
(gt, ":num_prisoners", 1),
],
"Let's keep selling.", "dplmc_constable_garrison_prisoner_manage",
[(change_screen_trade_prisoners)]],
[anyone|plyr,"dplmc_constable_garrison_prisoner_sell", [],
"We're done here.", "dplmc_constable_garrison_prisoner_done",
[
#unset variables
(assign, "$diplomacy_var", 0),
(assign, "$diplomacy_var2", 0),
]],
[anyone,"dplmc_constable_garrison_prisoner_done", [
],
"Hopefully they'll get some honest labor done instead of languishing in the dungeon.", "dplmc_constable_pretalk",
[
(assign, "$g_move_heroes", 1),
#move remaining prisoners back to garrison
(call_script, "script_party_remove_all_prisoners", "$current_town"),
(call_script, "script_party_prisoners_add_party_prisoners", "$current_town", "p_main_party"),
#restore player's prisoner
(call_script, "script_party_remove_all_prisoners", "p_main_party"),
(call_script, "script_party_prisoners_add_party_prisoners", "p_main_party", "p_temp_party_2"),
(assign, "$g_move_heroes", 0),
]],
Why don"t we use github ? .
I set up a repository for myself and added the fixes that I fancy, but it would make more sense if we found a way to work together.
Btw, even Dickplomacy has a repo.
Edit: Added fix to correctly show the option only when there are prisoners in the dungeon.
Try with this save file selling prisoners in the dungeon from Dhirim, while having prisoners in your party as well. The prisoners in your party disappear.
It can solved using p_temp_party_2 instead of p_temp_party.
Relevant code in "module_dialogs.py"...
[anyone|plyr,"dplmc_constable_talk",
[(store_num_regular_prisoners,":prisoners", "p_main_party"),(ge,":prisoners",1)],
"I have some prisoners -- can you sell them for me?", "dplmc_constable_prisoner",[]],
##SB : convenience feature of selling prisoners in garrison
[anyone|plyr,"dplmc_constable_talk",
[(party_get_num_prisoners,":prisoners", "$current_town"),(ge,":prisoners",1)],
"We have prisoners in the dungeon -- let's have a look over them.", "dplmc_constable_garrison_prisoner_manage",[
#move prisoner
(party_clear, "p_temp_party_2"),
(assign, "$g_move_heroes", 1),
(call_script, "script_party_prisoners_add_party_prisoners", "p_temp_party_2", "p_main_party"),
(call_script, "script_party_remove_all_prisoners", "p_main_party"),
#mark global variable here to allow player to hold all the prisoners
(party_get_num_prisoners, "$diplomacy_var2", "$current_town"),
(assign, "$diplomacy_var", DPLMC_CURRENT_VERSION_CODE),
(call_script, "script_party_prisoners_add_party_prisoners", "p_main_party", "$current_town"),
(assign, "$g_move_heroes", 0),
]],
[anyone,"dplmc_constable_garrison_prisoner_manage", [
(call_script, "script_dplmc_print_subordinate_says_sir_madame_to_s0"),
(party_get_num_prisoners, ":num_prisoners", "p_main_party"),
(store_num_regular_prisoners,reg0, "p_main_party"), #does this skip over heroes?
(store_sub, reg1, ":num_prisoners", reg0),
],
"Of course, {s0}. There are {reg0} prisoners left and {reg1} nobles incarcerated}.", "dplmc_constable_garrison_prisoner_sell",
[(change_screen_trade_prisoners)]],
[anyone|plyr,"dplmc_constable_garrison_prisoner_sell", [
# (call_script, "script_dplmc_print_subordinate_says_sir_madame_to_s0"),
(party_get_num_prisoners, ":num_prisoners", "p_main_party"),
(gt, ":num_prisoners", 1),
],
"Let's keep selling.", "dplmc_constable_garrison_prisoner_manage",
[(change_screen_trade_prisoners)]],
[anyone|plyr,"dplmc_constable_garrison_prisoner_sell", [],
"We're done here.", "dplmc_constable_garrison_prisoner_done",
[
#unset variables
(assign, "$diplomacy_var", 0),
(assign, "$diplomacy_var2", 0),
]],
[anyone,"dplmc_constable_garrison_prisoner_done", [
],
"Hopefully they'll get some honest labor done instead of languishing in the dungeon.", "dplmc_constable_pretalk",
[
(assign, "$g_move_heroes", 1),
#move remaining prisoners back to garrison
(call_script, "script_party_remove_all_prisoners", "$current_town"),
(call_script, "script_party_prisoners_add_party_prisoners", "$current_town", "p_main_party"),
#restore player's prisoner
(call_script, "script_party_remove_all_prisoners", "p_main_party"),
(call_script, "script_party_prisoners_add_party_prisoners", "p_main_party", "p_temp_party_2"),
(assign, "$g_move_heroes", 0),
]],
Why don"t we use github ? .
I set up a repository for myself and added the fixes that I fancy, but it would make more sense if we found a way to work together.
Btw, even Dickplomacy has a repo.
Edit: Added fix to correctly show the option only when there are prisoners in the dungeon.