Modding:Code page 437: Difference between revisions

recommend {{color|text}} and \x over \u
(Moves to Modding Resources category)
(recommend {{color|text}} and \x over \u)
Line 319: Line 319:


==Example Codes in Qud==
==Example Codes in Qud==
In most cases, the strings are added as
To use one of these characters in a name or description in game, you may need to escape them.  For instance, to get the ♥, in C# you would use <syntaxhighlight lang="c#">"\x03"</syntaxhighlight>, and in the XML <sytaxhighlight lang="xml">&x03;</syntaxhighlight>.
<syntaxhighlight lang="c#">str.Append(color code).Append(escape code for symbol)</syntaxhighlight> Where <code>str</code> is an object of the <code>StringBuilder</code> class. For more info about Caves of Qud's color code, check out [[Modding: Text Color Codes & Object Rendering]].
In most cases, the strings are added with color codes, so here are some examples of that. For more info about Caves of Qud's color code, check out [[Modding: Text Color Codes & Object Rendering]].


{| class = "wikitable"
{| class = "wikitable"
Line 328: Line 328:
|-
|-
| {{Color | r | ♥}}
| {{Color | r | ♥}}
| &r\u0003
| &x7b;&x7b;r|\x03&x7c;&x7c;
| HP or Damage
| HP or Damage
|-
|-
| {{Color | c | →}}
| {{Color | c | →}}
| &c\u001a
| &x7b;&x7b;c|\x1a&x7c;&x7c;
| Penetration, or slipping
| Penetration, or slipping
|-
|-
| {{Color | b | ♦}}
| {{Color | b | ♦}}
| &b\u0004
| &x7b;&x7b;b|\x04&x7c;&x7c;
| Armor value
| Armor value
|-
|-
| {{Color | C | ¢}}
| {{Color | C | ¢}}
| &C\u009b
| &x7b;&x7b;C|\x9b&x7c;&x7c;
| Cybernetics credit wedge
| Cybernetics credit wedge
|}
|}
Line 352: Line 352:
|-
|-
| {{Color | r | ♥}}
| {{Color | r | ♥}}
| <nowiki>&amp;r&#x3;</nowiki>
| <nowiki>{{r|&#x3;}}</nowiki>
| HP or Damage
| HP or Damage
|-
|-
| {{Color | c | →}}
| {{Color | c | →}}
| <nowiki>&amp;c&#x1A;</nowiki>
| <nowiki>{{c|&#x1A;}}</nowiki>
| Penetration, or slipping
| Penetration, or slipping
|-
|-
| {{Color | b | ♦}}
| {{Color | b | ♦}}
| <nowiki>&amp;b&#x4</nowiki>
| <nowiki>{{b|&#x4;}}</nowiki>
| Armor value
| Armor value
|-
|-
| {{Color | C | ¢}}
| {{Color | C | ¢}}
| <nowiki>&amp;C&#x9b;</nowiki>
| <nowiki>{{C|&#x9b;}}</nowiki>
| Cybernetics credit wedge
| Cybernetics credit wedge
|}
|}