Unit Color Variation/Changer (Skin/Scale/Armour)
Moderator: Forum Moderators
- DuncanDill
- Posts: 157
- Joined: December 30th, 2022, 11:57 am
- Location: Knagla, the evil twin sister of Knalga...
Re: Unit Color Variation (Skin/Scale/Armour)
Sadly skin colour is not easily possible, due to irregularities in the palette
viewtopic.php?p=690573#p690573 Curent Maintainer of Talentless Mage
viewtopic.php?p=689462#p689462 Gaze at my art :D
viewtopic.php?p=689462#p689462 Gaze at my art :D
Re: Unit Color Variation (Skin/Scale/Armour)
Sadly skin colors dont work, it does conflict with wooden parts of weapons or boots.
Campaigns:Vendraxis Prophecy
Porting:Across the Ocean, Forgotten Legacy, Oath of Allegiance, Palms amid Blue Dunes, Carved in Stone, The Rod of Justice
Modification: Unit Color Changer, Unit Color Variation
Porting:Across the Ocean, Forgotten Legacy, Oath of Allegiance, Palms amid Blue Dunes, Carved in Stone, The Rod of Justice
Modification: Unit Color Changer, Unit Color Variation
Re: Unit Color Variation (Skin/Scale/Armour)
Saurian Color Changer and Randomiser is no more!
I present to you Unit Color Variation and Unit Color Changer!
Unit Color Variation got a new entry the Loyalist Armour.
Unit Color Changer replaces Saurian Scalechanger.
You can choose between
- Saurians
- Drakes
- Loyalist Armour
I present to you Unit Color Variation and Unit Color Changer!
Unit Color Variation got a new entry the Loyalist Armour.
Unit Color Changer replaces Saurian Scalechanger.
You can choose between
- Saurians
- Drakes
- Loyalist Armour
Campaigns:Vendraxis Prophecy
Porting:Across the Ocean, Forgotten Legacy, Oath of Allegiance, Palms amid Blue Dunes, Carved in Stone, The Rod of Justice
Modification: Unit Color Changer, Unit Color Variation
Porting:Across the Ocean, Forgotten Legacy, Oath of Allegiance, Palms amid Blue Dunes, Carved in Stone, The Rod of Justice
Modification: Unit Color Changer, Unit Color Variation
Re: Unit Color Variation/Changer (Skin/Scale/Armour)
Good job !
Beheld the origins of BFW.
Max G on WIF
Rank 🌟🌟🌟🌟🌟
Max G on WIF
Rank 🌟🌟🌟🌟🌟
Re: Unit Color Variation/Changer (Skin/Scale/Armour)
Trolls are added.
Campaigns:Vendraxis Prophecy
Porting:Across the Ocean, Forgotten Legacy, Oath of Allegiance, Palms amid Blue Dunes, Carved in Stone, The Rod of Justice
Modification: Unit Color Changer, Unit Color Variation
Porting:Across the Ocean, Forgotten Legacy, Oath of Allegiance, Palms amid Blue Dunes, Carved in Stone, The Rod of Justice
Modification: Unit Color Changer, Unit Color Variation
Re: Unit Color Variation/Changer (Skin/Scale/Armour)
New Update 1.1.3
Merfolk is added as well as minor bugfixes
Merfolk is added as well as minor bugfixes
Campaigns:Vendraxis Prophecy
Porting:Across the Ocean, Forgotten Legacy, Oath of Allegiance, Palms amid Blue Dunes, Carved in Stone, The Rod of Justice
Modification: Unit Color Changer, Unit Color Variation
Porting:Across the Ocean, Forgotten Legacy, Oath of Allegiance, Palms amid Blue Dunes, Carved in Stone, The Rod of Justice
Modification: Unit Color Changer, Unit Color Variation
Re: Unit Color Variation (Skin/Scale/Armour)
Right now this is not possible for technical reasons.
But I found a way to navigate around the reason.
First of all, what is the reasons? Human skins color is used for wooden parts and sometimes leather or bows.
So recoloring thus seems suboptimal.
I learned the solution for the human skin problem in ly merfolk update.
The solution is, to recreate every human sprite from mainline wesnoth. Give them a fix skin color and use this new sprites for my randomizer or picker.
But this will be a lot of manual work, I am not ready to do yet.
Campaigns:Vendraxis Prophecy
Porting:Across the Ocean, Forgotten Legacy, Oath of Allegiance, Palms amid Blue Dunes, Carved in Stone, The Rod of Justice
Modification: Unit Color Changer, Unit Color Variation
Porting:Across the Ocean, Forgotten Legacy, Oath of Allegiance, Palms amid Blue Dunes, Carved in Stone, The Rod of Justice
Modification: Unit Color Changer, Unit Color Variation
Re: Unit Color Variation/Changer (Skin/Scale/Armour)
Unit Color Changer the Orcish Incursion Update!
New Unit Color Changer/Variation Version 1.2.0 is up on 1.18 wesnoth addon servers.
Now new with the Orcs, Wolves, Goblins!
Supported Units:
- Saurian Scales,
- Drake Scales,
- Loyalist Blue Armour,
- Troll Skin,
- Merfolk Scales, Hair and Armour,
- Orc Armour/Skin,
- Orcish Assassin Cloth/Skin,
- Goblin Armour,
- Wolf Fur (counts for Wolf Rider too),
- Orcish Shaman Cloth/Skin (SotBE, TDG),
Have fun! I am looking forward for your feedback and suggestions!
New Unit Color Changer/Variation Version 1.2.0 is up on 1.18 wesnoth addon servers.
Now new with the Orcs, Wolves, Goblins!
Supported Units:
- Saurian Scales,
- Drake Scales,
- Loyalist Blue Armour,
- Troll Skin,
- Merfolk Scales, Hair and Armour,
- Orc Armour/Skin,
- Orcish Assassin Cloth/Skin,
- Goblin Armour,
- Wolf Fur (counts for Wolf Rider too),
- Orcish Shaman Cloth/Skin (SotBE, TDG),
Have fun! I am looking forward for your feedback and suggestions!
Campaigns:Vendraxis Prophecy
Porting:Across the Ocean, Forgotten Legacy, Oath of Allegiance, Palms amid Blue Dunes, Carved in Stone, The Rod of Justice
Modification: Unit Color Changer, Unit Color Variation
Porting:Across the Ocean, Forgotten Legacy, Oath of Allegiance, Palms amid Blue Dunes, Carved in Stone, The Rod of Justice
Modification: Unit Color Changer, Unit Color Variation
Re: Unit Color Variation/Changer (Skin/Scale/Armour)
Two more images
Campaigns:Vendraxis Prophecy
Porting:Across the Ocean, Forgotten Legacy, Oath of Allegiance, Palms amid Blue Dunes, Carved in Stone, The Rod of Justice
Modification: Unit Color Changer, Unit Color Variation
Porting:Across the Ocean, Forgotten Legacy, Oath of Allegiance, Palms amid Blue Dunes, Carved in Stone, The Rod of Justice
Modification: Unit Color Changer, Unit Color Variation
Re: Unit Color Variation/Changer (Skin/Scale/Armour)
You know, it would be an interesting option, if you have 6 colour variations: then instead of randomly, you assign colour variation based on traits. (4x3/2=6 combinations for most races, 10 for elf, dwarf and heavy infantry.)
Then you could have the information just from looking at the army, or the unit you recruited.
Then you could have the information just from looking at the army, or the unit you recruited.
- beetlenaut
- Developer
- Posts: 2867
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Unit Color Variation/Changer (Skin/Scale/Armour)
That's a really useful idea. It seems like it should have been obvious now that someone has thought of it! I don't think the number of variations is that important, so cutting it down to six in some cases doesn't seem like a huge loss. It would be outweighed by the advantage of being able to see the traits at a glance.
Here is an idea for someone who wants to contribute but doesn't have the coding or painting skills: Work on converting human unit sprites so that this variation code works on them. As far as I understand, the skin color and armor color just need to be in different spots in the palette, so one of them needs to be changed by a tiny amount that is barely noticeable to the eye.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: Unit Color Variation/Changer (Skin/Scale/Armour)
Interesting idea, this could be added aswell, but what about other traits like loyal?tsunami_ wrote: ↑June 6th, 2025, 2:15 am You know, it would be an interesting option, if you have 6 colour variations: then instead of randomly, you assign colour variation based on traits. (4x3/2=6 combinations for most races, 10 for elf, dwarf and heavy infantry.)
Then you could have the information just from looking at the army, or the unit you recruited.
In MP your idea works, for campaigns I am not that sure. Sometimes I also see a dextrous drakes, saurian or other races who dont have it regulary.
On rare occasions we can also see units with 3 traits.
To take everything into account will be a lot of work.
What can be done is, adding a dummy trait, where the player can see which color it is. It is just a textbox.
Campaigns:Vendraxis Prophecy
Porting:Across the Ocean, Forgotten Legacy, Oath of Allegiance, Palms amid Blue Dunes, Carved in Stone, The Rod of Justice
Modification: Unit Color Changer, Unit Color Variation
Porting:Across the Ocean, Forgotten Legacy, Oath of Allegiance, Palms amid Blue Dunes, Carved in Stone, The Rod of Justice
Modification: Unit Color Changer, Unit Color Variation
Re: Unit Color Variation/Changer (Skin/Scale/Armour)
Well, I suppose these unusual units would be specially given, so you could give them default colours.
Or, you could add extra four colours, for (strong/quick/intelligent/resilient) + (unusual trait).
I have seen traits-checking-code before, and I think an implementation like this would work:
Check first trait and give a score, for example strong=1, quick=4, resilient=13, intelligent=15.
Then check second trait and add.
Then you check the number:
1 = strong,loyal = colour 1
4 = quick,loyal = colour 2
13 = resilient,loyal = colour 3
15 = intelligent,loyal = colour 4
5 = strong,quick = colour 5
14 = strong,resilient = colour 6
16 = strong,intelligent = colour 7
17 = quick,resilient = colour 8
19 = quick,intelligent = colour 9
28 = resilient,intelligent = colour 10
and other scores, e.g. 0 = loyal,fearless or 8 = quick,quick remain as default. And third and fourth traits are ignored.
--
Or, you could add extra four colours, for (strong/quick/intelligent/resilient) + (unusual trait).
I have seen traits-checking-code before, and I think an implementation like this would work:
Check first trait and give a score, for example strong=1, quick=4, resilient=13, intelligent=15.
Then check second trait and add.
Then you check the number:
1 = strong,loyal = colour 1
4 = quick,loyal = colour 2
13 = resilient,loyal = colour 3
15 = intelligent,loyal = colour 4
5 = strong,quick = colour 5
14 = strong,resilient = colour 6
16 = strong,intelligent = colour 7
17 = quick,resilient = colour 8
19 = quick,intelligent = colour 9
28 = resilient,intelligent = colour 10
and other scores, e.g. 0 = loyal,fearless or 8 = quick,quick remain as default. And third and fourth traits are ignored.
--
Re: Unit Color Variation/Changer (Skin/Scale/Armour)
Here, I have made a quick version of what I explained. I put this .cfg (attachment) inside your add-on, then I added the name to _main and commented out randomizer.
Er, add-on sort of breaks. I am not familiar with "modification" code.
But still it works, if you debug some Heavy infantry, you will see. They are hideous
.
Code: Select all
#{~add-ons/UCV/macros/randomizer.cfg}
{~add-ons/UCV/macros/HI_traits.cfg}
But still it works, if you debug some Heavy infantry, you will see. They are hideous

Code: Select all
# quick,strong -> red
# quick,resilient -> green
# quick,intelligent -> blue
# strong,resilient -> yellow
# strong,intelligent -> magenta
# resilient,intelligent -> cyan
# fearless,anything -> black
[modification]
id=modification_traits_HI
#define RECOLOUR_UNITS_BY_TRAIT UNIT_TYPE
[event]
name=unit placed
first_time_only=no
[filter]
[not]
[filter_wml]
[modifications]
[object]
colour_shifted=yes
[/object]
[/modifications]
[/filter_wml]
[/not]
x,y=$x1,$y1
type={UNIT_TYPE}
[/filter]
[set_variable]
name=colour_score
value=0
[/set_variable]
# quick = 1
# strong = 10
# resilient = 100
# intelligent = 1000
# fearless gives no score.
[switch]
variable=unit.modifications.trait[0].id
[case]
value=quick
[set_variable]
name=colour_score
add=1
[/set_variable]
[/case]
[case]
value=strong
[set_variable]
name=colour_score
add=10
[/set_variable]
[/case]
[case]
value=resilient
[set_variable]
name=colour_score
add=100
[/set_variable]
[/case]
[case]
value=intelligent
[set_variable]
name=colour_score
add=1000
[/set_variable]
[/case]
[else]
[/else]
[/switch]
[switch]
variable=unit.modifications.trait[1].id
[case]
value=quick
[set_variable]
name=colour_score
add=1
[/set_variable]
[/case]
[case]
value=strong
[set_variable]
name=colour_score
add=10
[/set_variable]
[/case]
[case]
value=resilient
[set_variable]
name=colour_score
add=100
[/set_variable]
[/case]
[case]
value=intelligent
[set_variable]
name=colour_score
add=1000
[/set_variable]
[/case]
[else]
[/else]
[/switch]
[switch]
variable=colour_score
[case]
value=11
{VARIABLE new_colour FF0000}
[/case]
[case]
value=101
{VARIABLE new_colour 00FF00}
[/case]
[case]
value=1001
{VARIABLE new_colour 0000FF}
[/case]
[case]
value=110
{VARIABLE new_colour FFFF00}
[/case]
[case]
value=1010
{VARIABLE new_colour FF00FF}
[/case]
[case]
value=1100
{VARIABLE new_colour 00FFFF}
[/case]
[else]
{VARIABLE new_colour 000000}
[/else]
[/switch]
[object]
colour_shifted=yes
silent=yes
[effect]
apply_to=image_mod
add=PAL(A8A098 > $new_colour)
[/effect]
[/object]
[/event]
#enddef
{RECOLOUR_UNITS_BY_TRAIT (Heavy Infantryman)}
[/modification]
- Attachments
-
HI_traits.cfg
- (2.77 KiB) Downloaded 8 times
Re: Unit Color Variation/Changer (Skin/Scale/Armour)
@tsunami
Your code looks good
I will add it, players don't need to put this feature on if they don't want it, after my addon creation break.
I also need to adjust my code for the new modifications line.
Ready out traits isn't that difficult, I have that for loyal already. Your code looks quite well indeed.
Your code looks good
I will add it, players don't need to put this feature on if they don't want it, after my addon creation break.
I also need to adjust my code for the new modifications line.
Ready out traits isn't that difficult, I have that for loyal already. Your code looks quite well indeed.
Campaigns:Vendraxis Prophecy
Porting:Across the Ocean, Forgotten Legacy, Oath of Allegiance, Palms amid Blue Dunes, Carved in Stone, The Rod of Justice
Modification: Unit Color Changer, Unit Color Variation
Porting:Across the Ocean, Forgotten Legacy, Oath of Allegiance, Palms amid Blue Dunes, Carved in Stone, The Rod of Justice
Modification: Unit Color Changer, Unit Color Variation