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

Bugs that have been resolved.

Moderator: Graf Zahl

Locked
User avatar
ivan
Posts: 4
Joined: Thu Sep 02, 2010 17:57

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

Post 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.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

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

Post 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.
User avatar
ivan
Posts: 4
Joined: Thu Sep 02, 2010 17:57

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

Post by ivan »

Ok, thanks. The wiki is not very specific at this.
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

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

Post by Gez »

Doesn't "0x400000" work?
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

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

Post by Graf Zahl »

It probably won't. That will also be recognized as a valid number and trigger the 3-bytes-mode.
Locked

Return to “Closed Bugs”