Author Topic: One banner per faction?  (Read 3826 times)

0 Members and 1 Guest are viewing this topic.

Bismarck

  • Knight
  • *
    • View Profile
  • Faction: Neutral
One banner per faction?
« on: October 31, 2008, 03:34:48 PM »
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?

HokieBT

  • Grandmaster Knight
  • *
  • may the force be with you
    • View Profile
  • Faction: Neutral
Re: One banner per faction?
« Reply #1 on: October 31, 2008, 04:03:58 PM »

read here and wait for somebody to hopefully respond.  ;)

http://forums.taleworlds.net/index.php/topic,6575.msg1276924.html#msg1276924
 

grailknighthero

  • Knight at Arms
  • *
  • www.games-workshop.com
    • View Profile
  • Faction: Neutral
  • M&B
Re: One banner per faction?
« Reply #2 on: October 31, 2008, 06:59:36 PM »
I may have time to respond tonight, and if not tonight tomorrow.
The Peasants' Rebellion: Warhammer Battles - a custom battle mod featuring TW/Warhammer style formations/battles for M&B - currently in development.

Septa Scarabae

  • Knight
  • *
  • Mostly Harmless
    • View Profile
  • Faction: Neutral
Re: One banner per faction?
« Reply #3 on: October 31, 2008, 07:24:34 PM »
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.
(Mount & Blade) Artifex - Level 24 Master Knight
Scarabae Texture Pack v.2.9 (Updated 04.08.09)
Great Helm Add-On v.1.8 (Updated 5.12.09)

"Haha, I could just imagine you and Winter sitting there drinking moonshine and drawing sworddicks for Mount&Blade" -- NordMann

SPD_Phoenix

  • Master Knight
  • *
    • View Profile
  • Faction: Neutral
Re: One banner per faction?
« Reply #4 on: October 31, 2008, 07:47:36 PM »
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.


Tiberius

  • Worshipper of the Frodogorn
  • Sergeant Knight
  • *
  • Herpus via Derpus
    • View Profile
  • Faction: Sarranid
  • MP nick: Nack
  • M&BWBWF&S
Re: One banner per faction?
« Reply #5 on: October 31, 2008, 08:25:52 PM »
What happens if you choose a faction banner as your personal banner? Does the entire faction get the red checkered flag?

SPD_Phoenix

  • Master Knight
  • *
    • View Profile
  • Faction: Neutral
Re: One banner per faction?
« Reply #6 on: October 31, 2008, 09:21:43 PM »
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.

grailknighthero

  • Knight at Arms
  • *
  • www.games-workshop.com
    • View Profile
  • Faction: Neutral
  • M&B
Re: One banner per faction?
« Reply #7 on: November 01, 2008, 12:40:53 AM »
I'm just going to answer here:

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

Code: [Select]
(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: [Select]
     
      (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),

The Peasants' Rebellion: Warhammer Battles - a custom battle mod featuring TW/Warhammer style formations/battles for M&B - currently in development.

HokieBT

  • Grandmaster Knight
  • *
  • may the force be with you
    • View Profile
  • Faction: Neutral
Re: One banner per faction?
« Reply #8 on: November 02, 2008, 03:04:20 PM »

grail - thanks very much, I'll hopefully try this out in the next day or so!
 

Jubal

  • Knight
  • *
    • View Profile
    • Exilian Forums
  • Faction: Rhodok
Re: One banner per faction?
« Reply #9 on: November 04, 2008, 10:28:00 PM »
I just tested this - it works like a dream.
Creator of the mod Southern Realms, Head Admin of Exilian

HokieBT

  • Grandmaster Knight
  • *
  • may the force be with you
    • View Profile
  • Faction: Neutral
Re: One banner per faction?
« Reply #10 on: November 05, 2008, 04:00:11 PM »

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.  ;)
 

grailknighthero

  • Knight at Arms
  • *
  • www.games-workshop.com
    • View Profile
  • Faction: Neutral
  • M&B
Re: One banner per faction?
« Reply #11 on: November 05, 2008, 04:04:39 PM »
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.
The Peasants' Rebellion: Warhammer Battles - a custom battle mod featuring TW/Warhammer style formations/battles for M&B - currently in development.

swasta

  • Regular
  • *
    • View Profile
Re: One banner per faction?
« Reply #12 on: November 09, 2008, 11:37:04 PM »
I seem to recall that when a lord gets defeated, on respawn, the system assigns a new banner to him?

grailknighthero

  • Knight at Arms
  • *
  • www.games-workshop.com
    • View Profile
  • Faction: Neutral
  • M&B
Re: One banner per faction?
« Reply #13 on: November 10, 2008, 12:35:34 AM »
Are you saying native does that, because it doesn't, or are you saying the code I gave does that?
The Peasants' Rebellion: Warhammer Battles - a custom battle mod featuring TW/Warhammer style formations/battles for M&B - currently in development.

swasta

  • Regular
  • *
    • View Profile
Re: One banner per faction?
« Reply #14 on: November 10, 2008, 02:19:49 AM »
I had banner id errors on lord respawn. May not be related.