Мод для Mount& Blade Warband


Меню сайта

Пользователь

Статистика
________________
Статистика
Всего: 99
За месяц: 2
За неделю: 0
Вчера: 0
Сегодня: 0
Из них
Администраторов: 5
Гл.Модераторов: 3
Модераторов:
Дизайнеров:
Журналистов:
V.I.P:
Постоянных: 0
Проверенных: 6
Забаненых: 0
Обычных юзеров:
Из них
Парней: 90
Девушек: 8

________________
Кто онлайн:
________________
Нас посетили:

Наша группа

[ Новые сообщения · Участники · Правила форума · Поиск · RSS ]
Страница 1 из 11
Форум AD 1200 » Помощь по созданию собственного мода » Инструментарий » [WB, SP, MS, Code] Изменяемые титулы лордов
[WB, SP, MS, Code] Изменяемые титулы лордов
Lod_GveidonДата: Среда, 07.12.2011, 10:56 | Сообщение # 1
 Lod_Gveidon
Offline
Изменяемые титулы лордов

1. Добавляем в module_constants.py
Code
# Jrider + for Heroes specialization titles and descriptions
hero_titles_begin = "str_hero_titles_none"
hero_specdesc_begin = "str_hero_specdesc_none"
# Jrider -

2. Добавляем в module_strings.py :
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 -

# 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 -
Lod_GveidonДата: Среда, 07.12.2011, 10:57 | Сообщение # 2
 Lod_Gveidon
Offline
3. Добавляем в module_scripts.py
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),
    ]),
ЧешипузикДата: Четверг, 22.12.2011, 06:18 | Сообщение # 3
 Чешипузик
Offline
а если попробовать сделать изменяемую фамили..нет даже прозвище к имени скорее. По лучшему из владений. То есть Никола Питерский к примеру smile еси он владеет таким городом smile Чтобы было ясно кто с каких земель из лордов встречанных smile
Маловажная конечно фишка, но прикольная wink
Форум AD 1200 » Помощь по созданию собственного мода » Инструментарий » [WB, SP, MS, Code] Изменяемые титулы лордов
Страница 1 из 11
Поиск:
Новый ответ
Имя:
Текст сообщения:
Опции сообщения:
Код безопасности: