Is there a way to assign a different world-map banner shape to towns and to armies?

Users who are viewing this thread

For example, I downloaded MB Banner and Flag Standardization Pack v2.01 which gives you the option to make all world map banners look like the 2x3 flags that are used by most real-world nations. I was thinking if there is some way to assign the vanilla 'square' shape to armies and the 'flag' shape from the pack to fiefs.
I know it's possible, and I theoretically know how to do this (replace one of the vanilla banner meshes with the 'flag' one is the simplest way, I think), but I don't know how to make the game assign the 'flag' to fiefs and 'square flag' to armies.
Please don't just throw me a code snippet and call it a day, like I've seen done many times, at least tell me what file that snippet is from!
Thank you kindly.
 
Solution
I have this code in my module_script (I don't remember where I got it from), look for (faction_set_slot, "fac_kingdom_6", slot_faction_banner, "mesh_banner_kingdom_x"), (mesh_banner_kingdom_x is a reference), (it's more or less on line 400) (there are 2) there and check the codes, some of them have to be commented (#), here I give you the example of assignment the king and 2 lords per faction, to which you must assign the scene_prop that corresponds to the banner that you want....good luck

Code:
      (faction_set_slot, "fac_kingdom_6", slot_faction_banner, "mesh_banner_kingdom_d"),
      (faction_set_slot, "fac_kingdom_7", slot_faction_banner, "mesh_banner_kingdom_h"),

      (try_for_range, ":cur_faction", npc_kingdoms_begin...
I have no idea about singleplayer stuff like the world map, I still looked around a bit if I find something to help you. Lav has some script at his Fish & Chip OSP here, https://forums.taleworlds.com/index...ip-osp-heraldry-retexturing-unleashed.303630/

Code:
    ("get_banner_mesh_for_party",
        [
            (store_script_param_1, ":party_id"),
            (assign, ":lord_id", -1),
            (try_begin),
                (this_or_next|party_slot_eq, ":party_id", slot_party_type, spt_castle),
                (party_slot_eq, ":party_id", slot_party_type, spt_town),
                (party_get_slot, ":lord_id", ":party_id", slot_town_lord),
            (else_try),
                (eq, ":party_id", "p_main_party"),
                (assign, ":lord_id", "trp_player"),
            (else_try),
                (party_slot_eq, ":party_id", slot_party_type, spt_kingdom_hero_party),
                (party_get_num_companion_stacks, ":stacks", ":party_id"),
                (gt, ":stacks", 0),
                (party_stack_get_troop_id, ":lord_id", ":party_id", 0),
            (try_end),
            (try_begin),
                (this_or_next|eq, ":lord_id", "trp_player"),
                (is_between, ":lord_id", active_npcs_begin, active_npcs_end),
                (troop_get_slot, reg0, ":lord_id", slot_troop_banner_scene_prop),
                (val_sub, reg0, banner_scene_props_begin),
                (val_add, reg0, banner_meshes_begin),
            (else_try),
                (assign, reg0, "mesh_banners_default_a"),
            (try_end),
        ]
    ),

Could you not alter it such way that the mesh kind for the banner is differentiated via else_try for spt_castle & Co on the one side and spt_kingdom_hero_party on the other side?

Not sure how the code snippet at module_map_icons works which could also offer some option.
Code:
("custom_banner_01",0,"custom_map_banner_01", banner_scale, 0,
  [
    (ti_on_init_map_icon,
      [
        (store_trigger_param_1, ":party_no"),
        (party_get_slot, ":leader_troop", ":party_no", slot_town_lord),
        (try_begin),
          (ge, ":leader_troop", 0),
          (cur_map_icon_set_tableau_material, "tableau_custom_banner_square", ":leader_troop"),
        (try_end),
        ]),
    ]),
  ("custom_banner_02",0,"custom_map_banner_02", banner_scale, 0,
  [
    (ti_on_init_map_icon,
      [
        (store_trigger_param_1, ":party_no"),
        (party_get_slot, ":leader_troop", ":party_no", slot_town_lord),
        (try_begin),
          (ge, ":leader_troop", 0),
          (cur_map_icon_set_tableau_material, "tableau_custom_banner_short", ":leader_troop"),
        (try_end),
        ]),
    ]),
  ("custom_banner_03",0,"custom_map_banner_03", banner_scale, 0,
  [
    (ti_on_init_map_icon,
      [
        (store_trigger_param_1, ":party_no"),
        (party_get_slot, ":leader_troop", ":party_no", slot_town_lord),
        (try_begin),
          (ge, ":leader_troop", 0),
          (cur_map_icon_set_tableau_material, "tableau_custom_banner_tall", ":leader_troop"),
        (try_end),
        ]),
    ]),

I hope I did not post only useless stuff for you :oops:
 
Upvote 0
I have this code in my module_script (I don't remember where I got it from), look for (faction_set_slot, "fac_kingdom_6", slot_faction_banner, "mesh_banner_kingdom_x"), (mesh_banner_kingdom_x is a reference), (it's more or less on line 400) (there are 2) there and check the codes, some of them have to be commented (#), here I give you the example of assignment the king and 2 lords per faction, to which you must assign the scene_prop that corresponds to the banner that you want....good luck

Code:
      (faction_set_slot, "fac_kingdom_6", slot_faction_banner, "mesh_banner_kingdom_d"),
      (faction_set_slot, "fac_kingdom_7", slot_faction_banner, "mesh_banner_kingdom_h"),

      (try_for_range, ":cur_faction", npc_kingdoms_begin, npc_kingdoms_end),
        (faction_get_slot, ":cur_faction_king", ":cur_faction", slot_faction_leader),
        (faction_get_slot, ":cur_faction_banner", ":cur_faction", slot_faction_banner),
        (val_sub, ":cur_faction_banner", banner_meshes_begin),
        (val_add, ":cur_faction_banner", banner_scene_props_begin),
        (troop_set_slot, ":cur_faction_king", slot_troop_banner_scene_prop, ":cur_faction_banner"),
      (try_end),
#      (assign, ":num_khergit_lords_assigned", 0),
#      (assign, ":num_sarranid_lords_assigned", 0),
#      (assign, ":num_kingdom_7_lords_assigned", 0),
#      (assign, ":num_other_lords_assigned", 0),

      (try_for_range, ":kingdom_hero", active_npcs_begin, active_npcs_end),
        (this_or_next|troop_slot_eq, ":kingdom_hero", slot_troop_occupation, slto_kingdom_hero),
        (troop_slot_eq, ":kingdom_hero", slot_troop_occupation, slto_inactive_pretender),

        (store_troop_faction, ":kingdom_hero_faction", ":kingdom_hero"),
        (neg|faction_slot_eq, ":kingdom_hero_faction", slot_faction_leader, ":kingdom_hero"),
        (try_begin),

      #empieza asignacion individual de banners
          (eq, ":kingdom_hero_faction", "fac_kingdom_1"), #kingdom 1
      (troop_set_slot, "trp_kingdom_1_lord", slot_troop_banner_scene_prop, "spr_banner_kingdom_f"),
      (troop_set_slot, "trp_knight_1_1", slot_troop_banner_scene_prop, "spr_banner_f"),
      (troop_set_slot, "trp_knight_1_2", slot_troop_banner_scene_prop, "spr_banner_h"),
     
      (else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_2"), #kingdom 2
     (troop_set_slot, "trp_kingdom_2_lord", slot_troop_banner_scene_prop, "spr_banner_kingdom_b"),
      (troop_set_slot, "trp_knight_2_1", slot_troop_banner_scene_prop, "spr_banner_be"),
     
      (else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_3"), #kingdom 3
     (troop_set_slot, "trp_kingdom_3_lord", slot_troop_banner_scene_prop, "spr_banner_kingdom_c"),
      (troop_set_slot, "trp_knight_3_1", slot_troop_banner_scene_prop, "spr_banner_bq"),
     
      (else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_4"), #kingdom 4
     (troop_set_slot, "trp_kingdom_4_lord", slot_troop_banner_scene_prop, "spr_banner_kingdom_a"),
      (troop_set_slot, "trp_knight_4_1", slot_troop_banner_scene_prop, "spr_banner_i"),
      (troop_set_slot, "trp_knight_4_2", slot_troop_banner_scene_prop, "spr_banner_du"),
   
      (else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_5"), #kingdom 5
      (troop_set_slot, "trp_kingdom_5_lord", slot_troop_banner_scene_prop, "spr_banner_kingdom_e"),
      (troop_set_slot, "trp_knight_5_1", slot_troop_banner_scene_prop, "spr_banner_h05"),
     
     (else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_6"), #kingdom 6
     (troop_set_slot, "trp_kingdom_6_lord", slot_troop_banner_scene_prop, "spr_banner_kingdom_d"),
      (troop_set_slot, "trp_knight_6_1", slot_troop_banner_scene_prop, "spr_banner_bp"),
      (troop_set_slot, "trp_knight_6_2", slot_troop_banner_scene_prop, "spr_banner_cb"),
   
     (else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_7"), #kingdom 7
     (troop_set_slot, "trp_kingdom_7_lord", slot_troop_banner_scene_prop, "spr_banner_kingdom_h"),
     (troop_set_slot, "trp_knight_7_1", slot_troop_banner_scene_prop, "spr_banner_eg"),
   
      (else_try),
#pretenders
      (troop_set_slot, "trp_kingdom_1_pretender", slot_troop_banner_scene_prop, "spr_banner_ba"),
      (troop_set_slot, "trp_kingdom_2_pretender", slot_troop_banner_scene_prop, "spr_banner_bg"),
      (troop_set_slot, "trp_kingdom_3_pretender", slot_troop_banner_scene_prop, "spr_banner_bq"),
      (troop_set_slot, "trp_kingdom_4_pretender", slot_troop_banner_scene_prop, "spr_banner_bj"),
      (troop_set_slot, "trp_kingdom_5_pretender", slot_troop_banner_scene_prop, "spr_banner_j"),
      (troop_set_slot, "trp_kingdom_6_pretender", slot_troop_banner_scene_prop, "spr_banner_bi"),
      (try_end),

# BORRAR INICIO
##        (try_begin),
##          (this_or_next|lt, ":banner_id", banner_scene_props_begin),
##          (gt, ":banner_id", banner_scene_props_end_minus_one),
##          (display_message, "@{!}ERROR: Not enough banners for heroes!"),
##        (try_end),
# FIN
        (store_character_level, ":level", ":kingdom_hero"),
        (store_mul, ":renown", ":level", ":level"),
        (val_div, ":renown", 4), #for top lord, is about 400
.........
 
Last edited:
Upvote 0
Solution
Back
Top Bottom