Page 1 of 1

[1.8.4 - 1.9pre-639] bug : parsing Player.DamageScreenColor

Posted: Sun May 25, 2014 0:36
by ivan
Hi!
Adding a damage screen color to my custom player:

Code: Select all

Actor NewDoomPlayer : Doomplayer
{
   Player.DamageScreenColor "400000", 1.0, "FleshPunch"
}
gzdoom fails to start and drops the next error:

Code: Select all

Script error, "MOD.PK3:actors/players/doomplayer.dad" line 12:
SC_GetNumber: Bad numeric constant "1.0".
But if I change the previous color by an obvious hexadecimal number:

Code: Select all

Actor NewDoomPlayer : Doomplayer
{
   Player.DamageScreenColor "3F0000", 1.0, "FleshPunch"
}
or if I split the color components:

Code: Select all

Actor NewDoomPlayer : Doomplayer
{
   Player.DamageScreenColor "40 00 00", 1.0, "FleshPunch"
}
it works as expected.

It seems the parser takes "400000" for something different of a valid hex number and the process fails in the next token.

Re: [1.8.4 - 1.9pre-639] bug : parsing Player.DamageScreenCo

Posted: Sun May 25, 2014 9:05
by Graf Zahl
This is a known limitation of the parser. You can specify colors as three integers separated by a comma. And since "400000" is a decimal number this case will be triggered.
Valid formats for color are:

rrr, ggg, bbb
"rr gg bb"
"symbolicColorName"

"rrggbb" is not supported and only works in a few cases because the internal color name parser can handle this form.

Re: [1.8.4 - 1.9pre-639] bug : parsing Player.DamageScreenCo

Posted: Sun May 25, 2014 15:27
by ivan
Ok, thanks. The wiki is not very specific at this.

Re: [1.8.4 - 1.9pre-639] bug : parsing Player.DamageScreenCo

Posted: Mon May 26, 2014 15:05
by Gez
Doesn't "0x400000" work?

Re: [1.8.4 - 1.9pre-639] bug : parsing Player.DamageScreenCo

Posted: Mon May 26, 2014 19:25
by Graf Zahl
It probably won't. That will also be recognized as a valid number and trigger the 3-bytes-mode.