Modding:Code page 437: Difference between revisions

1,258 bytes added ,  01:43, 8 August 2022
(updated with info about decimal codes less than 100)
 
(16 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[Category:Modding]]{{Modding Info}}{{Missing info|More testing needed. Are there other codes that do not follow 437 conventions? If the intended 437 code is used for these irregular symbols, does it still work?}}
[[Category:Modding Resources]]{{Modding Info}}{{Missing info|More testing needed. Are there other codes that do not follow 437 conventions? If the intended 437 code is used for these irregular symbols, does it still work?}}
In Qud, there are certain symbols that are used in the game strings that take the form of <code>\u0000</code>, where <code>0</code> is any digit in hexadecimal. This code does not represent the character in unicode, rather the code page 437 on old IBM pcs. The game also uses the escape code <code>&#000;</code>, where <code>0</code> is any digit in decimal in its XML files. Any numbers less than 3 digits are padded from the left with <code>x</code>. Below is the table of the entire codepage. For more information, see Wikipedia's own page about [https://en.wikipedia.org/wiki/Code_page_437 Code page 437].
In Qud, there are certain symbols that are used in the game strings that take the form of <code>\u0000</code>, where <code>0</code> is any digit in hexadecimal. In XML, this also takes the form of <code>&#x00;</code>, where the <code>0</code> is any digit in hexadecimal (Single digit hexadecimal will not be padded or have trailing 0s Ex: <code>&#x4;</code>). This code does not represent the character in unicode, rather the code page 437 on old IBM pcs.  
 
The game also uses the escape code <code>&#000;</code>, where <code>0</code> is any digit in decimal in its XML files. Below is the table of the entire codepage. For more information, see Wikipedia's own page about [https://en.wikipedia.org/wiki/Code_page_437 Code page 437].


__TOC__
__TOC__
Line 6: Line 8:
==Table==
==Table==
{| class="wikitable" style="font-family:Source Code Pro, Lucida Console, Consolas; "
{| class="wikitable" style="font-family:Source Code Pro, Lucida Console, Consolas; "
! style="padding: 0.8em 0.2em;" | \u00__
! style="padding: 0.8em 0.2em;" | \x__
! _0
! _0
! _1
! _1
Line 317: 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 <code>"\x03"</code>, and in the XML <code>&x03;</code>.
<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: Colors & Object Rendering]].


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


==Unconventional Codes==
In xml:
The following escape codes do not follow the regular code page 437 codes.


{| class = "wikitable"
{| class = "wikitable"
Line 349: Line 350:
! String
! String
! Usage
! Usage
|-
| {{Color | r | ♥}}
| <code><nowiki>{{r|&#x3;}}</nowiki></code>
| HP or Damage
|-
| {{Color | c | →}}
| <code><nowiki>{{c|&#x1A;}}</nowiki></code>
| Penetration, or slipping
|-
| {{Color | b | ♦}}
| <code><nowiki>{{b|&#x4;}}</nowiki></code>
| Armor value
|-
| {{Color | C | ¢}}
| <code><nowiki>{{C|&#x9b;}}</nowiki></code>
| Cybernetics credit wedge
|}
==Remarks==
You may also see the following escape sequences used in some places. They map indirectly to particular code page 437 values based on their underlying ASCII character value.
{| class = "wikitable"
! In Game
! String
! Usage
! Notes
|-
|-
| {{Color | K | ο}}
| {{Color | K | ο}}
| &K\t
| <code><nowiki>{{K|\t}}</nowiki></code>
| Dodge symbol
| Dodge symbol
| This works because <code>\t</code> stands for the TAB character, which has an ASCII character code of 9. Thus, it maps to code page 437 \x09.
|-
|-
| {{Color | c | }}
| {{Color | G | }}
| &c\a
| <code><nowiki>{{G|\a}}</nowiki></code>
| Lase
| Blocked attack blip<br>(among other things)
| This works because <code>\a</code> stands for the BEL character, which has an ASCII character code of 7. Thus, it maps to code page 437 \x07.
|}
|}
{{Modding Navbox}}