Creating verbs using Chinese characters.

I'm sorry if this has been asked before. I did a search and couldn't seem to find any answers.

When I try to create a new verb using Chinese characters such as “看到” I get an error message saying that this is an invalid attibute name. However if I use English letter before such as "kan4dao4看到" it creates the verb. The issue is, I don't want English letters in my verb name.

In addition, I used Notepad++ to edit the English file to change the default verb names like you see below:

< template name="YouAreIn" >你在< /template >
< template name="LookAt" >看到< /template >
< template name="Take" >拿起< /template >

I loaded this Chinese version into my game and I can see these verbs as Chinese characters but they don't work in game. For example, if I try to "看到" an object I get the "UnrecognisedCommand" response.

Has anyone had a similar problem and is there a solution? Thanks so much for your responses.


There are two issues here. The name of the verb is, I think, limited to what XML allows for attributes (and possibly a subset of that), so for the attribute name, I think you are stuck.

With regards to the verb not getting recognised by the parser, I am not so sure. Is the word order the same? If the verb is "get", behind the scenes Quest will take that to be "get #object#", but you can override that by using "#object# get". Quest will then convert that into a regular expression, and use the regular expression to match against the input text.

If you are confident at coding, you could test that, using the IsRegexMatch function.
http://docs.textadventures.co.uk/quest/functions/isregexmatch.html


There are multiple templates for these commands.
This one:

  <template name="Take">Take</template>

controls the text that appears on the drop-down menu when you click an object, or the verb buttons in the sidebar.

These ones:

  <verbtemplate name="take">take</verbtemplate>
  <verbtemplate name="take">get</verbtemplate>
  <verbtemplate name="take">pick up</verbtemplate>

control what words the game will recognise when they are entered. In order for a translated command to work, you need to change both.

I'm not sure if it might be better in this case to change the command to use an explicit regular expression; as I believe those verbpatterns will result in a regex like ^take (?<object>.*?)$|^get (?<object>.*?)$|^pick up (?<object>.*?)$. And (although I haven't seen Chinese people playing text adventures), I suspect that the inclusion of an ASCII space in that pattern might be a problem for some players.

(If I see people speaking Chinese languages on IRC, there is not always a space between words, and if there is it's likely to be U+3000 (Full width ideographic space) rather than the ASCII one. So it would probably be a good idea to change the spaces in the pattern to \s?, which matches either nothing, or any character widely considered to be a space. Unfortunately you can only do this with RegEx type patterns)


Hey, thanks for the solution! I hadn't changed all of the templates for the commands and that was causing the errors.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums