Is a missing # in a color tag an error?

Forum organization and occasional community-building.
Forum rules
Questions about Ren'Py should go in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
span4ev
Regular
Posts: 105
Joined: Fri Jul 08, 2022 9:29 pm
itch: rpymc
Contact:

Is a missing # in a color tag an error?

#1 Post by span4ev »

I accidentally discovered that in one game in the original scripts there are almost two hundred tags with a missing # character after the equal sign. It looked like this:
{color=fff}
However, there has never been an exception in the entire game.
Does this mean that this error is not critical?
I also found a string with unclosed {i} tags in the translation files.
"{i} word {i}"

I'm surprised that Renpy doesn't consider this to be an error leading to an exception.

User avatar
ISAWHIM
Veteran
Posts: 318
Joined: Sun Nov 06, 2016 5:34 pm
Contact:

Re: Is a missing # in a color tag an error?

#2 Post by ISAWHIM »

It is a compressed version of HEX code, which is valid.

The # sign is just ALSO valid too... It is more for humans reading the values, to easily identify them, in code, as a hex-value triplet for RGB.

#FFFFFF and FFFFFF and FFF are all the same. (I don't know if just "F" is the same, but in other languages, that counts as #FFFFFF, as a compressed triplet value.)

The {i} is a text-specific "substitution", which doesn't require escaping, if it is within displayable text, unless you want the "{i}" to appear as "{i}", within the text display and NOT make the text italic. I think you can even make your own custom replacements for text too. Unlike the [name] replacements... I think it just toggles in then out, like a "switch", without a needed {/i}, if that is what you are saying... Since it would not exist any other way, that is a "safe" switch to assume. You would not repeat {i}, after {i}, to make double-italics. The only option after that, is escape. So I think that was simplified to just not be "required", to save a key-stroke. :P But, for visual ease, it CAN be added, for the programmer to "see".
https://www.renpy.org/doc/html/text.html

HTML is the same way now, to a point. You HAD to terminate <SOMETAG> with </SOMETAG>, but a hack led to termination being OK, as </> or as </ >... Now that is a standard way to end most things, in-order.

Post Reply

Who is online

Users browsing this forum: No registered users