Multilingual Game, loading text from files.

This forum is currently in read-only mode.
From the Asset Store
Source File, music and art pack for Android Negotiator
  • I need help with this.

    I want to load an external file for the text in my game.

    The best way to explain myself is in pseudocode:

    +Start of Layout
    -Load LanguageText file
    
    +*Condition*
    -Set Text to LanguageText file, Line 1
    
    +"Other Condition"
    -Set Text to LanguageText file, Next (or previous) Line
    
    +"Yet Another Condition"
    -Set Text to LanguageText file, Specified Line[/code:2ytzm2bq]
    
    Any ideas?
    Thanks
  • Use List object and load file into it. Retrieving 'n' line:

    ListBox.LineText(n)[/code:1qwg8gn4]
  • i'll have an example cap in a second. but it seems construct can't display japanese characters

    edit:

    PUT THE TWO .INI FILES IN YOUR C DIRECTORY (C:\)

    http://upload.dfyb.net/uploaded/language_test.zip

    PUT THE TWO .INI FILES IN YOUR C DIRECTORY (C:\)

    i built mine so you could change languages on the fly, but you could easily have it to where you only change languages in the options or at the start.

    to the devs: any idea if you'll support japanese (unicode?) characters in the future? i tried it from .ini files and from .html files and neither let me display japanese characters.

    also, in order to allow you to click a button and go to the "next" line, i had to name the items plain numbers (1, 2, 3, etc) and set text as INI.ItemString("dialog1", global('line')). originally i had them named "line_1" etc, and tried to set text as INI.ItemString("dialog1", "line_"global('line')) -- is there a way to do that (to have a mix between text in quotes and calling a value)?

    it'd be useful for things like "there are # balls in view" without having to use more than one text object.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks, that's kind of what I was trying.

    But the differenceIt is that it didn't occur to me to use global('line').

    I'll see what I can do now.

  • PUT THE TWO .INI FILES IN YOUR C DIRECTORY (C:\)

    Aaaagh! Don't do this, use the AppPath expression to load it from the same directory as the application! There's never any need to force people to put files in a fixed directory! (Sorry, pet peeve)

    [quote:3k6b3mud]to the devs: any idea if you'll support japanese (unicode?) characters in the future? i tried it from .ini files and from .html files and neither let me display japanese characters.

    Hmm, not sure if we can do it soon. It's a bit late really - we didn't start off with support for unicode, so it'd be a lot of work going through Construct's code changing it. Maybe for a version 2 type thing...

  • > PUT THE TWO .INI FILES IN YOUR C DIRECTORY (C:\)

    >

    Aaaagh! Don't do this, use the AppPath expression to load it from the same directory as the application! There's never any need to force people to put files in a fixed directory! (Sorry, pet peeve)

    i was hoping there'd be a feature like this (as i would never want to release something without it), i just didn't know about it

    edit: got it working. thanks

    [quote:2bc1zjda]to the devs: any idea if you'll support japanese (unicode?) characters in the future? i tried it from .ini files and from .html files and neither let me display japanese characters.

    Hmm, not sure if we can do it soon. It's a bit late really - we didn't start off with support for unicode, so it'd be a lot of work going through Construct's code changing it. Maybe for a version 2 type thing...

    i was hoping it'd be able to be implemented through a seperate object or something, but that isn't the case? i'd like to have my games be in both english/japanese, but as i don't plan on having tons of dialog (at least in my first game project), i guess i could just do it through images. also, the japanese indie game scene is pretty big -- if at all possible, i think it'd be worth having construct be more viable to them (i think displaying japanese characters is a bigger issue than the actual interface being in english or japanese -- i think they could get around an english interface, but they'd still want to make games their friends could play).

    edit: i'm still curious if there's someway to do "line_" + global('line') to get line_1, etc. using text as an output (after unsuccessful tests calling .ini items):

    "line_" + global('line') -- this produces "line_"

    global('line') + "test" -- this produces only the number from the 'line' variable - eg "1"

    "line_" + global('line') + "test" -- this produces "line_test" (ignoring the 'line' variable)

    [quote:2bc1zjda]also, in order to allow you to click a button and go to the "next" line, i had to name the items plain numbers (1, 2, 3, etc) and set text as INI.ItemString("dialog1", global('line')). originally i had them named "line_1" etc, and tried to set text as INI.ItemString("dialog1", "line_"global('line')) -- is there a way to do that (to have a mix between text in quotes and calling a value)?

    it'd be useful for things like "there are # balls in view" without having to use more than one text object.

  • Use & for string concatenation. + is for addition.

    Eg. "There are " & Balls.Count & " balls in play"

  • just realized the inability to display japanese characters also rules out my idea to create a flash card application in construct to help my studies (i'd release it to the public, too)

    it'd be too much work to use images for all that

  • I actually needed japanese symbols for something and I ended up using a font of characters. I had to match them up myself, but it beat drawing them all out.

  • just realized the inability to display japanese characters also rules out my idea to create a flash card application in construct to help my studies (i'd release it to the public, too) :(

    it'd be too much work to use images for all that

    Fortunately, there is alternatives :D http://www.mnemosyne-proj.org/ http://ichi2.net/anki/

    Utf-8 support would be much appreciated, though! (I study Japanese too, btw. Actually... Japanese is my main subject. I'm going to be a translator.)

  • http://ichi2.net/anki/

    wow. i just found my new favorite piece of software.

    (I study Japanese too, btw. Actually... Japanese is my main subject. I'm going to be a translator.)

    japanese is my minor

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)