1.14 colors...

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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.
enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

1.14 colors...

Post by enclave » May 3rd, 2018, 12:47 am

Hi, I'm sorry I'm not sure if I ask something new, or it's something that was discussed with 1.13 developers..

Basically after porting my mod from 1.12 to 1.14 most things seems to work..
But huge huge huge huge huge problems are with visual sides of game..
bad markups, ~ symbols and wrong or magenta colors...

In 1.12 I could do something like this:
units/human-peasants/peasant.png~RC(magenta>250,250,0)
The peasant would become yellow...
Now in 1.14 it doesn't work, it has to be a number or some kind of "darkred" word (there is no yellow there, so it's definitely limited in shades)
My question is not how... my question is why? Why it works like this now? Do I have to draw my own units now if I want them to be yellow? I still can make units yellow if I want.. it will just need 10 times more efford, but I can.. So it doesn't stop anyone use different colors if they want.. So question is onyl why make our life so difficult?

Thank you..

User avatar
vultraz
Community Manager
Posts: 953
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: 1.14 colors...

Post by vultraz » May 3rd, 2018, 1:43 am

This looks like an unintentional change. I'll probably have a fix in the next patch. In the meantime, you can use hex color codes (fafa00 is the one for your yellow, and I confirmed that units/human-peasants/peasant.png~RC(magenta>fafa00) works.
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?

enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

Re: 1.14 colors...

Post by enclave » May 3rd, 2018, 12:02 pm

Yeah, that indeed works, I was sure I tried it this way, but I guess I put "fafa00" in quotes... which didnt work obviously :D
Then there is no problem, since for me it doesn't matter if I have to change a bunch of code, as long as there is easy alternative with same functionality.

I only posted this here to be honest, only to mention that there is such incompatibility, however it is strange that nobody mentioned it before..
So just in case I will also say that side.color now can only be a string like "red" and it will not accept numbers like "1", not sure if it was intentional, I don't mind the new reality at all, but just letting you know if it wasnt intentional either.

Thanks very much.

User avatar
vultraz
Community Manager
Posts: 953
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: 1.14 colors...

Post by vultraz » May 3rd, 2018, 1:24 pm

I'm almost certain last I tested color=1 did work...
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?

enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

Re: 1.14 colors...

Post by enclave » May 3rd, 2018, 2:04 pm

yeah I think for ~RC ad other functions it does.
I mean if you do [store_side] variable=Sside and then you put

Code: Select all

[if]
[variable]
name=Sside.color
equals=1
[/variable]
[then]
[/then]
[/if]
it will not understand it, because it expects "red" as Sside.color (unlike in wesnoth 1.12, where it could understand both red and 1)

User avatar
Ravana
Forum Moderator
Posts: 2261
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: 1.14 colors...

Post by Ravana » May 3rd, 2018, 2:38 pm

That is expected, you should use or.

enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

Re: 1.14 colors...

Post by enclave » May 3rd, 2018, 4:20 pm

Hi Ravana, sorry how using [or] would help?
I don't mind if that is expected... Question is only, did somebody make a decision that it is expected, or it happened by accident that this is expected in 1.14
Because if it was accident then it could be fixed, and if it was fixed then porting mods from 1.12 to 1.14 would be much easier, because it would require no modifications. That s my only concern, I don't care about my own mod, I think about all others that may never be ported due to "it needs too much afford" instead of just copy paste the folder and upload.
Question is also, are you happy that some mods will never be ported? Or it is concerning you somehow, maybe a little bit?

User avatar
Ravana
Forum Moderator
Posts: 2261
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: 1.14 colors...

Post by Ravana » May 3rd, 2018, 4:26 pm

It is expected that wml variable has one value, not multiple. https://github.com/ProditorMagnus/Color ... d.cfg#L126 handle color name and its index in same way.

enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

Re: 1.14 colors...

Post by enclave » May 3rd, 2018, 4:40 pm

y i agree that this is how it should work ;) in a perfect world.

User avatar
Celtic_Minstrel
Developer
Posts: 1560
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: 1.14 colors...

Post by Celtic_Minstrel » May 4th, 2018, 12:07 am

You shouldn't be using numeric side colours in any case, so in most cases it should be safe to only test for "red" and not "1".
Author of The Black Cross of Aleron campaign and Default++ era.
Maintainer of Steelhive.

enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

Re: 1.14 colors...

Post by enclave » May 4th, 2018, 12:41 am

yeah i agree with you all, only saying that in 1.12 it was working both ways.

User avatar
Ravana
Forum Moderator
Posts: 2261
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: 1.14 colors...

Post by Ravana » May 4th, 2018, 1:02 am

I dont believe that. Going to test.

Using 1.12.5.
Store side - lua wesnoth.fire("store_side", {})
Compare color to red - no message - lua wesnoth.fire("if", {T.variable{name="side[0].color", equals="red"},T["then"]{T.message{}}})
Compare color to 1 - message - lua wesnoth.fire("if", {T.variable{name="side[0].color", equals="1"},T["then"]{T.message{}}})

So they are not same even there.

enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

Re: 1.14 colors...

Post by enclave » May 4th, 2018, 11:58 am

Ravana wrote:
May 4th, 2018, 1:02 am
I dont believe that. Going to test.

Using 1.12.5.
Store side - lua wesnoth.fire("store_side", {})
Compare color to red - no message - lua wesnoth.fire("if", {T.variable{name="side[0].color", equals="red"},T["then"]{T.message{}}})
Compare color to 1 - message - lua wesnoth.fire("if", {T.variable{name="side[0].color", equals="1"},T["then"]{T.message{}}})

So they are not same even there.
Sorry I didn't understand the conclusion of your post :D You believe it now or not? :) Because it definitely worked for me :)
Not that it's really matters lol.. not going to argue about it with anyone :D

User avatar
Ravana
Forum Moderator
Posts: 2261
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: 1.14 colors...

Post by Ravana » May 4th, 2018, 12:57 pm

Test showed it did not work the way you described.

enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

Re: 1.14 colors...

Post by enclave » May 4th, 2018, 4:40 pm

well thats, strange because thats a working code of 1.12:

Code: Select all

#define QC_COLORS
[store_side]
variable=all_sides
[/store_side]
{FOREACH all_sides i}
[switch]
variable=all_sides[$i].color
[case]
value=1
{VARIABLE player[$all_sides[$i].side].color red}
{VARIABLE player[$all_sides[$i].side].color_cs "-50,-250,-250"}
{VARIABLE player[$all_sides[$i].side].color_rc "255,0,0"}
{VARIABLE player[$all_sides[$i].side].color_city "-50,-250,-250"}
{VARIABLE player[$all_sides[$i].side].team_name $all_sides[$i].team_name}
{VARIABLE player[$all_sides[$i].side].name $all_sides[$i].name}
{VARIABLE player[$all_sides[$i].side].colorname "#FF5555"}
[/case]
[case]
value=2
{VARIABLE player[$all_sides[$i].side].color blue}
{VARIABLE player[$all_sides[$i].side].color_cs "-250,-250,-50"}
{VARIABLE player[$all_sides[$i].side].color_rc "80,100,255"}
{VARIABLE player[$all_sides[$i].side].color_city "0,100,255"}
{VARIABLE player[$all_sides[$i].side].team_name $all_sides[$i].team_name}
{VARIABLE player[$all_sides[$i].side].name $all_sides[$i].name}
{VARIABLE player[$all_sides[$i].side].colorname "#6666FF"}
[/case]
[case]
value=3
{VARIABLE player[$all_sides[$i].side].color green}
{VARIABLE player[$all_sides[$i].side].color_cs "-250,-50,-250"}
{VARIABLE player[$all_sides[$i].side].color_rc "0,255,0"}
{VARIABLE player[$all_sides[$i].side].color_city "-250,-50,-250"}
{VARIABLE player[$all_sides[$i].side].team_name $all_sides[$i].team_name}
{VARIABLE player[$all_sides[$i].side].name $all_sides[$i].name}
{VARIABLE player[$all_sides[$i].side].colorname "#55FF55"}
[/case]
[case]
value=4
{VARIABLE player[$all_sides[$i].side].color purple}
{VARIABLE player[$all_sides[$i].side].color_cs "150,0,150"}
{VARIABLE player[$all_sides[$i].side].color_rc "255,0,255"}
{VARIABLE player[$all_sides[$i].side].color_city "175,70,175"}
{VARIABLE player[$all_sides[$i].side].team_name $all_sides[$i].team_name}
{VARIABLE player[$all_sides[$i].side].name $all_sides[$i].name}
{VARIABLE player[$all_sides[$i].side].colorname "#B266FF"}
[/case]
[case]
value=5
{VARIABLE player[$all_sides[$i].side].color black}
{VARIABLE player[$all_sides[$i].side].color_cs "-150,-150,-150"}
{VARIABLE player[$all_sides[$i].side].color_rc "80,80,80"}
{VARIABLE player[$all_sides[$i].side].color_city "-150,-150,-150"}
{VARIABLE player[$all_sides[$i].side].team_name $all_sides[$i].team_name}
{VARIABLE player[$all_sides[$i].side].name $all_sides[$i].name}
{VARIABLE player[$all_sides[$i].side].colorname "#656565"}
## 172,172.172
[/case]
[case]
value=6
{VARIABLE player[$all_sides[$i].side].color brown}
{VARIABLE player[$all_sides[$i].side].color_cs "-100,-150,-250"}
{VARIABLE player[$all_sides[$i].side].color_rc "180,80,0"}
{VARIABLE player[$all_sides[$i].side].color_city "-100,-150,-250"}
{VARIABLE player[$all_sides[$i].side].team_name $all_sides[$i].team_name}
{VARIABLE player[$all_sides[$i].side].name $all_sides[$i].name}
{VARIABLE player[$all_sides[$i].side].colorname "#994400"}
[/case]
[case]
value=7
{VARIABLE player[$all_sides[$i].side].color orange}
{VARIABLE player[$all_sides[$i].side].color_cs "-50,-150,-250"}
{VARIABLE player[$all_sides[$i].side].color_rc "255,110,0"}
{VARIABLE player[$all_sides[$i].side].color_city "-50,-150,-250"}
{VARIABLE player[$all_sides[$i].side].team_name $all_sides[$i].team_name}
{VARIABLE player[$all_sides[$i].side].name $all_sides[$i].name}
{VARIABLE player[$all_sides[$i].side].colorname "#FF9933"}
[/case]
[case]
value=8
{VARIABLE player[$all_sides[$i].side].color white}
{VARIABLE player[$all_sides[$i].side].color_cs "150,150,150"}
{VARIABLE player[$all_sides[$i].side].color_rc "255,255,255"}
{VARIABLE player[$all_sides[$i].side].color_city "200,200,200"}
{VARIABLE player[$all_sides[$i].side].team_name $all_sides[$i].team_name}
{VARIABLE player[$all_sides[$i].side].name $all_sides[$i].name}
{VARIABLE player[$all_sides[$i].side].colorname "#BBBBBB"}
[/case]
[case]
value=9
{VARIABLE player[$all_sides[$i].side].color teal}
{VARIABLE player[$all_sides[$i].side].color_cs "-250,-50,-50"}
{VARIABLE player[$all_sides[$i].side].color_rc "0,255,255"}
{VARIABLE player[$all_sides[$i].side].color_city "-250,-50,-50"}
{VARIABLE player[$all_sides[$i].side].team_name $all_sides[$i].team_name}
{VARIABLE player[$all_sides[$i].side].name $all_sides[$i].name}
{VARIABLE player[$all_sides[$i].side].colorname "#00AAAA"}
[/case]
[/switch]
{NEXT i}
{CLEAR_VARIABLE all_sides}
#enddef
Which stopped working in 1.14 so I had to change it into:

Code: Select all

#define QC_COLORS
[store_side]
variable=all_sides
[/store_side]
{FOREACH all_sides i}
[switch]
variable=all_sides[$i].color
[case]
value="red"
{VARIABLE player[$all_sides[$i].side].color red}
{VARIABLE player[$all_sides[$i].side].color_cs "-50,-250,-250"}
{VARIABLE player[$all_sides[$i].side].color_rc "255,0,0"}
{VARIABLE player[$all_sides[$i].side].color_city "-50,-250,-250"}
{VARIABLE player[$all_sides[$i].side].team_name $all_sides[$i].team_name}
{VARIABLE player[$all_sides[$i].side].name $all_sides[$i].current_player}
{VARIABLE player[$all_sides[$i].side].colorname "#FF5555"}
[/case]
[case]
value="blue"
{VARIABLE player[$all_sides[$i].side].color blue}
{VARIABLE player[$all_sides[$i].side].color_cs "-250,-250,-50"}
{VARIABLE player[$all_sides[$i].side].color_rc "80,100,255"}
{VARIABLE player[$all_sides[$i].side].color_city "0,100,255"}
{VARIABLE player[$all_sides[$i].side].team_name $all_sides[$i].team_name}
{VARIABLE player[$all_sides[$i].side].name $all_sides[$i].current_player}
{VARIABLE player[$all_sides[$i].side].colorname "#6666FF"}
[/case]
[case]
value="green"
{VARIABLE player[$all_sides[$i].side].color green}
{VARIABLE player[$all_sides[$i].side].color_cs "-250,-50,-250"}
{VARIABLE player[$all_sides[$i].side].color_rc "0,255,0"}
{VARIABLE player[$all_sides[$i].side].color_city "-250,-50,-250"}
{VARIABLE player[$all_sides[$i].side].team_name $all_sides[$i].team_name}
{VARIABLE player[$all_sides[$i].side].name $all_sides[$i].current_player}
{VARIABLE player[$all_sides[$i].side].colorname "#55FF55"}
[/case]
[case]
value="purple"
{VARIABLE player[$all_sides[$i].side].color purple}
{VARIABLE player[$all_sides[$i].side].color_cs "150,0,150"}
{VARIABLE player[$all_sides[$i].side].color_rc "255,0,255"}
{VARIABLE player[$all_sides[$i].side].color_city "175,70,175"}
{VARIABLE player[$all_sides[$i].side].team_name $all_sides[$i].team_name}
{VARIABLE player[$all_sides[$i].side].name $all_sides[$i].current_player}
{VARIABLE player[$all_sides[$i].side].colorname "#B266FF"}
[/case]
[case]
value="black"
{VARIABLE player[$all_sides[$i].side].color black}
{VARIABLE player[$all_sides[$i].side].color_cs "-150,-150,-150"}
{VARIABLE player[$all_sides[$i].side].color_rc "80,80,80"}
{VARIABLE player[$all_sides[$i].side].color_city "-150,-150,-150"}
{VARIABLE player[$all_sides[$i].side].team_name $all_sides[$i].team_name}
{VARIABLE player[$all_sides[$i].side].name $all_sides[$i].current_player}
{VARIABLE player[$all_sides[$i].side].colorname "#656565"}
## 172,172.172
[/case]
[case]
value="brown"
{VARIABLE player[$all_sides[$i].side].color brown}
{VARIABLE player[$all_sides[$i].side].color_cs "-100,-150,-250"}
{VARIABLE player[$all_sides[$i].side].color_rc "180,80,0"}
{VARIABLE player[$all_sides[$i].side].color_city "-100,-150,-250"}
{VARIABLE player[$all_sides[$i].side].team_name $all_sides[$i].team_name}
{VARIABLE player[$all_sides[$i].side].name $all_sides[$i].current_player}
{VARIABLE player[$all_sides[$i].side].colorname "#994400"}
[/case]
[case]
value="orange"
{VARIABLE player[$all_sides[$i].side].color orange}
{VARIABLE player[$all_sides[$i].side].color_cs "-50,-150,-250"}
{VARIABLE player[$all_sides[$i].side].color_rc "255,110,0"}
{VARIABLE player[$all_sides[$i].side].color_city "-50,-150,-250"}
{VARIABLE player[$all_sides[$i].side].team_name $all_sides[$i].team_name}
{VARIABLE player[$all_sides[$i].side].name $all_sides[$i].current_player}
{VARIABLE player[$all_sides[$i].side].colorname "#FF9933"}
[/case]
[case]
value="white"
{VARIABLE player[$all_sides[$i].side].color white}
{VARIABLE player[$all_sides[$i].side].color_cs "150,150,150"}
{VARIABLE player[$all_sides[$i].side].color_rc "255,255,255"}
{VARIABLE player[$all_sides[$i].side].color_city "200,200,200"}
{VARIABLE player[$all_sides[$i].side].team_name $all_sides[$i].team_name}
{VARIABLE player[$all_sides[$i].side].name $all_sides[$i].current_player}
{VARIABLE player[$all_sides[$i].side].colorname "#BBBBBB"}
[/case]
[case]
value="teal"
{VARIABLE player[$all_sides[$i].side].color teal}
{VARIABLE player[$all_sides[$i].side].color_cs "-250,-50,-50"}
{VARIABLE player[$all_sides[$i].side].color_rc "0,255,255"}
{VARIABLE player[$all_sides[$i].side].color_city "-250,-50,-50"}
{VARIABLE player[$all_sides[$i].side].team_name $all_sides[$i].team_name}
{VARIABLE player[$all_sides[$i].side].name $all_sides[$i].current_player}
{VARIABLE player[$all_sides[$i].side].colorname "#00AAAA"}
[/case]
[/switch]
{NEXT i}
{CLEAR_VARIABLE all_sides}
#enddef
Not sure what's wrong with what then.. :) Its always possible that I'm wrong though.. Sorry if it confuses anyone =]
Please don't tell me that it doesnt have to rely on color :D I don't know why I coded it this way ages ago :) Code is not perfect, but it worked for some reason :)

Post Reply