Modding:Colors & Object Rendering: Difference between revisions

From Caves of Qud Wiki
Jump to navigation Jump to search
(→‎Additional Notes: added note about beta content)
 
(19 intermediate revisions by 7 users not shown)
Line 1: Line 1:
[[Category:Modding]]{{Modding Info}}
[[Category:Modding Resources]]{{Modding Info}}
= Overview =
= Overview =
Colors are defined in display.text.
Colors are defined in <code>Display.txt</code>.


Each color is defined by a single letter. &<nowiki><code> means to set the foreground color, ^<code> means to set the background color.</nowiki>
Each color is defined by a single letter. <code><nowiki>&</nowiki></code> means to set the foreground color, <code>^</code> means to set the background color.


Only the preset letter codes are allowed, adding new colors isn't totally trivial at the moment.
Only the preset letter codes are allowed, adding new colors isn't totally trivial at the moment.
{{Color Table}}
{{Color Table}}
To get a palette file for these colors, refer to [[Visual_Style#Palette]].
In XML files, such as ObjectBlueprints.xml, the ampersand (&) must be replaced by the encoded ampersand (&amp;amp;)
In XML files, such as ObjectBlueprints.xml, the ampersand (&) must be replaced by the encoded ampersand (&amp;amp;)
{| class="wikitable tablesorter tablesorter-default stickyTableHeaders"
{| class="wikitable tablesorter tablesorter-default stickyTableHeaders"
Line 24: Line 26:
= Render Part =
= Render Part =
ColorString contains the foreground and (optionally) the background string for the ascii and tiles. Examples: <code>&B</code> or <code>&B^r</code>
ColorString contains the foreground and (optionally) the background string for the ascii and tiles. Examples: <code>&B</code> or <code>&B^r</code>
TileColor is identical to ColorString, but applies only to tiles. If this is not specified, a tile falls back to using the ColorString.


DetailColor changes the "third" color used only for tiles, not the ascii. DetailColor is always just a single character. Example: <code>g</code>  
DetailColor changes the "third" color used only for tiles, not the ascii. DetailColor is always just a single character. Example: <code>g</code>  
Line 29: Line 33:
So <code>ColorString="&M^g"</code> would be foreground bright magenta with a background color of green,
So <code>ColorString="&M^g"</code> would be foreground bright magenta with a background color of green,
{{qud char|&amp;M^g|Like this}}!
{{qud char|&amp;M^g|Like this}}!
TileColor overrides ColorString when tiles are being used.


If you want to color an item's display name, you enter color codes directly in the display name itself, for example the beaded bracelet:
If you want to color an item's display name, you enter color codes directly in the display name itself, for example the beaded bracelet:
Line 36: Line 39:
<part Name="Render" DisplayName="&amp;Cb&amp;Be&amp;ba&amp;cd&amp;Ce&amp;Bd&amp;y bracelet" ColorString="&amp;C"></part>
<part Name="Render" DisplayName="&amp;Cb&amp;Be&amp;ba&amp;cd&amp;Ce&amp;Bd&amp;y bracelet" ColorString="&amp;C"></part>
</syntaxhighlight>
</syntaxhighlight>
The [https://qud-colorgen.herokuapp.com/ qud-colorgen] utility (created by crayon) is an external tool that can help you create these complex color strings, however the newer Markup language the game uses might be good enough for your purposes.


Note that if a detail color is not specified, it will default to the background viridian color.
Note that if a detail color is not specified, it will default to the background viridian color.


== Additional notes ==
== Color Markup Language ==
Most default text in the game is colored with the bright grey (&y) color, so you'll often see an <code>&y</code> at the end of strings to reset the color back to normal.
Most default text in the game is colored grey (&y), so you'll often see an <code>&y</code> at the end of strings to reset the color back to normal. When putting strings using the basic color codes together to make sentences extremely confusing color bleed becomes possible.  Because of this there is new system which parses text in double curly braces: <code><nowiki>{{color|text}}</nowiki></code>.  If you want to ensure colors "return" to what they were set to, you can leave out the color.  <code><nowiki>"{{|&RThis text is red}} and this will be whatever the color was before red"</nowiki></code>


For help formatting a string with colors, check out the super-useful [https://qud-colorgen.herokuapp.com/ qud-colorgen] utility (created by crayon).
In general, every string for rendering, except the color string/detail color on render part should use the new Markup language.


== Beta Modding ==
Text can also be colored as follows using any of the color templates defined in StreamingAssets\Base\Colors.xml.
{{betamoddingcontent}}
<pre>
Text can also be colored as follows using any of the color templates defined in StreamingAssets\Base\Colors.xml<syntaxhighlight>
{{color template|your text to color here}}
{{color template|your text to color here}}
</syntaxhighlight>
</pre>
=== List of possible templates ===
{{#invoke:ColorParse|shaderlist}}
 
=== Anonymous Templates ===
To create a temporary template, the format is: <pre>{{[color pattern delimited by -] [type]|[text]}}</pre>
 
For example:<pre>{{R-R-R-R-R-M-M sequence|mumble mouth}}</pre>
 
The list of possible types are:
{| class = "wikitable"
!Type
!Pattern
!Example
|-
|sequence
| repeats the pattern.
| {{Qud shader|blaze|texttexttexttext}}
|-
| alternation
| stretches the pattern so it fits the entire word.
| {{Qud shader|ghostly|texttexttexttext}}
|-
| chaotic
| chooses colors randomly out of the colors specified.
|
|-
| bordered
|
| {{qud shader|horned|texttexttexttext}}
|}


=See Also=
=See Also=

Latest revision as of 01:57, 8 August 2022

This page is about modding. See the modding overview for an abstract on modding.
This page is about modding. See the modding overview for an abstract on modding.

Overview

Colors are defined in Display.txt.

Each color is defined by a single letter. & means to set the foreground color, ^ means to set the background color.

Only the preset letter codes are allowed, adding new colors isn't totally trivial at the moment.

Code Name Hex
r dark red / crimson #a64a2e
R red / scarlet #d74200
o dark orange #f15f22
O orange #e99f10
w brown #98875f
W gold / yellow #cfc041
g dark green #009403
G green #00c420
b dark blue #0048bd
B blue / azure #0096ff
c dark cyan / teal #40a4b9
C cyan #77bfcf
m dark magenta / purple #b154cf
M magenta #da5bd6
k #0f3b3a
K dark grey / black #155352
y grey #b1c9c3
Y white #ffffff

To get a palette file for these colors, refer to Visual_Style#Palette.

In XML files, such as ObjectBlueprints.xml, the ampersand (&) must be replaced by the encoded ampersand (&amp;)

Prefix Text Xml
Foreground &<code> &amp;<code>
Background ^<code> ^<code>

Render Part

ColorString contains the foreground and (optionally) the background string for the ascii and tiles. Examples: &B or &B^r

TileColor is identical to ColorString, but applies only to tiles. If this is not specified, a tile falls back to using the ColorString.

DetailColor changes the "third" color used only for tiles, not the ascii. DetailColor is always just a single character. Example: g

So ColorString="&M^g" would be foreground bright magenta with a background color of green, Like this!

If you want to color an item's display name, you enter color codes directly in the display name itself, for example the beaded bracelet:

<part Name="Render" DisplayName="&amp;Cb&amp;Be&amp;ba&amp;cd&amp;Ce&amp;Bd&amp;y bracelet" ColorString="&amp;C"></part>

The qud-colorgen utility (created by crayon) is an external tool that can help you create these complex color strings, however the newer Markup language the game uses might be good enough for your purposes.

Note that if a detail color is not specified, it will default to the background viridian color.

Color Markup Language

Most default text in the game is colored grey (&y), so you'll often see an &y at the end of strings to reset the color back to normal. When putting strings using the basic color codes together to make sentences extremely confusing color bleed becomes possible. Because of this there is new system which parses text in double curly braces: {{color|text}}. If you want to ensure colors "return" to what they were set to, you can leave out the color. "{{|&RThis text is red}} and this will be whatever the color was before red"

In general, every string for rendering, except the color string/detail color on render part should use the new Markup language.

Text can also be colored as follows using any of the color templates defined in StreamingAssets\Base\Colors.xml.

{{color template|your text to color here}}

List of possible templates

ShaderColorsType
hologramb-B-C-csequence
ydfreeholdr-R-k-c-C-W-W-C-c-r-Rsequence
purplemsequence
paisleym-M-Y-M-msequence
biomechw-w-r-r-r-w-r-rsequence
azureBsequence
camouflageg-g-G-g-K-g-g-G-G-Ksequence
rainbowr-R-W-G-B-b-malternation
metamorphicy-y-y-Y-Y-Y-M-M-M-m-m-m-msequence
transkineticY-C-C-c-y-K-K-y-R-W-W-Ysequence
dark redrsequence
ubernostrumc-g-G-W-w-c-C-G-g-w-Wsequence
desert camouflagew-w-W-w-K-w-w-W-W-Ksequence
rocketY-W-R-R-r-yalternation
rubbergumW-W-w-w-y-y-Y-W-Wsequence
visageR-r-b-B-Y-ysequence
snail-encrustedw-W-Y-ysequence
dreamsmokeb-b-b-b-y-Y-Y-W-w-b-b-bsequence
polarizedK-y-Y-y-K-y-Y-y-Kalternation
ironshankK-y-Y-ysequence
goldWsequence
dark fieryr-R-W-R-ralternation
bethsaidaw-W-C-c-m-c-C-W-wsequence
filthyw-w-K-w-K-w-Wsequence
sunW-R-Walternation
pearlyY-Y-ysequence
ciderrsolid
engravedY-y-c-Csequence
coated in plasmaK-K-y-g-G-Y-k-Y-Y-k-Y-G-g-y-K-Ksequence
gaslightg-g-w-W-w-g-galternation
entropicK-K-m-K-K-K-m-m-K-K-ysequence
neutronicB-b-K-y-Ysequence
lanternedy-y-y-y-Y-W-Y-y-yalternation
dark magentamsequence
scarletRsequence
overloadedy-y-w-W-R-W-w-y-yalternation
dark bluebsequence
redRsequence
patchworkW-w-r-R-W-w-b-B-Wsequence
nanotechK-K-y-Ksequence
brainbrineg-g-g-w-W-W-W-w-g-g-gsequence
tealcsequence
beeK-w-W-Y-W-w-Kalternation
cryogenicY-C-C-Y-c-c-K-y-Ysequence
eaterY-Y-M-Y-Y-Ysequence
CCsequence
BBsequence
GGsequence
dark orangeosequence
featheredC-B-b-g-G-g-b-B-Calternation
KKsequence
MMsequence
OOsequence
internalsWsolid
RRsequence
prismaticr-R-W-G-B-b-msequence
WWsequence
lovesicknessr-R-M-m-r-R-Msequence
YYsequence
fieryRsequence
urban camouflagey-y-K-y-K-y-y-K-y-Ksequence
crimsonrsequence
leopardW-W-w-w-W-K-K-w-w-W-Wsequence
glitteringK-K-y-M-y-K-Ksequence
ghostlyY-Y-y-y-K-Kalternation
palladium meshc-c-c-c-C-W-Y-W-Csequence
tarnishedG-G-gsequence
ccsequence
bbsequence
shimmeringY-Y-y-y-K-K-y-ysequence
ggsequence
earthb-B-W-g-Gsequence
kksequence
qonm-b-Bsequence
mmsequence
leafyg-g-Gsequence
oosequence
nectarW-w-g-Gsequence
shugruithK-y-W-w-m-w-W-y-Ksequence
putridKsolid
agolgotK-g-w-m-w-g-Ksequence
rrsequence
plasmag-G-Y-Y-G-gsequence
loveY-R-Y-Ysequence
wwsequence
zetachromem-M-Y-C-c-c-C-Y-M-malternation
yysequence
wateryB-C-Y-C-Balternation
blackKsequence
turbowK-y-Y-Y-R-rsequence
psychalfleshw-w-w-r-R-M-M-m-M-M-R-r-w-w-w-wsequence
yellowWsequence
thermoR-R-r-c-b-B-Bsequence
whiteYsequence
telemetricK-y-c-C-Y-W-C-c-y-Kalternation
metachromew-W-Y-C-c-c-C-Y-W-walternation
tartany-K-g-G-K-R-r-K-ysequence
plastiferK-y-Y-ysequence
psymeridianK-K-y-y-y-m-M-M-M-M-m-y-y-y-K-Ksequence
sunslagr-W-Y-Y-Y-W-rsequence
extradimensionalM-M-m-m-y-y-Y-Y-O-Y-Y-y-m-m-M-Malternation
sunsetb-B-B-M-m-r-R-W-C-C-W-R-r-m-M-B-B-balternation
blazer-r-R-W-Ysequence
structuralY-y-K-y-Yalternation
amorousr-R-M-malternation
starryK-Y-K-K-Y-Ksequence
refractivey-Ysequence
spikedR-Ybordered
sphynxC-c-m-Msequence
spaserK-g-G-G-g-Ksequence
oliveg-g-G-W-wsequence
magentaMsequence
soulW-w-c-C-Y-C-c-w-Walternation
graffitiedR-r-w-W-Y-y-r-R-W-wsequence
snakesking-c-C-Gsequence
slimygsolid
skulkb-b-B-b-bsequence
dark grayKsequence
silveryYsequence
rustyrsequence
playernotesYsolid
greenGsequence
fungicideM-M-R-r-K-r-Rsequence
nervousg-g-w-W-w-g-gsequence
hotkeyWsolid
grayysequence
jungleg-g-w-G-g-m-g-w-w-K-g-m-G-G-wsequence
shemeshr-r-R-R-W-W-Ysequence
cloningY-Y-Y-Y-Y-Y-M-Y-M-Y-Y-Y-Y-Y-Ysequence
lacqueredY-y-K-y-Y-y-K-y-Y-ysequence
shadey-K-c-b-B-y-C-y-Ksequence
scaledg-G-W-w-g-Gsequence
biog-G-W-M-W-G-g-g-g-g-gsequence
rulesCsolid
psionicb-B-C-c-b-B-Calternation
spring-turretc-c-C-C-y-y-y-y-y-C-C-c-csequence
glotrotK-K-r-R-rsequence
mercurialc-c-C-W-Y-W-C-c-calternation
peridotG-g-w-W-Y-W-Gsequence
crystallinem-m-m-b-B-Y-B-b-m-m-msequence
rermadonY-G-g-m-m-g-G-Ysequence
resonancec-c-C-C-W-C-C-c-calternation
crochideg-g-g-g-g-Gsequence
plaidg-K-G-W-Gsequence
syphonc-c-c-C-W-Ysequence
cloudyy-y-Y-y-Y-Ysequence
quantumm-m-m-m-m-m-m-Y-Y-Y-Y-Ysequence
nanoneuror-R-G-g-K-K-g-G-R-r-gsequence
brownwsequence
arctic camouflagey-y-Y-y-K-y-y-Y-Y-Ksequence
astralY-y-K-y-Yalternation
sparklingy-y-Ysequence
kesilm-m-M-Y-ysequence
hypertractorr-R-W-w-c-C-B-bsequence
hornedy-Wbordered
defoliantW-W-G-g-K-g-Gsequence
ninefoldb-Bbordered
sicklyg-r-m-w-K-G-g-c-Ksequence
paintedr-R-W-w-g-G-Bsequence
moonb-B-C-csequence
mirrorshadesK-y-Y-Y-y-Ksequence
dark cyancsequence
dark greengsequence
radiantr-W-Y-Y-Y-W-rsequence
issachariY-Y-Y-Y-Y-Y-rsequence
qasC-c-msequence
lavaRsolid
lahw-W-R-rsequence
normalishy-y-K-y-Y-y-y-y-K-y-Ysequence
kaleidoslugK-C-y-m-M-r-c-C-Y-y-Ksequence
levantr-r-y-y-Y-Ysequence
beylahB-b-g-k-W-R-rsequence
illuminatedc-c-c-C-Y-W-Y-Csequence
icyY-C-B-C-Yalternation
normalK-K-y-y-Y-y-y-K-K-y-K-y-Ysequence
freezingCsequence
blueBsequence
forestg-g-w-G-g-g-w-w-g-G-G-wsequence
emotewsolid
electricalWsequence
dreamyb-b-b-B-M-k-W-M-B-b-b-b-balternation
crysteely-y-K-g-g-K-y-yalternation
phase-harmonicY-y-m-y-Ksequence
chiralB-b-c-C-M-m-k-m-M-C-c-bsequence
implantedr-r-r-r-r-r-r-Csequence
auroralK-g-G-Y-G-g-Ksequence
opalescentY-y-K-K-y-Ysequence
cyanCsequence
otherpearlM-m-y-Y-O-O-Y-y-m-Msequence
orangeOsequence

Anonymous Templates

To create a temporary template, the format is:

{{[color pattern delimited by -] [type]|[text]}}

For example:

{{R-R-R-R-R-M-M sequence|mumble mouth}}

The list of possible types are:

Type Pattern Example
sequence repeats the pattern. texttexttexttext
alternation stretches the pattern so it fits the entire word. texttexttexttext
chaotic chooses colors randomly out of the colors specified.
bordered texttexttexttext

See Also