Kingdom colors

Users who are viewing this thread

If you're trying to do this for all kingdoms, you want to look in module_factions.py.  The last bit of stuff like 0x33DDDD is a hex RGB value for the faction color.

If you want to do this dynamically, we've got this:
  faction_set_color              = 1276 # (faction_set_color, <faction_id>, <value>),

Hunt around for where that's used for examples.  This will also change all unit name colors for that faction as well.
 
NICK.ALTMAN said:
Where do I change my kingdoms colors? I mean the color of the town names.

module_factions.py.. example:
("kingdom_1",  "The Kingdom of Denmark", 0, 0.9, [("outlaws",-0.05),("kingdom_4", -0.1),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xDDFFFF),
this is what you are looking for

not sure about the order, but know red is first, and the highest color value if "FF", so basicly if you put in "FF0000" you will set the the color values to Red: 255, Blue: 0 Green: 0... if you put in "DD0000" it should be something like Red: 200, Blue: 0, and green 0

hope that is understandable

EDIT: too slow  :sad:
 
NICK.ALTMAN said:
Can it be done in text files?
Not dynamically, at least, not easily. 

Statically, yes.  Open up factions.txt.  Each entry starts with a line like this:
  0 fac_kingdom_5 Kingdom_of_Rhodoks 0 3399133

The last number in that line is a decimal version of the color.  This one is 0x33DDDD.  If you're unused to messing with hexadecimal, go to your calc tool, open the View menu, make sure it's on scientific.  Enter your decimal value, then click on the "Hex" radio and it will do the conversion automagically.  The same works in reverse.  You can even copy & paste from it.
 
0 fac_kingdom_5 Kingdom_of_Rhodoks 0 3399133
0.000000  0.000000  -0.050000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.900000  0.000000  0.000000  0.000000  0.000000  0.000000  -0.020000  -0.050000  -0.050000  0.000000  0.000000  -0.100000  0.000000

Thats my line? I don't see 0x33DDDD. Or am I missing something?

And whats the claimant quest color? The red one?
 
NICK.ALTMAN said:
0 fac_kingdom_5 Kingdom_of_Rhodoks 0 3399133
0.000000  0.000000  -0.050000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.900000  0.000000  0.000000  0.000000  0.000000  0.000000  -0.020000  -0.050000  -0.050000  0.000000  0.000000  -0.100000  0.000000

Thats my line? I don't see 0x33DDDD. Or am I missing something?

If you're editing the text file, you need to edit the decimal value, as kt0 already mentioned. Follow his instructions above.
 
The claimant quest one is a little harder.  I don't think it's a static faction and the color is instead dynamically set when you accept the quest.  I can't say for sure because I haven't messed with that stuff.  If you knew where that code lived, it would be pretty straightforward to change the color value, then look for which number changed in the txt file.  But at that point, it's easier just to make the change in the module system rather than messing with txt files anyway.

A quick note about hex:
The value 3399133 in decimal is exactly equal to 0x33DDDD in hex.  Whip out your windows calc tool and mess with it a bit.  Just as decimal digits have a range of 0-9, hex digits have a range of 0-F.  We prepend 0x to hex values so we know they're in hex but leave decimal numbers out of the prepend party because we're used to seeing them plain. 
 
You're not related to Mordachai are you?

My curiosity got the better of me and in the spirit of TheMageLord, here's your text tweak.  Open up conversations.txt and locate the line starting with "dlga_lord_give_conclude_2".  Claimaint red is 0xFF0000 (pure red) which translates to 16711680 in decimal. 

Find the 16711680 in that line and change it to whatever you like.  It should be near the end in this context:
  2 432345564227567629 16711680 1 1 936748722493063448

I haven't tested this.  I claim no responsibility if it explodes.  This will only work prior to embarking on the claimant quest; i.e., this changes the code that changes the color rather than changing the color directly. 

If you also want to change rebels color, it's similarly done in scripts.txt looking for activate_deactivate_player_faction.  The color there is 0xAAAAAA (light grey) which is 11184810.  In context it looks like this:
  1585267068834414747 1276 2 432345564227567629 11184810 2133 2 144115188075856122 432345564227567629

Again, not tested but I know that function a heck of a lot better (I hacked it up).  The same rules apply:  change has to be made prior to rebelling. 
 
kt0 said:
You're not related to Mordachai are you?

My curiosity got the better of me and in the spirit of TheMageLord, here's your text tweak.  Open up conversations.txt and locate the line starting with "dlga_lord_give_conclude_2".  Claimaint red is 0xFF0000 (pure red) which translates to 16711680 in decimal. 

Find the 16711680 in that line and change it to whatever you like.  It should be near the end in this context:
  2 432345564227567629 16711680 1 1 936748722493063448

I haven't tested this.  I claim no responsibility if it explodes.  This will only work prior to embarking on the claimant quest; i.e., this changes the code that changes the color rather than changing the color directly. 

If you also want to change rebels color, it's similarly done in scripts.txt looking for activate_deactivate_player_faction.  The color there is 0xAAAAAA (light grey) which is 11184810.  In context it looks like this:
  1585267068834414747 1276 2 432345564227567629 11184810 2133 2 144115188075856122 432345564227567629

Again, not tested but I know that function a heck of a lot better (I hacked it up).  The same rules apply:  change has to be made prior to rebelling.

Thanks for everything. I made it.  :grin: Credits in the next version.
 
Back
Top Bottom