Diplomacy for 1.174

diegoami

Regular
WBNWVCWF&SM&B
Best answers
0
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 ?  :smile: .
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.
 

Somebody

Code Pope
Baron
WBWF&S
Best answers
1
Yeah I'll think about adding a repo but I'm not sure what the initial commit should be - 1.171 then adding on the current version, or Diplomacy 4.3 and then reapplying 1.171 and then my changes on top. Thanks for the bugfix and the savegame upload.
 

diegoami

Regular
WBNWVCWF&SM&B
Best answers
0
Great. On the other hand I wonder if this should be called "4.3 for Steam" as it is not backwardly compatible with the previous 4.3 for 1.153.

Shouldn't we slowly move towards Diplomacy 4.4 or 5.0 for all that matters? Also to fight the anarchy of the wild duplication of submods based on Diplomacy 4.3.
 

diegoami

Regular
WBNWVCWF&SM&B
Best answers
0
Ruan said:
lcmiracle said:
Sorry, dumb question: is this the 4.3 version and is it the latest or works with 1.74 Warband (I do have a WSE exe for use with other mods)? Also does this include PBOD or do I need to find a PBOD installer? Thanks in advance.
++ Please respond
Yes, this is the later 4.3 version and it works with 1.74 Warband.
No, it does not include PBOD, it is unlikely that is going to work just applying a PBOD installer .
 

diegoami

Regular
WBNWVCWF&SM&B
Best answers
0
I have seen players' patrols' prisoners being added to the garrison instead of being put in the dungeon. The wrong method is called in "module_simple_triggers.py". Unless this is intentional ?


# Patrol ai
  (2,
  [

    (try_for_parties, ":party_no"),
      (party_slot_eq,":party_no", slot_party_type, spt_patrol),

      # (call_script, "script_party_remove_all_prisoners", ":party_no"), #SB : retain prisoners

      (try_begin),
        (get_party_ai_behavior, ":ai_behavior", ":party_no"),
        (eq, ":ai_behavior", ai_bhvr_travel_to_party),
        (party_get_slot, ":target_party", ":party_no", slot_party_ai_object),

        (try_begin),
          (gt, ":target_party", 0),
          (store_distance_to_party_from_party, ":distance_to_target", ":party_no", ":target_party"),
          (le, ":distance_to_target", 5),
          (try_begin), #SB : drop off prisoners
            (le, ":distance_to_target", 3),
            (is_between, ":target_party", walled_centers_begin, walled_centers_end),
            # (call_script, "script_party_add_party_prisoners", ":target_party", ":party_no"), #DA: not this one, this adds prisoners to your party !
            (call_script, "script_party_prisoners_add_party_prisoners", ":target_party", ":party_no"),
            (call_script, "script_party_remove_all_prisoners", ":party_no"),
          (try_end),
          (try_begin),
            (party_get_slot, ":ai_state", ":party_no", slot_party_ai_state),
            (eq, ":ai_state", spai_retreating_to_center),
            (try_begin),
              (le, ":distance_to_target", 1),
              (call_script, "script_party_add_party", ":target_party", ":party_no"),
              (remove_party, ":party_no"),
            (try_end),
          (else_try),
            (party_get_position, pos1, ":target_party"),
            (party_set_ai_behavior,":party_no", ai_bhvr_patrol_location),
            (party_set_ai_patrol_radius, ":party_no", 1),
            (party_set_ai_target_position, ":party_no", pos1),
          (try_end),
         
        # (else_try),
          # #remove party?
        (try_end),

      (try_end),
    (try_end),
    ]),

There have been reports of patrols disappearing without reinforcing the garrison after reaching their destination, but I could not reproduce that. They may seem to disappear when they reach their destination, but you have to wait 2 in-game hours to see them reinforce the garrison.
 

diegoami

Regular
WBNWVCWF&SM&B
Best answers
0
Another small thing, when sending companions to spy in towns that are owned by the player, the town and the kingdom's name are not shown correctly.
Here is a fix in "module_dialogs.py"

#SB : prohibit intel-gathering in own faction
[anyone,"member_intelgathering_1", [
(troop_get_slot, ":town_with_contacts", "$g_talk_troop", slot_troop_town_with_contacts),
(store_faction_of_party, ":contact_town_faction", ":town_with_contacts"),
(is_between, "$players_kingdom", kingdoms_begin, kingdoms_end),
(eq, ":contact_town_faction", "$players_kingdom"), #own faction


  # (str_store_party_name, s17, ":contact_town_faction"),
  (str_store_party_name, s17, ":town_with_contacts"),

(party_get_slot, ":town_ruler", ":town_with_contacts", slot_town_lord),
(try_begin),
  (is_between, ":town_ruler", heroes_begin, heroes_end),
  (assign, reg18, 1),
  (str_store_troop_name, s18, ":town_ruler"),
(else_try), #own city, unassigned, etc instead of defaulting to ruler
  (assign, reg18, 0),
(try_end),

#use cached instability value
(faction_get_slot, ":instability", ":contact_town_faction", slot_faction_instability), #0 to 100
(val_min, ":instability", 60), #no descriptor past that point
(val_div, ":instability", 20), #3 to 0
(store_sub, ":string", "str_the_s12_is_a_rock_of_stability_politically_speaking_whatever_the_lords_may_think_of_each_other_they_fight_as_one_against_the_common_foe", ":instability"),

# (str_store_string, s12, "@our realm") # it ends up being "The our realm"
(str_store_faction_name, s12, ":contact_town_faction"),

(str_store_string, s19, ":string"),
(call_script, "script_dplmc_print_subordinate_says_sir_madame_to_s0"),
], "Aye, {s0}, I do have some friends back in {s17}... However, I do not believe {reg18?{s18} would take kindly to this sort of skullduggery:the political landscape is changing so drastically}. It is common knowledge that {s19}", "do_member_trade",[
#SB : initialize global
(assign, "$lord_selected", -1),
]],
 

Attachments

diegoami

Regular
WBNWVCWF&SM&B
Best answers
0
Occasionally I find that the traveller does not know where the ransom brokers are. The new script to find tavern travelers (script_list_known_taverngoers ) relies on the troops' slots. However, they are not set in update_ransom_brokers, unlike in similar scripts like update_booksellers.

Here is a fix in "module_scripts.py"

  #script_update_ransom_brokers
  # INPUT: none
  # OUTPUT: none
  ("update_ransom_brokers",
    [(try_for_range, ":town_no", towns_begin, towns_end),
      (party_set_slot, ":town_no", slot_center_ransom_broker, 0),
    (try_end),

    (try_for_range, ":troop_no", ransom_brokers_begin, ransom_brokers_end),
      #SB : random-brokers prefer towns with actual prisoners
      (assign, ":limit", 20),
      (try_for_range, ":unused", 0, ":limit"), #also exclude Tihr since it has Ramun
          (store_random_in_range, ":town_no", towns_begin, towns_end),
          (neq, ":town_no", "p_town_2"),
          #also exclude centers under siege
          (neg|party_slot_ge, ":town_no", slot_center_is_besieged_by, 1),
          (party_get_num_prisoners, ":prisoner_count", ":town_no"),
          (gt, ":prisoner_count", 0),
          (party_set_slot, ":town_no", slot_center_ransom_broker, ":troop_no"),
          (troop_set_slot, ":troop_no", slot_troop_cur_center, ":town_no"), #DA: necessary for travellers to know about it
          (assign, ":limit", 0), #loop breaker
      (try_end),
      (eq, ":limit", 20), #none found
      (store_random_in_range, ":town_no", towns_begin, towns_end),
      (party_set_slot, ":town_no", slot_center_ransom_broker, ":troop_no"),
      (troop_set_slot, ":troop_no", slot_troop_cur_center, ":town_no"), #DA: necessary for travellers to know about it
    (try_end),

    (party_set_slot,"p_town_2",slot_center_ransom_broker,"trp_ramun_the_slave_trader"),
    ]),
 

Attachments

Corbul

Sergeant at Arms
WBWF&SVC
Best answers
1
Are these changes already included into the source? If so, which individual files do I download? Because I've made several changes to my source and don't want to start over.
 

diegoami

Regular
WBNWVCWF&SM&B
Best answers
0
Corbul said:
Are these changes already included into the source? If so, which individual files do I download? Because I've made several changes to my source and don't want to start over.
They are probably not - you can apply these changes directly to your source, if you want them.
However, I would suggest that you keep two separate directories, one for your source and one for the base mod - so in case the base mod gets updated, you can use tools like (win)diff to see what has changed and can be integrated into your source. Or you can do it like me and use a version control system like git, and keep the base mod in a separate branch.
 

Corbul

Sergeant at Arms
WBWF&SVC
Best answers
1
diegoami said:
They are probably not - you can apply these changes directly to your source, if you want them.
However, I would suggest that you keep two separate directories, one for your source and one for the base mod - so in case the base mod gets updated, you can use tools like (win)diff to see what has changed and can be integrated into your source. Or you can do it like me and use a version control system like git, and keep the base mod in a separate branch.
Good idea!
By the way, I found some old quests in the game files (save lady from besieged town/ castle; deliver supplies to besieged town/ castle; rescue lords from revolting peasants; etc.). Would you happen to know how I can reactivate them successfully? I've dug around, removed the ## from the entries, compiled. Some compile no problem, but don't see to be active in the game. Others (rescue lady) give error.
 

diegoami

Regular
WBNWVCWF&SM&B
Best answers
0
Corbul said:
By the way, I found some old quests in the game files (save lady from besieged town/ castle; deliver supplies to besieged town/ castle; rescue lords from revolting peasants; etc.). Would you happen to know how I can reactivate them successfully? I've dug around, removed the ## from the entries, compiled. Some compile no problem, but don't see to be active in the game. Others (rescue lady) give error.
I would assume they have been commented out for a reason and are probably not working, unfinished, unbalanced or buggy. I would not touch them, unless you have an idea on how they are supposed to work or could work.
 

Corbul

Sergeant at Arms
WBWF&SVC
Best answers
1
diegoami said:
I would assume they have been commented out for a reason and are probably not working, unfinished, unbalanced or buggy. I would not touch them, unless you have an idea on how they are supposed to work or could work.
I see. A shame. Thanks for the reply though.
 

Somebody

Code Pope
Baron
WBWF&S
Best answers
1
Yes, most of those quests would be considered filler delivery/escort missions, and they probably pre-date Warband.
 

Corbul

Sergeant at Arms
WBWF&SVC
Best answers
1
Somebody said:
Yes, most of those quests would be considered filler delivery/escort missions, and they probably pre-date Warband.
But they would add to the diversity of the already available quests. After all, what quests are there in native?
  • Lords: escort lady to another fief; hunt down fugitive; collect taxes from a fief; kill local merchant; work as mercenary (campaign); deliver letter; train troops; lend companion/ surgeon; buy supplies (campaign); scout around enemy fief (campaign); rescue captured lord (campaign/ wartime); meet lord's spy (campaign/ wartime); capture enemy spy (wartime?); destroy bandit lair; collect debt from another lord; incriminate commander (never got this in native or diplomacy); capture enemy soldiers; capture enemy lord; capture runaway serfs (never got this in native/ diplomacy); denounce lord; raid caravan; cause a provocation.
  • Village elder: deliver grain; deliver cattle; train peasants.
  • Guild master: deliver food items (not just wine, apparently); escort caravan; move cattle herd; convince lords to make peace (wartime/ campaign); defeat looters; defeat troublesome bandits; track down bandits; ransom girl from bandits; stop night bandits (very rare in my experience).
  • Ladies: rescue lord; solve dispute; duel for lady; deliver letter (never got this).
  • Other: town merchant's questline; save village from bandits; give money to a poor peasant/ townperson (never got this).
A few more wouldn't hurt, and they'd both fit the vanilla setting, and are perfectly canon.
 

diegoami

Regular
WBNWVCWF&SM&B
Best answers
0
A bug that has been in Diplomacy for a while, also in older versions - if you replace the minister of your kingdom, a "resolve dispute" quest can be aborted even if you hadn't accepted it in the first place ! This causes a loss of relations and right to rule. The fix would be in "module_dialogs.py"

[anyone, "minister_replace_confirm",
[
(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_player_companion),
], "Very good. {s9} is your new minister. I shall make ready to rejoin you.", "close_window",
[
(str_store_troop_name, s9, "$g_player_minister"),
(party_add_members, "p_main_party", "$g_talk_troop", 1),
(assign, "$g_leave_encounter", 1),
(try_begin),
(main_party_has_troop, "$g_player_minister"),
(party_remove_members, "p_main_party", "$g_player_minister", 1),
(try_end),

(try_for_range, ":minister_quest", all_quests_begin, all_quests_end),
(quest_slot_eq, ":minister_quest", slot_quest_giver_troop, "$g_talk_troop"),
(check_quest_active, ":minister_quest"), #DA: make sure that the quest has actually been accepted by the player !
(call_script, "script_abort_quest", ":minister_quest", 0),
(try_end),
]],

It seems to me that script_abort_quest should always check whether a quest is active before aborting it, but I do not know if there would be side effects in other places.
 

diegoami

Regular
WBNWVCWF&SM&B
Best answers
0
Hmm... it seems to me that the feature to delegate a quest to a companion does not work. I have tried it in my walkthrough. Here I delegate a quest to Matheld to ransom a girl, but an ominous debug screen appears and Matheld actually stays in the party, as can be seen later on. After some days I check on her and her whereabouts are unknown, while she is actually still in the party. The option to ask her a question is missing, as the game thinks she is about to start off on a quest. Here is the save file, although I don"t think it is going to help.

For all I could see, this feature seems actually unimplemented. Using a save editor I had to set back Matheld's slot_troop_current_mission and slot_troop_mission_object back to 0, to get her back as a full member. And I decided to hide that menu option - it seemed too good to be true.
 

Dj_FRedy

Duke
M&BWBNWVCWF&S
Best answers
14
If you'll allow me to criticize.
Why use an editor when we have the operations necessary to make the changes?
Set the values you need and create a menu to execute them.
The editors, most of the time, not contemplating all the variables of the mod, the only thing they do is to break the save...
It's a tip that I give you, since you are already modifying the files from the Modsys.

 

diegoami

Regular
WBNWVCWF&SM&B
Best answers
0
Dj_FRedy said:
If you'll allow me to criticize.
Why use an editor when we have the operations necessary to make the changes?
Set the values you need and create a menu to execute them.
The editors, most of the time, not contemplating all the variables of the mod, the only thing they do is to break the save...
It's a tip that I give you, since you are already modifying the files from the Modsys.
Thank you for the tip - I guess that I usually would have to do. In this particular case I think it worked right and did not break anything, as only those two slots were affected, but next time sure, I will use a game menu to be safe.
 

Somebody

Code Pope
Baron
WBWF&S
Best answers
1
There already is a debug menu you can access to swap out slot values. You can access the endpoints through the character report (automatically goes to last talked troop), and the export/import for companions, and just enabling the cheatmenu ctrl+shift+` shortcut while inside a scene.
The printout is supposed to be there but I forgot to add the cheat mode requirement for it. Also, if you access the character screen/quest while in the middle of a dialog (by clicking on their face or pressint tab), if any registers are shared they can get broken between the various dialog options.