One banner per faction?

Users who are viewing this thread

Bismarck

Knight
Good day, fellow warriors,

I am toying around with the module system and I would like to change the banners of the lords. Every Swadian lord should get the black double-headed eagle on yellow ground (HRE) while the Vaegirs should get the yellow double-headed eagle on red ground (Byzantine).

Now how do I accomplish that with the module system? Could you please help me?
 
Bismarck said:
I am toying around with the module system and I would like to change the banners of the lords. Every Swadian lord should get the black double-headed eagle on yellow ground (HRE) while the Vaegirs should get the yellow double-headed eagle on red ground (Byzantine).

I'm glad I'm not the only person that bothers.
 
Bismarck said:
Good day, fellow warriors,

I am toying around with the module system and I would like to change the banners of the lords. Every Swadian lord should get the black double-headed eagle on yellow ground (HRE) while the Vaegirs should get the yellow double-headed eagle on red ground (Byzantine).

Now how do I accomplish that with the module system? Could you please help me?
Yes. You can change the mesh name associated with the banner ID (quite complicated in 1.010). Take a look at:

module_meshes.py

module_scene_props.py

Then change the banner assigning script to point to 1 banner per faction.

The module_meshes.py is new and contains the code for custom banner. I have not spent much time on this, so I don't know for sure what is going on.

 
I think you can move all of the faction banners to the top of the list. Then change the cript (presentation) to offset the number of banner so they don't appear in the banner selection screen.
 
I'm just going to answer here:

This is the original code.  You will replace it with the code I write after it:

Code:
(assign, ":num_khergit_lords_assigned", 0),
      
      (try_for_range, ":kingdom_hero", kingdom_heroes_begin, kingdom_heroes_end),
        (store_troop_faction, ":kingdom_hero_faction", ":kingdom_hero"),
        (try_begin),
          (eq, ":kingdom_hero_faction", "fac_kingdom_3"), #Khergit Khanate
          (store_add, ":kingdom_3_banners_begin", banner_scene_props_begin, khergit_banners_begin_offset),
          (store_add, ":banner_id", ":kingdom_3_banners_begin", ":num_khergit_lords_assigned"),
          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":banner_id"),
          (val_add, ":num_khergit_lords_assigned", 1),
        (else_try),
          (store_sub, ":hero_offset", ":kingdom_hero", kingdom_heroes_begin),
          (val_sub, ":hero_offset", ":num_khergit_lords_assigned"),#Remove khergits from offset since their banners are assigned above here
          (try_begin),
            (gt, ":hero_offset", khergit_banners_begin_offset),#Do not add khergit banners to non-khergit lords
            (val_add, ":hero_offset", khergit_banners_end_offset),
            (val_sub, ":hero_offset", khergit_banners_begin_offset),
          (try_end),
          (store_add, ":banner_id", banner_scene_props_begin, ":hero_offset"),
          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":banner_id"),
        (try_end),
        (store_character_level, ":level", ":kingdom_hero"),
        (store_mul, ":renown", ":level", ":level"),
        (val_div, ":renown", 2),
        (try_begin),
          (faction_slot_eq, ":kingdom_hero_faction", slot_faction_leader, ":kingdom_hero"),
          (troop_set_slot, ":kingdom_hero", slot_troop_loyalty, 100),
          (store_random_in_range, ":random_renown", 250, 400),
        (else_try),
          (store_random_in_range, ":random_loyalty", 50, 100),
          (troop_set_slot, ":kingdom_hero", slot_troop_loyalty, ":random_loyalty"),
          (store_random_in_range, ":random_renown", 100, 200),
        (try_end),
        (val_add, ":renown", ":random_renown"),
        (troop_set_slot, ":kingdom_hero", slot_troop_renown, ":renown"),
        (store_random_in_range, ":random_readiness", 0, 100),
        (troop_set_slot, ":kingdom_hero", slot_troop_readiness_to_join_army, ":random_readiness"),
        (troop_set_slot, ":kingdom_hero", slot_troop_readiness_to_follow_orders, 100),
        (troop_set_slot, ":kingdom_hero", slot_troop_player_order_state, spai_undefined),
        (troop_set_slot, ":kingdom_hero", slot_troop_player_order_object, -1),
      (try_end),

#Correcting banners according to the player banner
      (troop_get_slot, ":selected_banner_spr", "trp_player", slot_troop_banner_scene_prop),
      (assign, ":end_cond", kingdom_heroes_end),
      (try_for_range, ":cur_troop", kingdom_heroes_begin, ":end_cond"),
        (troop_slot_eq, ":cur_troop", slot_troop_banner_scene_prop, ":selected_banner_spr"),
        (troop_set_slot, ":cur_troop", slot_troop_banner_scene_prop, banner_scene_props_end_minus_one),
        (assign, ":end_cond", 0),
      (try_end),

replace spr_BANNER_ID = spr_your_banner_id

I think this will work.  Test it out and tell me what happens.
Code:
      
      (try_for_range, ":kingdom_hero", kingdom_heroes_begin, kingdom_heroes_end),
        (store_troop_faction, ":kingdom_hero_faction", ":kingdom_hero"),
        (try_begin),
          (eq, ":kingdom_hero_faction", "fac_kingdom_1"), #Swadia
          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, "spr_BANNER_ID"),
        (else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_3"), #Vaegir
          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, "spr_BANNER_ID"),
        (else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_3"), #Khergit Khanate
          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, "spr_BANNER_ID"),
        (else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_3"), #Rhodok
          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, "spr_BANNER_ID"),
        (else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_3"), #Nord
          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, "spr_BANNER_ID"), 
        (try_end),
        (store_character_level, ":level", ":kingdom_hero"),
        (store_mul, ":renown", ":level", ":level"),
        (val_div, ":renown", 2),
        (try_begin),
          (faction_slot_eq, ":kingdom_hero_faction", slot_faction_leader, ":kingdom_hero"),
          (troop_set_slot, ":kingdom_hero", slot_troop_loyalty, 100),
          (store_random_in_range, ":random_renown", 250, 400),
        (else_try),
          (store_random_in_range, ":random_loyalty", 50, 100),
          (troop_set_slot, ":kingdom_hero", slot_troop_loyalty, ":random_loyalty"),
          (store_random_in_range, ":random_renown", 100, 200),
        (try_end),
        (val_add, ":renown", ":random_renown"),
        (troop_set_slot, ":kingdom_hero", slot_troop_renown, ":renown"),
        (store_random_in_range, ":random_readiness", 0, 100),
        (troop_set_slot, ":kingdom_hero", slot_troop_readiness_to_join_army, ":random_readiness"),
        (troop_set_slot, ":kingdom_hero", slot_troop_readiness_to_follow_orders, 100),
        (troop_set_slot, ":kingdom_hero", slot_troop_player_order_state, spai_undefined),
        (troop_set_slot, ":kingdom_hero", slot_troop_player_order_object, -1),
      (try_end),
 
I just tested this and it works great for me too.  thanks grailknighthero!  Few random comments for anybody that wants to try this:

+ in grail's code he has fac_kingdom_3 listed a few times, make sure you update it
+ in grail's code he has Rhodok as the 4th else_try and Nord as the 5th.  Nord is the 4th faction so you may want to reverse those
+ it seems banners can still get messed up, so I commented out the following lines in "banner_selection" found in module_presentations.py
          (troop_set_slot, ":cur_troop", slot_troop_banner_scene_prop, banner_scene_props_end_minus_one),
          (party_set_banner_icon, ":cur_party", banner_map_icons_end_minus_one),
          (party_set_banner_icon, ":cur_center", banner_map_icons_end_minus_one),
+ hopefully there aren't any other places in the code banners are changed.  :wink:
 
Lol, I meant to change the faction 3s to the right ones.  Opps.  You are right about the Rhodoks and Nords as well.  I forgot about the presentation thing in the banner.  You should just need to comment out the part which switches the banner of a hero if the player chooses that banner.
 
I seem to recall that when a lord gets defeated, on respawn, the system assigns a new banner to him?
 
I only have one question before i use this ( i mean before i make the module system to work).Can you please tell me how can i CHOOSE the banner i want? because I'm making some changes to the banners and i want to make the factions to really look different! not like before...when i dont have the names on i charge on my own infantry LOL :grin:
 
MISHO said:
I only have one question before i use this ( i mean before i make the module system to work).Can you please tell me how can i CHOOSE the banner i want? because I'm making some changes to the banners and i want to make the factions to really look different! not like before...when i dont have the names on i charge on my own infantry LOL :grin:

I just used that guide in my mod. Thanks btw... I added my own SPQR banner for new faction. I placed it in banners_f.dds on 18th possition. spr_BANNER_ID was in my case spr_banner_f18.

I also had to deal with the fact that i wanted one banner only for one faction and all the other banners as they were... i used (bold is new):

      (assign, ":num_khergit_lords_assigned", 0),
     
      (try_for_range, ":kingdom_hero", kingdom_heroes_begin, kingdom_heroes_end),
        (store_troop_faction, ":kingdom_hero_faction", ":kingdom_hero"),
        (try_begin),
          (eq, ":kingdom_hero_faction", "fac_kingdom_3"), #Khergit Khanate
          (store_add, ":kingdom_3_banners_begin", banner_scene_props_begin, khergit_banners_begin_offset),
          (store_add, ":banner_id", ":kingdom_3_banners_begin", ":num_khergit_lords_assigned"),
          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":banner_id"),
          (val_add, ":num_khergit_lords_assigned", 1),
        (else_try),
  (eq, ":kingdom_hero_faction", "fac_kingdom_6"),
  (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, "spr_banner_f18"),
(else_try),
  (neq, ":kingdom_hero_faction", "fac_kingdom_6"),

          (store_sub, ":hero_offset", ":kingdom_hero", kingdom_heroes_begin),
          (val_sub, ":hero_offset", ":num_khergit_lords_assigned"),#Remove khergits from offset since their banners are assigned above here
          (try_begin),
            (gt, ":hero_offset", khergit_banners_begin_offset),#Do not add khergit banners to non-khergit lords
            (val_add, ":hero_offset", khergit_banners_end_offset),
            (val_sub, ":hero_offset", khergit_banners_begin_offset),
          (try_end),
          (store_add, ":banner_id", banner_scene_props_begin, ":hero_offset"),
          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":banner_id"),
        (try_end),

I'm not sure if (neq, etc. line was even neccesary, but the result is i have one faction having one banner and the rest having different banners for all lords.
 
is it at all possible to have one banner per faction WITHOUT using module system? im not really comfortable using it.

if it can't be done then i plan to try this little work around. Its not pretty however.

BY simply copy pasting the kings flag over every single flag his lords are assigned in the texture file, would this work.. kings are always given the same banner, but are the lords? or is it random. i seem to think it assigns the same every time.



 
Replacing it in the texture files is the only way to do it without the module system.
 
Back
Top Bottom