Working on a text-based game in HaxeFlixel, and I’m wondering if there’s a best practice for dealing with the text itself. There’s a lot of it, and it’s full of newlines and quotes and such. I imagine putting it in the actual Haxe script is probably not the best way, since you’d have to use a zillion escape characters? So like maybe a Markdown file where you could tag each text block something appropriate, and then parse it from Haxe?

EDIT: I ended up just keeping all the dialogue in a simple .txt file. I wanted to make adding dialogue as accessible as possible for people with limited computer skills, basically. And it actually turns out that Haxe’s string parsing will handle alllll the escaping for you, so they can pretty much use any characters they want! Except colon (:). They just have to give the dialogue a title inside colons like :this:, and I have it set up to parse the .txt into a dictionary where the titles are the keys and the dialogue is the corresponding value.

  • TheCee@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    Basically a file format in which you can place strings in multiple languages, have a key to insert into your software and have other gizmos like support for plurals etc. I’ll admit, it has been some time since I have used those and hopefully you will find better solutions than gettext.