OSP Code SP [WB v1.127] Expanded nobility title system kit (v0.3.3)

Currently viewing this thread:

jrider

Veteran
WB
Best answers
0
Playing for some time, I became somewhat frustrated by the native title system, being unable to distinguish between Rhodoks and Swadian lords and all the Ladies being Lady whatever faction or status they had, looking for something in the notes took forever.

What I wanted was, basicaly, a title system that would allow to identify clearly a lord's faction and his land ownership (ie. ruler, town, castle, village, landless), as well as their wife's position (titled according to her husband), and to distinguish between all the unmarried daughter and sister of the various factions.

after some research I didn't see anything like this existing and the only mention of it was as a suggestion in the Privy Council (here's the link for reference: http://forums.taleworlds.com/index.php/topic,118571.0.html ).

Most of the new titles comes from the suggestions in that thread (or from external material referenced in it).
NB: notable exceptions are for unmarried women titles and rhodoks titles (went for Scot Gaelic instead of Italian) and I chose latin for player faction.

Here is what I came up with:
  • Faction based titles for ruler, town, castle, village, landless (based on the biggest fief owned) and unmarried status.
  • Wife-husband relationship taken into account for the spouse not holding land (if both hold land the best title is applied).
  • Lords and Ladies' titles are updated for fief grant, faction change and weddings.
  • Unmarried daughters and sisters have a title equivalent to Mistress (not a very noble one, but the best I could come with to set them apart).
  • v0.3:  Added title suffix to reflect relation with liege (from caprera's questions) (used latin non-faction specific ones).
  • v0.3.1: enabled the player for titles (also derived from caprera's questions).
  • Titles for companions (not as vassals, they get the standard title in that case) in the party (unique title so they're all next to each others in the notes) or outside the party (according to major skills).
  • Companions' titles are changed when they join/leave the party (except when vassals).
  • since the aim was to have a nice sorted list in game Notes, the mongol titles have been swapped.
  • The titles come from Latin [player], English [swadian], Russian  [vaegir], Mongol (or chinese) [khergit], Old Norse (or mid-norwegian)  [nords], Scots Gaelic [rhodoks] and Arabic [sarranid].

    Almost no source were available for them so most female Mongol titles are made up (I'm no linguist but I tried my best).
NB: the title system, as of v0.3.1, includes the player himself.

Screenshots:

Using this with a previous savegame, shouldn't cause major problems, there may be some displaced strings due to the extension of the existing titles strings.

Following Caprera's questions, here is a break down of the general principle if you want to adapt/expand the code:
  • basic conditions to check troop is eligible for title (faction, lords, ladies and such)
  • store the plural form of the troop name (for named characters this one is never modified thus providing the uncorrupted base character name, player is handled slightly differently since the plural name is never updated in native code).
  • External computation block for the conditions to be used to attribute the rank (examples : gender, biggest fief for husband/wife couple, relation to liege)
  • Rank calculation block, which translate to the base index of the rank string, starting at 0 (example : quality computation)
  • find the corresponding string index in the module_strings.py (examples: index for quality in a faction context, index for suffix derived from relation number, index for out of party companions)
  • build the new character name string using that string index
  • replace the old character name by the new one
  • rename the character's party (if he has one) according to its new name.
steps 3 and 4 can be done several times for as many titles as you need.
step 6 can mix the result of the various 3 & 4 steps' blocks (if you made several)

use strings in module_strings.py to reduce coding effort (NB: never use an empty string, always put something in it).

keeping the rank value for other things should use the one computed in step 4 to stay generic (unless you love long try_begin/else_try blocks or want to make something unique for each rank).

and one important last thing, even if you have only one condition keep the whole thing into a try_begin/try_end block (except for the script parameters and common stuff that can be derived from them).

here is the changelog and code (for Warband v1.127), feel free to reuse anywhere (this is v0.3.3):

Changelog:
v0.0: initial release
v0.1: generic fix
  • changed the conditions slightly in the main script to exclude pretenders from being retitled.
v0.2: fix for companion title when initially giving a fief to him/her
  • changes to the troop_set_title_according_to_faction_gender_and_lands script
  • changes to the get_troop_specialisation scripts.
  • new modifications to make in module_dialog.py added.
v0.3: add relation to liege suffix to title (following caprera's suggestion)
  • troop_change_relation_with_troop modified to update title if both troops are same faction and second is faction ruler
  • new script modified to add suffix computation block
  • modified new kingdom titles in module_strings.py to add relation suffix
  • added new set of strings in module_strings.py for suffix
  • added condition to non-vassal companion title (problem occured when player with kingdom swore allegiance to a king)
v0.3.1: enable player to hold title
  • modified game_reset_player_party_name script to store plural name and reset player's title
  • modified player_join_faction to update spouse and player's titles
  • modified player_leave_faction to update spouse and player's titles
  • new script modified to allow player to be titled
v0.3.2: fixes in hook placement for companion title after granting fief, player taking his first center and exclude kings from suffix
  • moved added code block to end of give_center_to_lord script
  • moved added code block in troop_change_relation_with_troop script
  • added call to title change in change_player_relation_with_troop
  • added call to title change in activate_player_faction script
  • initial condition for computing suffixes  in new script modified
v0.3.3: fixed quality computation for female to priorize ruler as title
  • new conditions for female character in new script to priorize ruler title

  • New tags used in the scripts to put in module_constants.py :
    NB: I use the second tag in an extended note system, it has no direct use for the title code itself.
Code:
# Jrider + for Heroes specialization titles and descriptions
hero_titles_begin = "str_hero_titles_none"
hero_specdesc_begin = "str_hero_specdesc_none"
# Jrider -

  • New titles strings (and descriptions for companion titles) to put in module_strings.py :
    NB: I use the descriptions in an extended game note system they are not used in this code.
Code:
# Jrider + TITLES v0.3 new titles, for suffix, {reg10?-{s61}:} has been add to all titles except for king's
#  ("faction_title_male_player", "Lord {s0}"),
#  ("faction_title_male_1", "Count {s0}"),
#  ("faction_title_male_2", "Boyar {s0}"),
#  ("faction_title_male_3", "{s0} Noyan"),
#  ("faction_title_male_4", "Jarl {s0}"),
#  ("faction_title_male_5", "Count {s0}"),
#  ("faction_title_male_6", "Emir {s0}"),
#
#  ("faction_title_female_player", "Lady {s0}"),
#  ("faction_title_female_1", "Countess {s0}"),
#  ("faction_title_female_2", "Boyarina {s0}"),
#  ("faction_title_female_3", "{s0} Hatun"),
#  ("faction_title_female_4", "Grevinne {s0}"),
#  ("faction_title_female_5", "Countess {s0}"),
#  ("faction_title_female_6", "Sayeda {s0}"),

  ("faction_title_male_player", "Dominus{reg10?-{s61}:} {s0}"), # Latin
  ("faction_title_male_player_village", "Baro{reg10?-{s61}:} {s0}"),
  ("faction_title_male_player_castle", "Comes{reg10?-{s61}:} {s0}"),
  ("faction_title_male_player_town", "Dux{reg10?-{s61}:} {s0}"),
  ("faction_title_male_player_king", "Rex {s0}"),
  
  ("faction_title_male_1", "Lord{reg10?-{s61}:} {s0}"), # English
  ("faction_title_male_1_village", "Baron{reg10?-{s61}:} {s0}"),
  ("faction_title_male_1_castle", "Count{reg10?-{s61}:} {s0}"),
  ("faction_title_male_1_town", "Duke{reg10?-{s61}:} {s0}"),
  ("faction_title_male_1_king", "King {s0}"),
  
  ("faction_title_male_2", "Dvorianin{reg10?-{s61}:} {s0}"), # Russian
  ("faction_title_male_2_village", "Posadnik{reg10?-{s61}:} {s0}"),
  ("faction_title_male_2_castle", "Boyar{reg10?-{s61}:} {s0}"),
  ("faction_title_male_2_town", "Kniaz{reg10?-{s61}:} {s0}"),
  ("faction_title_male_2_king", "Korol {s0}"),

  ("faction_title_male_3", "Taishi{reg10?-{s61}:} {s0}"), # Mongol/Chinese
  ("faction_title_male_3_village", "Darga{reg10?-{s61}:} {s0}"),
  ("faction_title_male_3_castle", "Noyan{reg10?-{s61}:} {s0}"),
  ("faction_title_male_3_town", "Wang{reg10?-{s61}:} {s0}"),
  ("faction_title_male_3_king", "Khan {s0}"),

  ("faction_title_male_4", "Heera{reg10?-{s61}:} {s0}"), # Old norse/mid-norwegian
  ("faction_title_male_4_village", "Hersir{reg10?-{s61}:} {s0}"),
  ("faction_title_male_4_castle", "Jarl{reg10?-{s61}:} {s0}"),
  ("faction_title_male_4_town", "Hertogi{reg10?-{s61}:} {s0}"),
  ("faction_title_male_4_king", "Konungr {s0}"),

  ("faction_title_male_5", "Tigheam{reg10?-{s61}:} {s0}"), # Scots Gaelic
  ("faction_title_male_5_village", "Thegn{reg10?-{s61}:} {s0}"),
  ("faction_title_male_5_castle", "Iarla{reg10?-{s61}:} {s0}"),
  ("faction_title_male_5_town", "Diuc{reg10?-{s61}:} {s0}"),
  ("faction_title_male_5_king", "Righ {s0}"),

  ("faction_title_male_6", "Sayyid{reg10?-{s61}:} {s0}"), # Arabic
  ("faction_title_male_6_village", "Sheik{reg10?-{s61}:} {s0}"),
  ("faction_title_male_6_castle", "Quadi{reg10?-{s61}:} {s0}"),
  ("faction_title_male_6_town", "Mushir{reg10?-{s61}:} {s0}"),
  ("faction_title_male_6_king", "Sultan {s0}"),

  # equivalent for female character/wife and specific for landless unmarried daugther/sister
  ("faction_title_female_player", "Domina{reg10?-{s61}:} {s0}"), # Latin
  ("faction_title_female_player_village", "Baronessa{reg10?-{s61}:} {s0}"),
  ("faction_title_female_player_castle", "Comitessa{reg10?-{s61}:} {s0}"),
  ("faction_title_female_player_town", "Ducessa{reg10?-{s61}:} {s0}"),
  ("faction_title_female_player_queen", "Regina {s0}"),
  ("faction_title_female_player_unmarried", "Magistra {s0}"),

  ("faction_title_female_1", "Lady{reg10?-{s61}:} {s0}"), # English
  ("faction_title_female_1_village", "Baroness{reg10?-{s61}:} {s0}"),
  ("faction_title_female_1_castle", "Countess{reg10?-{s61}:} {s0}"),
  ("faction_title_female_1_town", "Duchess{reg10?-{s61}:} {s0}"),
  ("faction_title_female_1_queen", "Queen {s0}"),
  ("faction_title_female_1_unmarried", "Mistress {s0}"),

  ("faction_title_female_2", "Dvorianska{reg10?-{s61}:} {s0}"), # Russian 
  ("faction_title_female_2_village", "Posadnitsa{reg10?-{s61}:} {s0}"),
  ("faction_title_female_2_castle", "Boiaryna{reg10?-{s61}:} {s0}"),
  ("faction_title_female_2_town", "Kniaginia{reg10?-{s61}:} {s0}"),
  ("faction_title_female_2_queen", "Koroleva {s0}"),
  ("faction_title_female_2_unmarried", "Mestari {s0}"),

  ("faction_title_female_3", "Behi{reg10?-{s61}:} {s0}"), # Mongol/Chinese
  ("faction_title_female_3_village", "Darthun{reg10?-{s61}:} {s0}"),
  ("faction_title_female_3_castle", "Nohi{reg10?-{s61}:} {s0}"),
  ("faction_title_female_3_town", "Wathun{reg10?-{s61}:} {s0}"),
  ("faction_title_female_3_queen", "Khathun {s0}"),
  ("faction_title_female_3_unmarried", "Gongzhu {s0}"),

  ("faction_title_female_4", "Fru{reg10?-{s61}:} {s0}"), # Old norse/mid-norwegian
  ("faction_title_female_4_village", "Baronsfru{reg10?-{s61}:} {s0}"),
  ("faction_title_female_4_castle", "Greifynja{reg10?-{s61}:} {s0}"),
  ("faction_title_female_4_town", "Hertogafru{reg10?-{s61}:} {s0}"),
  ("faction_title_female_4_queen", "Drottning {s0}"),
  ("faction_title_female_4_unmarried", "Mesterinde {s0}"),

  ("faction_title_female_5", "Baintigheam{reg10?-{s61}:} {s0}"), # Scots Gaelic
  ("faction_title_female_5_village", "Bannthegn{reg10?-{s61}:} {s0}"),
  ("faction_title_female_5_castle", "Baniarla{reg10?-{s61}:} {s0}"),
  ("faction_title_female_5_town", "Bandiuc{reg10?-{s61}:} {s0}"),
  ("faction_title_female_5_queen", "Banrinn {s0}"),
  ("faction_title_female_5_unmarried", "Meistres {s0}"),

  ("faction_title_female_6", "Sayyida{reg10?-{s61}:} {s0}"), # Arabic
  ("faction_title_female_6_village", "Sheika{reg10?-{s61}:} {s0}"),
  ("faction_title_female_6_castle", "Qadiya{reg10?-{s61}:} {s0}"),
  ("faction_title_female_6_town", "Mushira{reg10?-{s61}:} {s0}"),
  ("faction_title_female_6_queen", "Sultana {s0}"),
  ("faction_title_female_6_unmarried", "Maulana {s0}"),
# Jrider -
Code:
# Jrider + TITLES v0.0 specialization strings, you can put these at the end of the file
  ("hero_titles_none", "Hero {s0}"),
  ("hero_titles_diplomat", "Missi {s0}"),
  ("hero_titles_tactician", "Tassein {s0}"),
  ("hero_titles_scout", "Ausculare {s0}"),
  ("hero_titles_physician", "Fisique {s0}"),
  ("hero_titles_trader", "Empori {s0}"),
  ("hero_titles_party", "Palantinus {s0}"),

  ("hero_specdesc_none", "none"),
  ("hero_specdesc_diplomat", "Diplomacy (Persuasion)"),
  ("hero_specdesc_tactician", "Tactical matters (Tactics, Engineer and Trainer)"),
  ("hero_specdesc_scout", "Scouting (Spotting, Tracking and Path finding)"),
  ("hero_specdesc_physician", "Healing (Wound treatment, Surgery and First aid)"),
  ("hero_specdesc_trader", "Trade (Trading, Looting and Foraging)"),
# Jrider -
# Jrider + TITLES v0.3 relation to ruler suffix, you can put these at the end of the file
  ("ruler_relation_mnus_100_ns", "vindicta"), # -100 Vengeful
  ("ruler_relation_mnus_80_ns",  "ultio"), # -80 Vengeful/revengeful
  ("ruler_relation_mnus_60_ns",  "invisus"), # -60 Hateful
  ("ruler_relation_mnus_40_ns",  "dolor"), # -40 Resentful
  ("ruler_relation_mnus_20_ns",  "fremo"), # -20 Grumbling
  ("ruler_relation_plus_0_ns",   "placeholder shouldn't appear"),# 0...19
  ("ruler_relation_plus_20_ns",  "consensio"), # cooperative
  ("ruler_relation_plus_40_ns",  "faveo"), # supportive
  ("ruler_relation_plus_60_ns",  "pius"), # gracious
  ("ruler_relation_plus_80_ns",  "confero"), # devoted
# Jrider -

  • New scripts to put in module_scripts.py (v0.3.3 change)
Code:
# Jrider + Begin new scripts
  # TITLES v0.3.3 #####
  # script troop_set_title_according_to_faction_gender_and_lands
  # calculate and set new title for lords, ladies and companions
  # use s0 and s1
  # change v0.3: use s61 and reg10
  ("troop_set_title_according_to_faction_gender_and_lands",
  [        
      (store_script_param, ":troop_no", 1),
      (store_script_param, ":faction_no", 2),

      # Ensure we process only npcs member of a kingdom, including player
      (try_begin), # Npcs serving as lord and ladies
          # v0.1 change +
          (is_between, ":faction_no", kingdoms_begin, kingdoms_end), # normaly this one should exclude companions that are not vassals
          (neg|is_between, ":troop_no", pretenders_begin, pretenders_end), # exclude pretenders
          (this_or_next|is_between, ":troop_no", active_npcs_begin, kingdom_ladies_end), # v0.3.1 change to include player
          (eq, ":troop_no", "trp_player"), # include player player # v0.3.1 change
#          (neq, ":troop_no", "trp_player"), # exclude player # v0.3.1 commented, wasn't relevant anyway

          (faction_get_slot, ":faction_leader", ":faction_no", slot_faction_leader),
          (str_store_troop_name_plural, s0, ":troop_no"),
          # v0.1 change -
          # External computation blocks
          # Get Gender
          (troop_get_type, ":gender", ":troop_no"),
          # NPC's largest fief (works for male and female, compute spouse fief as well)
          # 1 no fief, 2 village, 3 castle, 4 town
          (assign, ":largest_fief", 0),
          (try_for_range, ":cur_center", centers_begin, centers_end),
                (troop_get_slot, ":spouse_no", ":troop_no", slot_troop_spouse),
                (neq, ":troop_no", ":faction_leader"), # exclude research for ruler
                (neq, ":spouse_no", ":faction_leader"), # exclude research for ruler's wife
                (lt, ":largest_fief", 3),
                (party_slot_ge, ":cur_center", slot_town_lord, 0),
                (this_or_next|party_slot_eq, ":cur_center", slot_town_lord, ":spouse_no"),
                (party_slot_eq, ":cur_center", slot_town_lord, ":troop_no"),

                (try_begin),
                  (party_slot_eq, ":cur_center", slot_party_type, spt_town),
                  (lt, ":largest_fief", 3),
                  (assign, ":largest_fief", 3),
                (else_try),
                  (party_slot_eq, ":cur_center", slot_party_type, spt_castle),
                  (lt, ":largest_fief", 2),
                  (assign, ":largest_fief", 2),
                (else_try),
                  (party_slot_eq, ":cur_center", slot_party_type, spt_village),
                  (lt, ":largest_fief", 1),
                  (assign, ":largest_fief", 1),
                (try_end),
          (try_end),

          # base title(s) computation blocks
          # Determine NPCs quality in order of importance
          # for male NPCs: 4 Ruler, 3 town, 2 castle, 1 village, 0 landless
          # for female NPCs: 5 unmarried (kingdom lady only), 4 queen, 3 wife or town, 2 wife or castle, 1 wife or village, 0 wife or landless
          (assign, ":quality", 0),
          (try_begin), # Male npcs
               (eq, ":gender", 0),
               (try_begin),
                   (eq, ":troop_no", ":faction_leader"), # is king
                   (assign, ":quality", 4),
               (else_try),
                   (assign, ":quality", ":largest_fief"),
               (try_end),
          (else_try), # Female npcs, a bit more complex queen, landowner, companions without a fief,
               (try_begin), # wife of faction leader
                    # v0.3.3 change +
                    (this_or_next|troop_slot_eq, ":troop_no", slot_troop_spouse, ":faction_leader"),
                    (eq, ":troop_no", ":faction_leader"), # is queen
                    # v0.3.3 change -
                    (assign, ":quality", 4),
               (else_try), # is a landowner - index 1 to 3
                    (gt, ":largest_fief", 0),
                    (assign, ":quality", ":largest_fief"),
               (else_try), # a companion vassal without fief
                    (is_between, ":troop_no", companions_begin, companions_end),
                    (assign, ":quality", 0),
               (else_try), # married lady whose husband has no fief
                    (troop_slot_ge, ":troop_no", slot_troop_spouse, 0),
                    (assign, ":quality", 0),
               (else_try), # unmarried lady without fief
                    (assign, ":quality", 5),
               (try_end),
          (try_end),

          # v0.3 changes +
          # compute troop relation to ruler suffix
          (try_begin),
              (neq, ":troop_no", ":faction_leader"), # exclude from suffix if king v0.3.2 change
              (call_script, "script_troop_get_relation_with_troop", ":troop_no", ":faction_leader"),
              (assign, ":relation", reg0),
              (str_clear, s61),
              (assign, reg10, 0),
              (try_begin), # update reg10
                (this_or_next|gt, ":relation", 19),
                (lt, ":relation", -19),
                (assign, reg10, ":relation"),
                (store_add, ":normalized_relation", ":relation", 100),
                (store_div, ":str_offset", ":normalized_relation", 20),
                (val_clamp, ":str_offset", 0, 10), # does 10 work ? only 10 strings in there
                (store_add, ":str_rel_id", "str_ruler_relation_mnus_100_ns",  ":str_offset"),
                (str_store_string, s61, ":str_rel_id"),
              (try_end),
          (else_try), # clear register and string
              (str_clear, s61),
              (assign, reg10, 0),      
          (try_end),
          # v0.3 changes -

          # Find title index in strings block
          (store_sub, ":title_index", ":faction_no", kingdoms_begin), # 0 player, 1 swadian ...
          (try_begin), #male, 5 title entries
                (eq, ":gender", 0), 
                (val_mul, ":title_index", 5),
                (val_add, ":title_index", kingdom_titles_male_begin),
          (else_try), # female, 6 title entries
                (val_mul, ":title_index", 6),
                (val_add, ":title_index", kingdom_titles_female_begin),
          (try_end),
          (val_add, ":title_index", ":quality"),

          # Set title and party name block
          # assign title
          (str_store_string, s1, ":title_index"),
          (troop_set_name, ":troop_no", s1),
          # rename party
          (troop_get_slot, ":troop_party", ":troop_no", slot_troop_leaded_party),
          (try_begin), 
          # v0.2 change to prevent opcode error
            (gt, ":troop_party", 0),
            (str_store_troop_name, s5, ":troop_no"),
            (party_set_name, ":troop_party", "str_s5_s_party"),
          (try_end), # v0.2 change
      (try_end),

      # Special titles for companions not used as vassals
      (try_begin),
          (neg|eq, ":faction_no", "fac_player_supporters_faction"), # v0.2 change
          (neg|troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero), # v0.3 change, exclude companion if he became a kingdom lord
          (is_between, ":troop_no", companions_begin, companions_end),
          # Store the plural name
          (str_store_troop_name_plural, s0, ":troop_no"),
          # Set the title
          (try_begin), # Male npcs
               (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_player_companion),
               (str_store_string, s1, "str_hero_titles_party"),
          (else_try),
              (call_script, "script_get_troop_specialisation", ":troop_no", ":faction_no"),
              (assign, ":title_index", reg0),
              (val_add, ":title_index", hero_titles_begin),
              (str_store_string, s1, ":title_index"),
          (try_end),
          # assign title
          (troop_set_name, ":troop_no", s1),
      (try_end),
  ]),

  # Script get_troop_specialisation
  # Assess companion current skills to find the strongest trend
  ("get_troop_specialisation",
   [
        (store_script_param, ":troop_no", 1),
        (store_script_param, ":faction_no", 2),
        (try_begin),
           (neg|eq, ":faction_no", "fac_player_supporters_faction"), # v0.2 change
           (is_between, ":troop_no", companions_begin, companions_end),
           # Other titles according to function in group
           # Scout (Ausculare) - PathFinding, Tracking and Spotting
           (store_skill_level, ":scout", "skl_spotting", ":troop_no"),
           (store_skill_level, ":scout_skill", "skl_pathfinding", ":troop_no"),
           (val_add, ":scout", ":scout_skill"),
           (store_skill_level, ":scout_skill", "skl_tracking", ":troop_no"),
           (val_add, ":scout", ":scout_skill"),
  
           # Physician (Fisique) - Wound Treatment, Surgery, First Aid
           (store_skill_level, ":physician", "skl_wound_treatment", ":troop_no"),
           (store_skill_level, ":physician_skill", "skl_first_aid", ":troop_no"),
           (val_add, ":physician", ":physician_skill"),
           (store_skill_level, ":physician_skill", "skl_surgery", ":troop_no"),
           (val_add, ":physician", ":physician_skill"),

           # Tactician (Tassein) - Tactics, Engineer, Trainer
           (store_skill_level, ":tactician", "skl_tactics", ":troop_no"),
           (store_skill_level, ":tactician_skill", "skl_engineer", ":troop_no"),
           (val_add, ":tactician", ":tactician_skill"),
           (store_skill_level, ":tactician_skill", "skl_trainer", ":troop_no"),
           (val_add, ":tactician", ":tactician_skill"),

           # Trader (Empori) - Trade Looting, Foraging (foraging is a new skill I'm working on)
           (store_skill_level, ":trader", "skl_trade", ":troop_no"),
           (store_skill_level, ":trader_skill", "skl_looting", ":troop_no"),
           (val_add, ":trader", ":trader_skill"),
           #(store_skill_level, ":trader_skill", "skl_foraging", ":troop_no"), # uncomment if using foraging
           #(val_add, ":trader", ":trader_skill"), # uncomment if using foraging
           (val_mul, ":trader", 3), # comment if using foraging
           (val_div, ":trader", 2), # comment if using foraging

           # Diplomat (Missi) - Persuasion
           (store_skill_level, ":diplomat", "skl_persuasion", ":troop_no"),
           (val_mul, ":diplomat", 3),

           (try_begin), # Just your basic hero
               (eq, ":diplomat", 0),
               (eq, ":tactician", 0),
               (eq, ":scout", 0),
               (eq, ":physician", 0),
               (eq, ":trader", 0),
               (assign, reg0, 0),
           (else_try), # Diplomat - skilled in Persuasion and Trainer
               (gt, ":diplomat", 0),
               (ge, ":diplomat", ":tactician"),
               (ge, ":diplomat", ":scout"),
               (ge, ":diplomat", ":physician"),
               (ge, ":diplomat", ":trader"),
               (assign, reg0, 1),
           (else_try), # Tactician - skilled in Tactics and Engineer
               (gt, ":tactician", 0),
               (ge, ":diplomat", ":scout"),
               (ge, ":diplomat", ":physician"),
               (ge, ":diplomat", ":trader"),
               (assign, reg0, 2),
           (else_try), # Scout - skilled in Spotting, Tracking and Pathfinding
               (gt, ":scout", 0),
               (ge, ":diplomat", ":physician"),
               (ge, ":diplomat", ":trader"),
               (assign, reg0, 3),
           (else_try), # Physician - skilled in Wound Treatment, Surgery and First Aid
               (gt, ":physician", 0),
               (ge, ":physician", ":trader"),
               (assign, reg0, 4),
           (else_try), # Trader - skilled in Trade
               (gt, ":trader", 0),
               (assign, reg0, 5),
           (try_end),
        (try_end),
   ]),

  • The module_info_pages.py entry, if you want the historical background :
Code:
# Jrider + TITLES v0.0 titles descriptions
 ("nobility_titles", "Nobility Titles",
"Titles vary from kingdom to kingdom the most common interpretation is:^\
King (ruler): ^  Rex, King, Korol, Khan, Konungr, Righ, Sultan^^\
Duke (lord of a town): ^\
A duke is, historically, of highest rank below the monarch, and historically controlling a duchy. The title comes from the Latin Dux Bellorum, a term that ancient Roman chroniclers used to describe tribal Germanic and Celtic war leaders.^\
In the Middle Ages the title signified first among the Germanic monarchies. Dukes were the rulers of the provinces and the superiors of the counts in the cities and later, in the feudal monarchies, the highest-ranking peers of the king.^\
  Dux, Duke, Kniaz, Wang, Hertogi, Diuc, Mushir^^\
Earl/Count (lord of a castle): ^\
Earl was the Anglo-Saxon form and jarl the Scandinavian form of a title meaning \"chieftain\" and referring especially to chieftains set to rule a territory in a king's stead. In Scandinavia, it became obsolete in the Middle Ages and was replaced with duke (hertig/hertug); in later medieval Britain, it became the equivalent of the continental count.^\
  Comes, Count, Boyar, Noyan, Jarl, Iarla, Quadi^^\
Baron (lord of a village): ^\
The word baron comes from Old French baron, itself from Old High German and Latin (liber) baro meaning \"(free) man, (free) warrior\"; it merged with cognate Old English beorn meaning \"nobleman\".^\
  Baro, Baron, Posadnik, Darga, Hersir, Thegn, Sheik^^\
Lord (landless noble): ^\
The etymology of the word can be traced back to the Old English word 'hlaford' which originated from 'hlafweard' meaning 'bread keeper' or 'loaf-ward', reflecting the Germanic tribal custom of a chieftain providing food for his followers.^\
  Dominus, Lord, Dvorianin, Taishi, Heera, Tigheam, Sayyid^^\
The female equivalents are (whether they own the land themselves or hold the title from their husband's):^\
Queen: ^  Regina, Queen, Koroleva, Khathun, Drottning, Banrinn, Sultana^^\
Duchess: ^  Ducessa, Duchess, Kniaginia, Wathun, Hertogafru, Bandiuc, Mushira^^\
Countess: ^  Comitessa, Countess, Boiaryna, Nohi, Greifynja, Baniarla, Qadiya^^\
Baroness: ^  Baronessa, Baroness, Posadnitsa, Darthun, Baronsfru, Bannthegn, Sheika^^\
Lady: ^  Domina, Lady, Dvorianska, Behi, Fru, Baintigheam, Sayyida^^\
In addition unmarried, landless daugthers (or sisters) are named as follow:^\
  Magistra, Mistress, Mestari, Gongzhu, Mesterinde, Meistres, Maulana^^\
The titles come from Latin, English, Russian, Mongol (or chinese), Old Norse (or mid-norwegian), Scots Gaelic and Arabic.^^\
Mongol titles should have the name placed before the title (not the case here for sorting considerations in the notes), female equivalents for the title were unavailable for most of the titles and were made up.^^\
Companions currently in the party are titled Palatinus.^\
The members of the Imperial Guard were named after Palatine Hill, the mythical founding place of Rome. On the same hill lived the members of the older of two schools of the ancient Salii brotherhood of God of War Mars, which had some symbolism in common with that of the imperial palace. Military training schools were the scholae, and the Imperial Guard was called Scholae Palatinae.^It was a personal army that the emperor was allowed to use personally on campaigns.^^\
Other companions who are not vassals are titled as Hero if they don't have any specialty, otherwise:^\
  Missi : best suited for diplomacy.^\
  Tassein : has a good knowledge of tactical related skills, including engineering and training.\
  Ausculare : a master of scouting through the use of tracking, spotting and path-finding.^\
  Fisique : inclined toward the healing arts of surgery, first aid and wound treatment.^\
  Empori : goods management, either through trade, looting or foraging."),
# Jrider -
for suffix added in v0.3 :
Code:
# Jrider + TITLES v0.3 title's suffixed description
 ("titles_suffix", "Titles's suffix",
  "In order to reflec a lord's (or lady's) relation with his liege, a suffix is added to his title (used generic latin suffixes), from worse to best:^\
  negative suffixes: vindicta, ultio, invisus, dolor, fremo^\
  positive suffixes: consensio, faveo, pius, confero"),
# Jrider -

... out of available space, hooks and native code modifications are described in post #6 (http://forums.taleworlds.com/index.php/topic,129691.msg3128066.html#msg3128066)
 

SPD_Phoenix

Master Knight
Best answers
0
Something that I plan to add to my personal mod in the future but haven't got much time to think about it yet. Thanks for all the hard work.

Similarly, I would like to add some custom suffix in the future. Something like "Baron Rolf the Cunning" ... Base on the npc personally and some other factor which decide whether the npc get the suffix or not. May be I would use the suffix for non vassal companions. Adding a little flavor to the game.
 

Panzercracker

Sergeant at Arms
Best answers
0
I tried this kit, it work for original lords, but player faction lords still keep "Lord/Lady/Tribune'. Where I missed?
 

jrider

Veteran
WB
Best answers
0
recycling this post since I'm out of space in in original one (and forgot to reserve one, honestly I didn't think I would be so verbose  :shock: ), this describes the hooks and native code modifications:

now, to make this work you also need to modify the following in the native code (code changes and call hooks), I reorderd the modifications according to their placement in native code :

in module_dialogs.py, insert the tagged code in the member_separate_yes dialog entry to update the companion title with skills when he leaves the party (not by becoming a vassal, he becomes a standard lord in that case) :
Code:
  [anyone,"member_separate_yes", [
      ], "Well. I'll be off, then. Look me up if you need me.", "close_window",
   [
            (troop_set_slot, "$g_talk_troop", slot_troop_occupation, 0),
            (troop_set_slot, "$g_talk_troop", slot_troop_playerparty_history, pp_history_dismissed),
            (remove_member_from_party, "$g_talk_troop"),

            # Jrider + TITLES v 0.2, change companion title back to unattached one(s) when he/she leaves the party
            (store_troop_faction, ":faction_no", "$g_talk_troop"),
            (call_script, "script_troop_set_title_according_to_faction_gender_and_lands", "$g_talk_troop", ":faction_no"),
            # Jrider -
       ]],

still in module_dialogs.py comment the following in the member_fief_grant_3 to avoid companion title override when initially giving them a fief :
Code:
          # Jrider + TITLES v0.2 comment to avoid overwrite of new title
  #        (str_store_troop_name_plural, s12, "$g_talk_troop"),
  #        (troop_get_type, ":is_female", "$g_talk_troop"),
  #        (try_begin),
  #            (eq, "$g_talk_troop", "trp_npc10"),
  #            (str_store_string, s14, "str_tribune_s12"),
  #        (else_try),
  #            (eq, ":is_female", 1),
  #            (str_store_string, s14, "str_lady_s12"),
  #        (else_try),    
  #            (str_store_string, s14, "str_lord_s12"),
  #        (try_end),
  #        (troop_set_name, "$g_talk_troop", s14),
          # Jrider -

in module_scripts.py:
to initialize the new titles when starting a new game, add this at the end of the game_start script:
Tip: if you want to bootstrap the titles in an existing savegame, I suggest also adding this code at the end of the game_reset_player_party_name script so that it can be executed when you manually change the player name from the character sheet.
Code:
      # Jrider + TITLES v0.0, init new titles
      (try_for_range, ":troop_no", active_npcs_begin, kingdom_ladies_end),
      (store_troop_faction, ":faction_no", ":troop_no"),
      (call_script, "script_troop_set_title_according_to_faction_gender_and_lands", ":troop_no", ":faction_no"),
      (try_end),
      # Jrider -

to enable player to have a title and update it when changing player's name, add the tagged line in the  script :
NB: remember to remove any existing title when changing the name since the value is used as the new plural for player.
Code:
  ("game_reset_player_party_name",
  [(str_store_troop_name, s5, "trp_player"),
    # Jrider + TITLES v0.3.1 update player's plural name then his title
    (troop_set_plural_name, "trp_player", s5),
    (call_script, "script_troop_set_title_according_to_faction_gender_and_lands", "trp_player", "$players_kingdom"),
    (str_store_troop_name, s5, "trp_player"),
    # Jrider -
   
    (party_set_name, "p_main_party", s5), 

    # Jrider + TITLES v0.0 DEBUG init new titles - bootstrap for midgame updates, uncomment if you want to manually update midgame
    #(try_for_range, ":troop_no", active_npcs_begin, kingdom_ladies_end),
    #    (store_troop_faction, ":faction_no", ":troop_no"),
    #    (call_script, "script_troop_set_title_according_to_faction_gender_and_lands", ":troop_no", ":faction_no"),
    #(try_end),
    # Jrider -     
     ]),

to set the new title when a lord defects or is indicted, in the change_troop_faction script, comment the following (this is to take into account his new lands of lack of thereof):
Code:
      # Jrider + TITLES v0.0 moving this to end of script to compute according to new holdings
      #Give new title
      #(call_script, "script_troop_set_title_according_to_faction", ":troop_no", ":faction_no"),
      # Jrider -

and still in the same script, move the "#Dependant kingdom ladies switch faction" block after the "#Remove his control over villages under another fortress" block and add these a bit lower (added code tagged) to set the title and update his/her wife/husband and dependant ladies (i.e. daughters and sisters) :
Code:
      # Jrider + TITLES v0.0 Give new title
      (call_script, "script_troop_set_title_according_to_faction", ":troop_no", ":faction_no"),
      # Jrider -

      #Dependant kingdom ladies switch faction
      (try_for_range, ":kingdom_lady", kingdom_ladies_begin, kingdom_ladies_end),
        (call_script, "script_get_kingdom_lady_social_determinants", ":kingdom_lady"),
        (assign, ":closest_male_relative", reg0),
        (assign, ":new_center", reg1),
        (eq, ":closest_male_relative", ":troop_no"),
        (troop_set_faction, ":kingdom_lady", ":faction_no"),
        # Jrider + TITLES v0.0 change ladies title
        (call_script, "script_troop_set_title_according_to_faction", ":kingdom_lady", ":faction_no"),
        # Jrider -
        (troop_slot_eq, ":kingdom_lady", slot_troop_prisoner_of_party, -1),
        (troop_set_slot, ":kingdom_lady", slot_troop_cur_center, ":new_center"),
      (try_end),

to reduce native code changes, we replace the content of the standard troop_set_title_according_to_faction script, comment everything inside the try_begin block (not including it) and add the call to the new script :
Code:
           (call_script, "script_troop_set_title_according_to_faction_gender_and_lands", ":troop_no", ":faction_no"),

to update when a lord is given a new fief, insert the following code (tagged changes) at the end of the give_center_to_lord script (v0.3.3 change) :
Code:
       # Jrider + TITLES v0.3.3 update title, fixed opcode error for spouse when you don't assign the center
       (call_script, "script_troop_set_title_according_to_faction_gender_and_lands", ":lord_troop_id", ":lord_troop_faction"),
       # Update his wife/husband too if the lord has one
       (try_begin),
         (ge, ":lord_troop_id", 0), # v0.3.3 fix
         (troop_slot_ge, ":lord_troop_id", slot_troop_spouse, 0),
         (troop_get_slot, ":lord_spouse_troop_id", ":lord_troop_id", slot_troop_spouse),
         (call_script, "script_troop_set_title_according_to_faction_gender_and_lands", ":lord_spouse_troop_id", ":lord_troop_faction"),
       (try_end),        
       # Jrider -     

to update title (and player's vassals) with the relation suffix, insert the tagged line in the change_player_relation_with_troop script just before try_begin block with the display_message calls (v0.3.2 change) :
Code:
        # Jrider + TITLES v0.3.2 update both player and troop titles
        (try_begin),
            (store_troop_faction, ":troop_faction", ":troop_no"),
            (eq, ":troop_faction", "$players_kingdom"),
            (call_script, "script_troop_set_title_according_to_faction_gender_and_lands", "trp_player", "$players_kingdom"),
            (call_script, "script_troop_set_title_according_to_faction_gender_and_lands", ":troop_no", "$players_kingdom"),
        (try_end),
        # Jrider -

to change to companion title when he joins the party, add this at the end of the recruit_troop_as_companion script :
Code:
        # Jrider + TITLES v0.0 change companion title
        (store_troop_faction, ":faction_no", ":troop_no"),
        (call_script, "script_troop_set_title_according_to_faction_gender_and_lands", ":troop_no", ":faction_no"),
        # Jrider -

to update player's title (and his spouse), when joining a faction, modify the following blocks in the player_join_faction script :
Code:
      (try_begin),
        (troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
        (is_between, ":spouse", kingdom_ladies_begin, kingdom_ladies_end),
        (troop_set_faction, ":spouse", "$players_kingdom"),
        # Jrider + TITLES v 0.3.1 change spouse title according to new faction
        (call_script, "script_troop_set_title_according_to_faction_gender_and_lands", ":spouse", "$players_kingdom"),
        # Jrider -
      (try_end),
Code:
      #remove prisoners end.

      #(call_script, "script_store_average_center_value_per_faction"),
      # Jrider + TITLES v 0.3.1 set player new title
      (call_script, "script_troop_set_title_according_to_faction_gender_and_lands", "trp_player", "$players_kingdom"),
      # Jrider -
      (call_script, "script_update_all_notes"),

similarly, to update player's title (and his spouse), when leaving a faction, modify the following blocks in the player_leave_faction script :
Code:
      (try_begin),
        (troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
        (is_between, ":spouse", kingdom_ladies_begin, kingdom_ladies_end),
        (troop_set_faction, ":spouse", "fac_player_supporters_faction"),
        # Jrider + TITLES v 0.3.1 change spouse title according to new faction
        (call_script, "script_troop_set_title_according_to_faction_gender_and_lands", ":spouse", "fac_player_supporters_faction"),
        # Jrider -
      (try_end),
Code:
      (try_end),

      # Jrider + TITLES v 0.3.1 set player new title
      (call_script, "script_troop_set_title_according_to_faction_gender_and_lands", "trp_player", "fac_player_supporters_faction"),
      # Jrider -
      (call_script, "script_update_all_notes"),
      (assign, "$g_recalculate_ais", 1),

to set player's title when he taken his first town as an independant faction, add the tagged lines near the end of the activate_player_faction script just above the call to update_all_notes (v0.3.2 change) :
Code:
    ## Jrider + TITLES v0.3.2 set new player faction liege title
    (call_script, "script_troop_set_title_according_to_faction_gender_and_lands", ":liege", "fac_player_supporters_faction"),
    ## Jrider -
    (call_script, "script_update_all_notes"),

to reflect relation changes to the liege (player or otherwise) in the suffix, insert tagged lines in the troop_change_relation_with_troop script just before the cheat block (v0.3.2 change) :
Code:
        # Jrider + TITLES v0.3.2 update title for relation suffix
        (try_begin),
            (store_troop_faction, ":troop1_faction", ":troop1"),
            (store_troop_faction, ":troop2_faction", ":troop2"),
            (faction_get_slot, ":troop1_faction_leader", ":troop1_faction", slot_faction_leader),
            (eq, ":troop1_faction", ":troop2_faction"),
            (eq, ":troop2", ":troop1_faction_leader"),
            (call_script, "script_troop_set_title_according_to_faction_gender_and_lands", ":troop1", ":troop1_faction"),
        (try_end),
        # Jrider -

to update title after a wedding, modify the following near the end of the courtship_event_bride_marry_groom script :
Code:
    (else_try),
        (eq, ":groom", "trp_player"),
        (troop_set_faction, ":bride", "$players_kingdom"),
        # Jrider + TITLES v0.0 change title of bride, according to player faction
        (call_script, "script_troop_set_title_according_to_faction", ":bride", "$players_kingdom"),
        # Jrider -
    (else_try),
        (troop_set_faction, ":bride", ":groom_faction"),
        # Jrider + TITLES v0.0 change title of groom and bride, according to player faction
        (call_script, "script_troop_set_title_according_to_faction", ":groom", ":groom_faction"),
        (call_script, "script_troop_set_title_according_to_faction", ":bride", ":groom_faction"),
        # Jrider -
    (try_end),
 

jrider

Veteran
WB
Best answers
0
caprera said:
Could it be linked to a relation value at the same time ?
sure,

I assume that would be for relation to ruler, right ?

you can either mix it in the quality computation to determine the title index (you would need to add extra titles in the strings in order to have it still understandable at a glance) or maybe add a relation string as prefix (or suffix if you want to keep the order in the notes, in that case the title strings construction should be modified in module_strings.py) the title either standard (ie. Loyal Duke, Hateful Baron, etc.) or personalized (Grand Duke, Sub Baron).

that second solution is probably the easiest, you'll need a set of strings to link prefix to reputation value range (existing ones or new ones if you want to keep the title more in character) and a bit of code to clip the value to the nearest prefix (the way the relation toward you strings are handled for the characters game notes)

you'll need to add a few more hooks in the native code too after the relation is modified , internal faction politics has a least 3 scripts that I can think of (though there's probably more hidden here and there):
cf_random_political_event,
battle_political_consequences,
give_center_to_lord

and some hooks in dialogs too if the player is the liege.

finally, since you would be adding this to new places, you'd have to make sure the global registers and strings used in the script wouldn't interfere with the one used in that context (main script use s0 and s1).

quick and dirty (no dialog hook and no check for global register and string incompatibility):

Edit: removed code, since I included this in main posts 
 

caprera

Squire
Best answers
0
Ok thanks, but what about a mix of the two ? I mean having titles for relation AND for merits.  In my mod i need the player as well as other lords to be nominated in different military ranks that have a direct effect on recruitment. Then again titles should also activate a script for the settlement to be created and so on with others...
 

jrider

Veteran
WB
Best answers
0
caprera said:
Ok thanks, but what about a mix of the two ? I mean having titles for relation AND for merits.  In my mod i need the player as well as other lords to be nominated in different military ranks that have a direct effect on recruitment. Then again titles should also activate a script for the settlement to be created and so on with others...
well, if you want a second separate title, the principle is the same, you can simply
  • add a set of military titles strings (plain ones),
  • add a new computation for rank (similar to the one for quality, first one should be 0),
  • add a rank string search similar to the one based on quality
  • if you don't use faction specific ranks, initialize the index to 0 and simply add the rank value (skip the store_sub and male/female multiplication)
  • if you use faction specific ranks, be sure to have the same number of entries in each and multiply by that (instead of male/female).
  • assign the result to a temporary storage string like I did above for the suffix in s61
since otherwise this is only cosmetic, don't forget to store each title (quality and rank, before adding the base string index would be the logical way to go) to it's own troop slot to reuse during gameplay.

NB: note that in my script I specifically exclude the player, haven't played with it too much since it's handled in a different manner using a global variable and didn't dig too much into the code yet to see if the plural form of the name was updated so that you have an uncorrupted form of the name available.
 

jrider

Veteran
WB
Best answers
0
hm, perhaps I should lay out a breakdown of the way this works, will be simpler than reading the code if you want to adapt it, here goes :

[list type=decimal]
[*]basic conditions to check troop is eligible for title (faction, lords, ladies and such)
[*]store the plural form of the troop name (for named characters this one is never modified thus providing the uncorrupted base character name, player is handled differently so you may have to create a global to store the uncorrupted form and insert that somewhere in the start game menus).
[*]External computation block for the conditions to be used to attribute the rank (example: biggest fief in my original code)
[*]Rank calculation block (which translate to the index of the rank string starting at 0)
[*]find the corresponding string index in the module_strings.py
[*]build the new character name string using that string index
[*]replace the old character name by the new one
[*]rename the character's party (if he has one) according to its new name.
[/list]steps 3 and 4 can be done several times for as many titles as you need
step 6 can mix the result of the various 3 & 4 steps' blocks (if you made several)

keeping the rank value for other things should use the one computed in step 4 to stay generic (unless you love long try_begin/else_try blocks or want to make something unique for each rank).

and one important last thing, even if you have only one condition keep the whole thing into a try_begin/try_end block (except for the script parameters and common stuff that can be derived from them).
 

GetAssista

Baron
M&BWF&SWB
Best answers
1
Nice piece of code.

And moreover, this is the exemplar way to make first post on the forum!  Kudos
If only other recruits were like you :smile:
 

Panzercracker

Sergeant at Arms
Best answers
0
Only some problem give fief for NPCs to become faction lords, I gave them village/town/castle, they just keep only 1 tile: "Domina"/'Dominus" - basic player faction title, not any higher title like Dux v.v...
 

SPD_Phoenix

Master Knight
Best answers
0
Panzercracker said:
Only some problem give fief for NPCs to become faction lords, I gave them village/town/castle, they just keep only 1 tile: "Domina"/'Dominus" - basic player faction title, not any higher title like Dux v.v...
Need some code in module_dialogs where vassal receive fief to check for all fiefs belong to the recipient then change the title according to the highest fief he/she own.
 

jrider

Veteran
WB
Best answers
0
Thanks GetAssista :smile:

Panzercracker, with the v0.2 change it was working for me, sure you've applied all the changes (in dialog, the call to the give_center_to_lord script takes care of the title change after granting a fief) ?

And while I'm posting, I updated (and split since I'm already over the 40000 chars limit) the original post to include the change for title suffixes and enable player to hold title, added version strings in all the bits of code and reordered the hooks and modification so they occur in the order the place they apply to appears in the native code.
 

Panzercracker

Sergeant at Arms
Best answers
0
I applied all your kit even v2.0 but no change, and after applied v3.1, this is what I got
  Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data...
Exporting scripts...
ERROR: Usage of unassigned local variable: :faction_leader
ERROR: Usage of unassigned local variable: :eek:ld_lord_troop_id
ERROR: Usage of unassigned local variable: :lord_troop_id
ERROR: Usage of unassigned local variable: :lord_troop_faction
ERROR: Usage of unassigned local variable: :lord_troop_id
ERROR: Usage of unassigned local variable: :lord_troop_id
ERROR: Usage of unassigned local variable: :lord_troop_faction
ERROR: Usage of unassigned local variable: :faction_leader
ERROR: Usage of unassigned local variable: :center_no
ERROR: Usage of unassigned local variable: :lord_troop_id
ERROR: Usage of unassigned local variable: :lord_troop_faction
ERROR: Usage of unassigned local variable: :lord_troop_id
Exporting mission_template data...
Exporting game menus data...
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .
 

jrider

Veteran
WB
Best answers
0
hm, looks like you misplaced the block that goes into give_center_to_lord, that the only script where the local ":eek:ld_lord_troop_id" is used (all the unassigned you get are from that block).

be sure to insert only the tagged code (between the "# Jrider +" and  "# Jrider -" comments), the rest is just there to provide the insertion context.

concerning the non upgrade title, there's a slight mistake yes, the insert in give_center_to_lord is before the center is assigned ! (guess that was covered by other calls I had from the intermediary v0.3

move the tagged block at the end of the script and you should be fine.

I posted some additional changes to the OP and the secondary hook post, labeled as 0.3.2 (removed older tagged in main text so you can get the latest changes more easily).

 

Panzercracker

Sergeant at Arms
Best answers
0
Thank jrider, it work good for NPC now, but my character even become empress of my kingdom, her title is just Magistra not Regina.