Catgirls, the WML side
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Catgirls, the WML side
Hello, I'm trying to develop my own factions of catgirls. The art was started and can be found here.
I'm trying to recolor the following sprite with two color ranges. There's the default magenta palette and a new "cyan" palette. I'd like the magenta to be recolored normally to the team color, but on top of that, I'd like the cyan palette to also be recolored to a custom color_range ("Indigo", "Sky Blue" or "Sun Yellow").
Here is the custom team-colors.cfg that define the palette and the color ranges
I linked this file from my _main.cfg of the add-ons (currently named "Feu_Ra") like this:
Then in the `[unit_type]` tag I added the following:
It doesn't seem to work...
Could you help me ?
Many thanks in advance
I'm trying to recolor the following sprite with two color ranges. There's the default magenta palette and a new "cyan" palette. I'd like the magenta to be recolored normally to the team color, but on top of that, I'd like the cyan palette to also be recolored to a custom color_range ("Indigo", "Sky Blue" or "Sun Yellow").
Here is the custom team-colors.cfg that define the palette and the color ranges
Code: Select all
[color_range]
id=indigo
rgb=60219C,FFFFFF,080808,60219C
name= _ "Indigo"
[/color_range]
[color_range]
id=skyblue
rgb=18B8DF,FFFFFF,000510,18B8DF
name= _ "Sky Blue"
[/color_range]
[color_range]
id=sunyellow
rgb=FFDC2D,FFF7DC,893C09,FFDC2D
name= _ "Sun Yellow"
[/color_range]
[+color_palette]
# secondary value used to recolor catgirls
cyan=00FFFF,002424,003636,004545,005252,005E5E,006B6B,007979,008585,009292,00A1A1,00C0C0,00D2D2,00E2E2,00F0F0,30FFFF,60FFFF,91FFFF,C5FFFF
#sorted light-to-dark: C5FFFF,91FFFF,60FFFF,30FFFF,00FFFF,00F0F0,00E2E2,00D2D2,00C0C0,00A1A1,009292,008585,007979,006B6B,005E5E,005252,004545,003636,002424
#sorted dark-to-light: 002424,003636,004545,005252,005E5E,006B6B,007979,008585,009292,00A1A1,00C0C0,00D2D2,00E2E2,00F0F0,00FFFF,30FFFF,60FFFF,91FFFF,C5FFFF
[/color_palette]
Code: Select all
[game_config]
{~add-ons/Feu_Ra/team-colors.cfg}
[/game_config]
Code: Select all
[object]
[effect]
apply_to=image_mod
add=RC(cyan>sunyellow)
[/effect]
[/object]
Many thanks in advance

- Celtic_Minstrel
- Developer
- Posts: 2371
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Catgirls, the WML side
That's not valid.laerne wrote: ↑November 24th, 2024, 1:13 am
Then in the `[unit_type]` tag I added the following:
Code: Select all
[object] [effect] apply_to=image_mod add=RC(cyan>sunyellow) [/effect] [/object]
[object]
is not allowed in [unit_type]
.I'm not quite sure, but you might just be able to write
image_mod=RC(cyan>sunyellow)
without any tags. If that doesn't work you'd need to append ~RC(cyan>sunyellow)
to each of the images, in other words everywhere an image is used in the file (except for the portrait).- beetlenaut
- Developer
- Posts: 2867
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Catgirls, the WML side
You could use that [object] code in an event (I would use a unit_placed event), and the [event] can go in [unit_type].
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: Catgirls, the WML side
Neither method seems to work...
or
Wesnoth does not complain to stdout or stderr when launching from a terminal, even with the `--debug` flag. Is there another log I need to check ? Or is there a console command I can run to list the available color_range and color_palette ?
Code: Select all
[event]
type=unit_placed
[object]
[effect]
apply_to=image_mod
add=RC(cyan>sunyellow)
[/effect]
[/object]
[/event]
Code: Select all
image="units/feu-ra/chakram_fighters/chakram_warrior+TEST.png~RC(cyan>indigo)"
Re: Catgirls, the WML side
Hum, I'm not sure I can define my own color ranges… The wiki says :
Any workaround to add color ranges ? using
Even though I don't know the codebase, I tried to debug a little and indeed it seems there is only one game_config tag, the one inThis tag is a top level WML tag which can only be used once because it defines basic settings that are used everywhere in the game. In official versions of Wesnoth it is in game_config.cfg; values used there are labeled 'standard'.
/usr/share/wesnoth/data/schema/game_config.cfg
...Any workaround to add color ranges ? using
[+game_config]
doesn't seem to work...Re: Catgirls, the WML side
This should be:laerne wrote: ↑November 24th, 2024, 3:18 pmCode: Select all
[event] type=unit_placed [object] [effect] apply_to=image_mod add=RC(cyan>sunyellow) [/effect] [/object] [/event]
Code: Select all
[event]
name=unit_placed
first_time_only=no
[object]
[effect]
apply_to=image_mod
add=RC(cyan>sunyellow)
[/effect]
[/object]
[/event]
Try it without the
[game_config][/game_config]
tags.- beetlenaut
- Developer
- Posts: 2867
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Catgirls, the WML side
You are trying to do too much at once I think. We don't know which part is not working, so we need to guess. I think the event code gnombat provided should work fine as long as it is in the right place, but verify that by using a different image path function in it (GS for example) to make sure that it is working.
Then use RC with core color palettes to verify that it is doing what you want.
Then use RC with a core palette and one of your color ranges to make sure that the range is right.
Then use PAL with your palette and a core one to make sure your palette exists.
When something doesn't work, you will know where the problem is.
Alternatively, you could just post the whole addon, and someone who was bored will mess with it until it works--probably running through steps like the ones above. We can also make sure the code you posted is in the right place. If correct code is in the wrong place, it will look like it did nothing.
Then use RC with core color palettes to verify that it is doing what you want.
Then use RC with a core palette and one of your color ranges to make sure that the range is right.
Then use PAL with your palette and a core one to make sure your palette exists.
When something doesn't work, you will know where the problem is.
Alternatively, you could just post the whole addon, and someone who was bored will mess with it until it works--probably running through steps like the ones above. We can also make sure the code you posted is in the right place. If correct code is in the wrong place, it will look like it did nothing.
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
- Celtic_Minstrel
- Developer
- Posts: 2371
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Catgirls, the WML side
Colour ranges don't need to be inside a
I believe the RC command can also take the full palette definition as its first argument. That is to say, you could copy the list of colours from the palette definition and paste them in place of the word "cyan" in your image mod. That's one other thing you could try in the process of figuring out which piece isn't working.
[game_config]
tag if I recall correctly. I think [color_palette]
does but I'm not 100% sure that custom palettes are actually supported.I believe the RC command can also take the full palette definition as its first argument. That is to say, you could copy the list of colours from the palette definition and paste them in place of the word "cyan" in your image mod. That's one other thing you could try in the process of figuring out which piece isn't working.
Re: Catgirls, the WML side
I have seenCeltic_Minstrel wrote: ↑November 24th, 2024, 8:56 pm Colour ranges don't need to be inside a[game_config]
tag if I recall correctly. I think[color_palette]
does but I'm not 100% sure that custom palettes are actually supported.
[color_palette]
used in UMC.- Celtic_Minstrel
- Developer
- Posts: 2371
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Catgirls, the WML side
Still, dropping the entire palette definition into the RC command is a valid thing to try.
Re: Catgirls, the WML side
Hello.
Moving the [color_range] and [color_palette] outside [game_config] seems to do the trick. The following works.
Mary thanks !
I tried to make the event works as well, to have different colors per unit side, but the filters were very buggy (only one unit affected despite the
As for sharing the mod, I will at some point (likely when I try again to recolor sprites) but it's so bare-bone and messy for now I'd feel bad letting people spend time trying to figure it out. Besides I have to corporately validate open-sourcing anything at work, so it'll take a little time.
Moving the [color_range] and [color_palette] outside [game_config] seems to do the trick. The following works.
Code: Select all
image="units/feu-ra/chakram_fighters/chakram_warrior.png~RC(cyan>sunyellow)"
I tried to make the event works as well, to have different colors per unit side, but the filters were very buggy (only one unit affected despite the
first_time_only=no
, new recruited units didn't work...) I will ask again later when the mod is more fleshed out.As for sharing the mod, I will at some point (likely when I try again to recolor sprites) but it's so bare-bone and messy for now I'd feel bad letting people spend time trying to figure it out. Besides I have to corporately validate open-sourcing anything at work, so it'll take a little time.
Re: Catgirls, the WML side
You give all objects to same unit.