Author Topic: How to change the back color of a banner/heraldic armor  (Read 8449 times)

0 Members and 1 Guest are viewing this topic.

Lord Kinlar

  • Master Knight
  • *
    • View Profile
  • Faction: Neutral
How to change the back color of a banner/heraldic armor
« on: November 05, 2008, 03:11:40 PM »
How to change the back color of heraldic armors.

This is not saved-game compatible, you have to start a new game!(1)

(1) But you can always find the hex/decimal number in your saved game file and change it to whatever you like using a HEX editor if you really want to. I've tried it myself and it worked. See the bottom of the message for more info. :wink:

The back colors for banners are all assigned at the beginning of a new game and they are in game_start script in scripts.txt.

Here's my banner, the one with yellow dragon thingy on a reddish background. The hex value of this reddish background is approximately 701918.



The original banner underneath it (banner #118 in the pic below) has a whitish back color as you can see in the list below which is incompatible with my reddish banner. The hexadecimal color value for it is DEDBD6. Note that this color representation is exactly the same as the one used in web design.



Now, all I need to do is to replace dedbd6 with 701918.

You can find all the hex values for banner back colors in module_scripts.py which comes with 1.010 module system, but here is a short list for the ones who don't have it (ignore the 0xFF bit).

(click to show/hide)

As you can see above, the original back color for banner #118 is 0xFFdedbd6 which is 4292795350 as decimal. Now, I need to find this decimal number in game_start script in scripts.txt and replace it with 4285536536 for 0xFF701918 which is my reddish color. You can use the Windows Calculator in 'scientific mode' for HEX/DEC conversion.

This is the piece of code in scripts.txt that I'm talking about...

Quote
500 3 360287970189640282 118 4292795350 500 3 360287970189640282 119

Now I can save it and start a new game.  :wink:

Here's a screenshot



Tips for editing the saved game:

Open your saved game using a hex editor and search for the hex value (FFDEDBD6) or the reversed hex value (D6DBDEFF) or the integer value (4292795350) as integer or string/text and when you find the right value simply replace/overwrite it with your color. If you do it right, the file size will remain unchanged.


mfa_uk

  • Regular
  • *
  • Invictus Maneo
    • View Profile
  • Faction: Swadian
  • M&BWBWF&S
Re: How to change heraldic armor back color - A simple guide
« Reply #1 on: November 05, 2008, 03:50:25 PM »
So why change the script? why not change the original storage space (banner_background_color_array), allowing you to change multiple banners at one go? or does it not work?

Just trying to understand how this is working, unfortunatly im 50 miles from my comp... doesnt the script pull the data it needs from banner_background_color_array?
"Far better it is to have a stout heart always and suffer one's share of evils, than to be ever fearing what may happen."
"Luck often favors a man; if his courage holds"

Lord Kinlar

  • Master Knight
  • *
    • View Profile
  • Faction: Neutral
Re: How to change heraldic armor back color - A simple guide
« Reply #2 on: November 05, 2008, 04:07:24 PM »
So why change the script? why not change the original storage space (banner_background_color_array), allowing you to change multiple banners at one go?

banner_background_color_array or the storage space as you call it, is actually a troop. :) And no, that troop doesn't have a pre-assigned color values stored in troops.txt. The game assigns them on the fly at the beginning of your game and I think it then stores them in the saved game file.

doesnt the script pull the data it needs from banner_background_color_array?

Yes, it seems so. The script stores the hex color values in it at the beginning of the game.

mfa_uk

  • Regular
  • *
  • Invictus Maneo
    • View Profile
  • Faction: Swadian
  • M&BWBWF&S
Re: How to change heraldic armor back color - A simple guide
« Reply #3 on: November 05, 2008, 04:29:30 PM »
Ah that was the other thought that the script dumps to banner_background_color_array instead of calling from. Sorry if this is a pain had the game for 2-3 weeks now, really enjoying it and kinda getting into the changing banners which has its follow on of more modding, though never really modded before but have dabbled in coding.

I would have thought that the script would pull the variable from somewhere... if you in your devlopment had to change all the banners, is easier to do in an array then keep changing your code, IMHO based on personal experience, not to mention it makes the code longer then it needs to be. Perhaps.

Having thoughts but have questions, does banner_background_color_array change if you say changed banner #1 background in the script and started a new game. Ok its prolly all a lil redundent, use to code on a game and really enjoyed it; not done it now for couple of years sooooo, i get excited and carried away with myself lol for which i apologise.

Thanks for posting the results at least now there is no real restriction into what colour your banner can be.
"Far better it is to have a stout heart always and suffer one's share of evils, than to be ever fearing what may happen."
"Luck often favors a man; if his courage holds"

Amman de Stazia

  • Master Knight
  • *
  • schizophrenic? There's three of us now!
    • View Profile
  • Faction: Neutral
Re: How to change heraldic armor back color - A simple guide
« Reply #4 on: November 05, 2008, 04:33:22 PM »
can this be done in python as well?
http://forums.taleworlds.net/index.php/topic,12250.msg208344.html#msg208344

Family IS more important than Mount and Blade. 

Family D'Stazia.  (A, K and S )

PS - this line plugs TPW - The Peninsular War mod.http://forums.taleworlds.net/index.php/topic,42454.0.html

Lord Kinlar

  • Master Knight
  • *
    • View Profile
  • Faction: Neutral
Re: How to change heraldic armor back color - A simple guide
« Reply #5 on: November 05, 2008, 04:42:51 PM »
can this be done in python as well?

Sure, but my target audience are the people who don't want to use the module system.  ;)

Lord Kinlar

  • Master Knight
  • *
    • View Profile
  • Faction: Neutral
Re: How to change the back color of a banner/heraldic armor
« Reply #6 on: November 18, 2008, 06:48:42 PM »
Prepared a color palette for Photoshop for all the back colors of banners in the game.



Download:

http://rapidshare.com/files/165049735/Mount___Blade.aco

Hellebore

  • Regular
  • *
    • View Profile
  • Faction: Vaegir
Re: How to change the back color of a banner/heraldic armor
« Reply #7 on: November 25, 2008, 03:21:11 PM »
Great guide!

I am having a bit of trouble editing my save game however.

in my game I used your new 21 custom banners from the other thread. I replaced the banners_f.dds file with yours and it worked in game. I selected the black and gold banner in game, but it has a white back and looks a bit odd.

for the black and gold banner with the 4 birds, would that be 108? Because I can't seem to find FFdcdbd3, reversed or decimal in my saved game file with that banner selected.

Thanks for any help! I hope this all made sense :P

Lord Kinlar

  • Master Knight
  • *
    • View Profile
  • Faction: Neutral
Re: How to change the back color of a banner/heraldic armor
« Reply #8 on: November 27, 2008, 03:35:47 AM »
Great guide!

I am having a bit of trouble editing my save game however.

in my game I used your new 21 custom banners from the other thread. I replaced the banners_f.dds file with yours and it worked in game. I selected the black and gold banner in game, but it has a white back and looks a bit odd.

for the black and gold banner with the 4 birds, would that be 108? Because I can't seem to find FFdcdbd3, reversed or decimal in my saved game file with that banner selected.

The banner you mentioned indeed becomes #108, if you use my texture instead of banners_f.dds. Its default back color is dcdbd3 like you said. Ignore the 0xFF bit, I think the FF is used to make the value 32 bit and it probably has no other use. You need to find & replace this value (DCDBD3) with 2E2F2C which is the back color for the black and gold banner. Here's what you need to do to change the back color of your current banner, step by step...

1. Open your saved game file (e.g. sg01.sav) with a HEX editor.[1]

2. Search for the hex value D3DBDC (reversed DCDBD3).




3. You'll find 2 instances of the same color for banner #101 and #108. The one you need to replace is the second one.



4. Select and highlight the second D3DBDC and replace it with 2C2F2E (instead of 2E2F2C, because it's reversed).



5. Save the file.

That's all you need to do.

[1] The screenshots are taken from HxD v1.6.1.0.



Hellebore

  • Regular
  • *
    • View Profile
  • Faction: Vaegir
Re: How to change the back color of a banner/heraldic armor
« Reply #9 on: November 27, 2008, 05:04:55 PM »
You are my hero :D!

HokieBT

  • Grandmaster Knight
  • *
  • may the force be with you
    • View Profile
  • Faction: Neutral
Re: How to change the back color of a banner/heraldic armor
« Reply #10 on: December 29, 2008, 04:39:06 PM »

thanks, this worked great!
 

Kiado

  • Regular
  • *
    • View Profile
  • Faction: Swadian
Re: How to change the back color of a banner/heraldic armor
« Reply #11 on: January 03, 2009, 06:59:11 PM »
This is wonderful information even if you use the Module system.  Just the color palettes and general layout will help.  My mod is extremely tied into Heraldry, and it will all be custom so anything helps.

Thank you sir.
Team Lead- Castle Black Mod Team - A Song of Ice and Fire Mod for M&B 1.011
Work is under way on a new version, redone from the ground up, for M&B 1.x.  Come visit the boards!

Miles

  • Recruit
  • *
    • View Profile
  • Faction: Nord
Re: How to change the back color of a banner/heraldic armor
« Reply #12 on: February 16, 2009, 12:00:56 AM »
The mercenaries, when waiting in the taverns, seem to use the default banners.

Vaelius Noctu

  • Veteran
  • *
  • Non fiunt poetæ, nascuntur
    • View Profile
  • Faction: Nord
  • MP nick: VaeliusNoctu; Walram
  • M&BWB
Re: How to change the back color of a banner/heraldic armor
« Reply #13 on: April 10, 2009, 04:02:49 AM »
Hallo,

your Tip Works in my savegame. But later in game I want to change the colour of my Banner from white to black. I have modify first in this way:

1. from yellow to white:

   -2848a4
to
   -d6dedf

2. now i want to chose the colour from white to black

   -d6dedf
to
   -363737

But the colour of my backsite allways is white. What have I make false?

Thanks for help.

Vaelius Noctu
Forgive my English, I'm German. :P

-Neu- Highres Banner

King Yngvar

  • Sergeant
  • *
    • View Profile
  • Faction: Nord
  • WB
Re: How to change the back color of a banner/heraldic armor
« Reply #14 on: May 13, 2009, 02:18:55 PM »
Thanks for this but I have a question. How do I find out what the decimal values of a colour is? I tried to figure it out in paint but couldn't see anything. I also wonder if anyone know where the decimal code for the frontside background colours lay, I do intend to change most banners into having the same front and back colours.
« Last Edit: May 13, 2009, 02:21:13 PM by King Yngvar »