Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(2 edits)

I could not get the normal input area to work as the keyboard will send the raw English characters directly even when the Chinese keyboard is enabled. However, the keyboard can detect the mobile input as an input area, which is why the intermediate spelling (e.g. na6) can be entered in order to select the correct Chinese character.

To ensure that the mobile input is used, I made the following changes in IFEngine --> js --> CRT.js:

1. Change line 223

From

// this.mobileInput.focus();

to

this.mobileInput.focus();

This ensures that the user enters into the mobile input by default.

2. Enable backspace in mobile input

Line 266 is currently

if(inputTxt.length > 0){

Replace it with

if (this.mobileInput.value != "") {
    this.mobileInput.value = this.mobileInput.value.substring(0, this.mobileInput.value.length - 1);
}
else if (inputTxt.length > 0){

Hello,


Yes, the bottom bar was enabled to allow chinese/Japanese/Korean input. It was born for the mobile and adjusted for this Jam (if you see the original italian version here:  https://www.avventuranelcastello-js.it/play/ it only appears in mobile devices)

BTW great job in updating the parser for the "no space" languages!

Federico :)

Found a new issue regarding spaces in the parser :)

As an example, in English the insertInto pattern is `(put|insert|stick) (.+) (?:in) (.+)`. If given an input like "insert bone into hole", Parser correctly generates an action object even though the pattern matches the input exactly. This is because the initial match is skipped:

if(
    sorgente != this.commands &&
    override != this.override.commands &&
    input.indexOf(" ") == -1 &&
    (obj.singolo === undefined || obj.singolo == false)
){
    let matches = input.match(new RegExp("^"+pattern+"$", 'i'));
    if( matches != null)
        return input;
}

The input contains spaces, so the above logic is skipped due to `input.indexOf(" ") != -1`. Otherwise, there would be a match and the raw input would be returned directly.

It appears the presence of the space is used to indicate whether this is an action and/or potentially has subjects. Unfortunately, since there are no spaces in Chinese, any inputs that match the pattern enter the above logic and return a string, not an action object. As an example, we would enter the Chinese equivalent of "insertboneintohole" and Parser.parse will return the string instead of the action.

How would you recommend adjusting the logic to handle this? I'm not sure if it is safe to remove the `input.IndexOf(" ") == -1` condition.

My fix right now is to remove the initial check (that was copied in the previous post). This avoids looking for spaces to detect the presence of a subject when `sorgente` is the set of verbs.

Then, right before the following return statement

// Rirotno un oggetto contenente l'azione e i soggetti
return {
    verb: chiave,
    actionObject: obj,
    command: sorgente == this.commands, //patternEsatto == true,
    subjects: subjects
}

I added the subject check:

if(
    sorgente != this.commands &&
    override != this.override.commands &&
    (obj.singolo === undefined || obj.singolo == false)
) {
    if( subjects.length == 0)
        return input;
}
// Rirotno un oggetto contenente l'azione e i soggetti

Ok I think your solution can work... just test it :)

Thanks for validating!

I did a play-through with no issues, this solution should be good to go for any other languages that have the same problem 😊

perfect :D