Diplomacy for 1.174

Users who are viewing this thread

Hello and thanks for the mod!
Some items from the bottom of inventory are getting lost from time to time. They just disappear completely.
 
Somebody said:
You'll have to be more specific (and upload a savegame probably) - is this from autoloot? autosell? food consumption? quest completion?
Unfortunately, save has been overwritten long time ago.
I use only manual looting and buying. The items were book and weapons. This happened to me few times.
 
Also i can`t add plugin to this source, everything compiles well but game seems to be has no changes.  And when the code is put inside source files - the mod is working.
Just trying to rem this red line, for example:
("cf_reinforce_party",
    [
      (store_script_param_1, ":party_no"),

      (store_faction_of_party, ":party_faction", ":party_no"),
  ##diplomacy start+ The party faction may be changed for culture, but we still need the original
  (assign, ":real_party_faction", ":party_faction"),
  ##diplomacy end+
      (party_get_slot, ":party_type",":party_no", slot_party_type),

#Rebellion changes begin:
      (try_begin),
        (eq, ":party_type", spt_kingdom_hero_party),
        (party_stack_get_troop_id, ":leader", ":party_no"),
#ncult        (troop_get_slot, ":party_faction",  ":leader", slot_troop_original_faction),
##diplomacy start+ Use player culture for companions and spouse (and any hypothetical non-hero mercenaries)
(eq, ":real_party_faction", "fac_player_supporters_faction"),
(is_between, "$g_player_culture", npc_kingdoms_begin, npc_kingdoms_end),
(this_or_next|is_between, ":leader", companions_begin, companions_end),
(this_or_next|troop_slot_eq, "trp_player", slot_troop_spouse, ":leader"),
  (neg|is_between, ":leader", heroes_begin, heroes_end),
(assign, ":party_faction", "$g_player_culture"),
##diplomacy end+
      (try_end),
#Rebellion changes end
When I tryed to add this by plugin, the steps were:
I`ve added "from compiler import *" after first imports in the file module_scripts.py
# -*- coding: cp1254 -*-
from header_common import *
from header_operations import *
from module_constants import *
from module_constants import *
from header_parties import *
from header_skills import *
from header_mission_templates import *
from header_items import *
from header_triggers import *
from header_terrain_types import *
from header_music import *
from header_map_icons import *
from ID_animations import *
##diplomacy start+
from module_factions import dplmc_factions_begin, dplmc_factions_end, dplmc_non_generic_factions_begin
#SB : update info pages
from ID_info_pages import *
##diplomacy end+

##diplomacy begin
##jrider reports
from header_presentations import tf_left_align
  #### Autoloot improved by rubik begin
from module_items import *

from compiler import *

## deprecated due to 1.165 operations
# ibf_item_type_mask = 0x000000ff

# def set_item_difficulty():
  # item_difficulty = []
  # for i_item in xrange(len(items)):
    # item_difficulty.append((item_set_slot, i_item, dplmc_slot_item_difficulty, get_difficulty(items[i_item][6])))
  # return item_difficulty[:]

# def set_item_base_score():
  # item_base_score = []
  # for i_item in xrange(len(items)):
    # if items[i_item][3] & ibf_item_type_mask == itp_type_two_handed_wpn and items[i_item][3] & itp_two_handed == 0:
      # item_base_score.append((item_set_slot, i_item, dplmc_slot_two_handed_one_handed, 1))
    # type = items[i_item][3] & ibf_item_type_mask
    # if type >= itp_type_head_armor and type <= itp_type_hand_armor:
      # item_base_score.append((item_set_slot, i_item, dplmc_slot_item_head_armor, get_head_armor(items[i_item][6])))
      # item_base_score.append((item_set_slot, i_item, dplmc_slot_item_body_armor, get_body_armor(items[i_item][6])))
      # item_base_score.append((item_set_slot, i_item, dplmc_slot_item_leg_armor, get_leg_armor(items[i_item][6])))
    # elif type >= itp_type_one_handed_wpn and type <= itp_type_thrown and type != itp_type_shield:
      # item_base_score.append((item_set_slot, i_item, dplmc_slot_item_thrust_damage, get_thrust_damage(items[i_item][6])))
      # item_base_score.append((item_set_slot, i_item, dplmc_slot_item_swing_damage, get_swing_damage(items[i_item][6])))
    # elif type == itp_type_horse:
      # item_base_score.append((item_set_slot, i_item, dplmc_slot_item_horse_speed, get_missile_speed(items[i_item][6])))
      # item_base_score.append((item_set_slot, i_item, dplmc_slot_item_horse_armor, get_body_armor(items[i_item][6])))
    # elif type == itp_type_shield:
      # item_base_score.append((item_set_slot, i_item, dplmc_slot_item_shield_size, get_weapon_length(items[i_item][6])))
      # item_base_score.append((item_set_slot, i_item, dplmc_slot_item_shield_armor, get_body_armor(items[i_item][6])))
  # return item_base_score[:]
  # #### Autoloot improved by rubik end

##diplomacy end

####################################################################################################################
# scripts is a list of script records.
# Each script record contns the following two fields:
# 1) Script id: The prefix "script_" will be inserted when referencing scripts.
# 2) Operation block: This must be a valid operation block. See header_operations.py for reference.
####################################################################################################################

def keys_array():
  keys_list = []
  for key_no in xrange(len(keys)):
    keys_list.append((troop_set_slot, "trp_temp_array_a", key_no, keys[key_no]))
    keys_list.append((troop_set_slot, "trp_temp_array_b", key_no, str_key_0+key_no))
  return keys_list[:]

scripts = [
added new string "import plugin_ncult" to module_info.py
export_dir = "D:/Steam/steamapps/common/MountBlade Warband/Modules/Diplomacy/"
import plugin_ncult
created new file plugin_ncult.py, put there code:
from compiler import *
register_plugin("plugin_ncult")
scripts=[
# script_cf_reinforce_party
  # Input: arg1 = party_no,
  # Output: none
  # Adds reinforcement to party according to its type and faction
  # Called from several places, simple_triggers for centers, script_hire_men_to_kingdom_hero_party for hero parties
  ("cf_reinforce_party",
    [
      (store_script_param_1, ":party_no"),

      (store_faction_of_party, ":party_faction", ":party_no"),
  ##diplomacy start+ The party faction may be changed for culture, but we still need the original
  (assign, ":real_party_faction", ":party_faction"),
  ##diplomacy end+
      (party_get_slot, ":party_type",":party_no", slot_party_type),

#Rebellion changes begin:
      (try_begin),
        (eq, ":party_type", spt_kingdom_hero_party),
        (party_stack_get_troop_id, ":leader", ":party_no"),
#ncult        (troop_get_slot, ":party_faction",  ":leader", slot_troop_original_faction),
##diplomacy start+ Use player culture for companions and spouse (and any hypothetical non-hero mercenaries)
(eq, ":real_party_faction", "fac_player_supporters_faction"),
(is_between, "$g_player_culture", npc_kingdoms_begin, npc_kingdoms_end),
(this_or_next|is_between, ":leader", companions_begin, companions_end),
(this_or_next|troop_slot_eq, "trp_player", slot_troop_spouse, ":leader"),
  (neg|is_between, ":leader", heroes_begin, heroes_end),
(assign, ":party_faction", "$g_player_culture"),
##diplomacy end+
      (try_end),
#Rebellion changes end

      (try_begin),
      #SB : this block checks for town lords, which is invalid for kingdom parties
        (is_between, ":party_type", spt_castle, spt_village),
        (eq, ":party_faction", "fac_player_supporters_faction"),
        (party_get_slot, ":town_lord", ":party_no", slot_town_lord),
        (try_begin),
        ##diplomacy begin
          (is_between, "$g_player_culture", npc_kingdoms_begin, npc_kingdoms_end),
          (assign, ":party_faction", "$g_player_culture"),

          # (try_begin), #debug
            # (eq, "$cheat_mode", 1),
            # (str_store_party_name, s11, ":party_no"),
            # (display_message, "@pt in {s11}"),
          # (try_end),

        (else_try),
        ##diplomacy end
          (gt, ":town_lord", 0),
          (troop_get_slot, ":party_faction", ":town_lord", slot_troop_original_faction),
          (gt, ":party_faction", 0), ## CC
        (else_try),
          (party_get_slot, ":party_faction", ":party_no", slot_center_original_faction),
        (try_end),
      (try_end),
  ##diplomacy start+ Player culture cleanup (do this once here, instead of separately for each type)
  (try_begin),
    (gt, ":real_party_faction", "fac_commoners"),
    (this_or_next|eq, ":real_party_faction", "fac_player_faction"),
    (this_or_next|eq, ":real_party_faction", "fac_player_supporters_faction"),
(eq, ":real_party_faction", "$players_kingdom"),
(neg|is_between, ":party_faction", npc_kingdoms_begin, npc_kingdoms_end),
(is_between, "$g_player_culture", npc_kingdoms_begin, npc_kingdoms_end),
(assign, ":party_faction", "$g_player_culture"),
  (try_end),
  ##diplomacy end+

      (faction_get_slot, ":party_template_a", ":party_faction", slot_faction_reinforcements_a),
      (faction_get_slot, ":party_template_b", ":party_faction", slot_faction_reinforcements_b),
      (faction_get_slot, ":party_template_c", ":party_faction", slot_faction_reinforcements_c),

      (assign, ":party_template", 0),
      (store_random_in_range, ":rand", 0, 100),
    ##diplomacy start+
  #Implement "quality vs. quantity" in a way that is visible in player battles
  #(previously, quantity increased party size, but quality only had an effect
  #in autocalc battles)
  (try_begin),
(is_between, ":real_party_faction", kingdoms_begin, kingdoms_end),
(faction_get_slot, ":dplmc_quality", ":real_party_faction", dplmc_slot_faction_quality),
(val_clamp, ":dplmc_quality", -3, 4),
(val_add, ":rand", ":dplmc_quality"),
(val_clamp, ":rand", 0, 101),
  (try_end),
  ##diplomacy end+
      (try_begin),
        (this_or_next|eq, ":party_type", spt_town),
        (eq, ":party_type", spt_castle),  #CASTLE OR TOWN
        (try_begin),
          (lt, ":rand", 65),
          (assign, ":party_template", ":party_template_a"),
        (else_try),
          (assign, ":party_template", ":party_template_b"),
        (try_end),
      (else_try),
        (eq, ":party_type", spt_kingdom_hero_party),
        (try_begin),
          (lt, ":rand", 50),
          (assign, ":party_template", ":party_template_a"),
        (else_try),
          (lt, ":rand", 75),
          (assign, ":party_template", ":party_template_b"),
        (else_try),
          (assign, ":party_template", ":party_template_c"),
        (try_end),
      (else_try),
  ##diplomacy start+ Reinforcements for patrols
    (this_or_next|eq, ":party_type", spt_patrol),
    (eq, ":party_type", spt_reinforcement), #SB : add more reinf if necessary
(try_begin),
  (lt, ":rand", 65),
  (assign, ":party_template", ":party_template_a"),
(else_try),
  (assign, ":party_template", ":party_template_b"),
(try_end),
  ##diplomacy end+
      (try_end),

      (try_begin),
        (gt, ":party_template", 0),
        (party_add_template, ":party_no", ":party_template"),
      (try_end),
  ]),
]
 
I`ve found what causes the trouble with dissapearing items. It happens when you are talking with your regular troops (not companions) and then trying to put something from their inventory to yours. The last six items from the bottom of your inventory will disapear.
 
Somebody said:
Oh yeah that's intended to be view-only. How much inventory management did your character have?
The skill was 3.
This trouble happens when inventory is almost full. When it`s near to be empty, the items are just rearranging to other slots from bottom lines.
 
There is a little error message in taverns, when you choose replic to buy a drink for everyone.
SCRIPT ERROR ON OPCODE 21:Invalid Script Parameter ID: 0; LINE NO: 0:
At script: dplmc_get_troop_standing_in_faction.
SCRIPT ERROR ON OPCODE 22:Invalid Script Parameter ID: 1; LINE NO: 1:
At script: dplmc_get_troop_standing_in_faction.
 
Yeah fixing that, it was an unfinished stub calculating the price of buying wine. Also fixed the inventory viewing thing (by bypassing the script :meh:) but pretty sure what people want is the troop tree thing.
 
idk if this has been reported before, but i found a bug that when at war, instead of having a morale penalty, all troops from the opposing faction when go to war get a morale boost instead
 
Do you have a screenshot of this behaviour? Go into the information pages -> morale and check the amount. It's possible that you had a large morale boost prior to the war declaration.
 
Yep, that's where i found this 'quirk', i sure check the numbers at reports -> party morale. So i was a vassal of Swadia using an army consisting of significant numbers of Vaegir troops (since i was grinding sea raiders before lol) then Yaroglek declared war on us. After some fights with their lord, instead of a penalty I noticed that i got a morale bonus for Vaegir troops (that 'extra morale for Vaegir troops' part).

Yep, at first i thought it's because i fought sea raiders on their front, but after some observations, everytime i fought a Vaegir lord, the number always increase instead of decreasing.
 
Just tried to use the source for this and after adding new items in and compiling, the items are in the wrong order. It's like what happens when you add a new item in text editing between other items, everything after that item goes to the wrong troop. This shouldn't happen as it's in source, but it's only happening with Diplomacy. Any ideas as to why it's happening and how to fix it?
 
When i lauch the game, it goes to the loading screen and suddenly it closes and i get this error: RGL Error, Unable to open file: Common/Res/ccoop_extra_ui_textures.brf... Any way to fix it?
 
Back
Top Bottom