Advanced Descriptions

From DredMod
Jump to: navigation, search

HTML Encoding

Making flavour text can be very cruel and unforgiving.
What if you wanted to use both quotation marks and a contraction like "don't"? You couldn't, because you need one of them to open and close the string!

We've browsed the game's core files and came to a simple conclusion; As long as you use HTML encoding for special characters, you're good to go.

Using HTML Encoding is easy as 1 2 3 (1 2 3). This table shows some useful codes to use in description texts.

Code Output character Script input Output in-game
A quotation mark text=""You couldn't do this before"." "You couldn't do this before."
An apostrophe text='This would've "CTD'd".' This would've "CTD'd".
A non-breaking space text="This is   some interesting  formatting." This is   some interesting  formatting.

A line break text="Q: Question?
A: Funny punchline." Q: Question?
A: Funny punchline.

  • As you can see, there's several ways to paste the same special character. You can use decimal () or hexadecimal (
) for the same character.
  • Feel free to add more special characters to the table.

File Encoding

To add special characters from another encoding, such as UTF-8, you can change your file encoding. It will run just as well, even though changing file encoding makes your mod files bigger.
This idea in practice can be found at the Russian Translation of Dungeons of Dredmor.