ASCII table help

Started by Kinoko, Tue 07/06/2005 04:51:32

Previous topic - Next topic

Kinoko

Using an ASCII table (such as http://www.lookuptables.com/), how can I tell what to write in an AGS script to make use of characters 16-31? Or... can I?

edmundito

I think this is more of a techinal forum question...

But anyway:

Display("%c", 16); would be a way to display character 16.

Kinoko

Well, because it isn't specific to AGS I thought I'd ask here. It's really that I just don't know how to read that table, or what half of the symbols mean. If someone wants to move it, it's fine with me.

The display thing won't work because I need to use these characters in amongst others in strings.

RickJ

There are two ways to insert characters into a string...

  • Common Mehtod
    string buf;
    StrFormat(buf,"Insert it here, %c, and not here",16);

  • Alternative method
    char buf[200];
    StrCopy(buf,"Insert it here,  , and not here");
    buf[15] = 16;


Kinoko

Hrrm :\ Is that really all I can do? I think it's nigh on impossible for me to write the entire text of a game like that.

Stupid ASCII!! Why does everything have to get in the way of me doing a Japanese translation?

Fuzzpilz

I'm not sure about AGS' escape sequence support, but just using "Here followeth character 16: \x10" should work also - i.e. backslash, x, character number in hex.

Gilbert

Well an alternative way is to use a translation file, just write those strings in a translation text file with whatever programmes that can do it, you can even make such programme with AGS itself.

Hehe Kinoko, I know what you're for, you should actually check out my two AGS "Japanese" translators (you know where to find them := ), even though your font may not use the same character assignments as mine, you can probably find uses from their sources.

strazer

Quote from: Fuzzpilz on Tue 07/06/2005 07:24:27
I'm not sure about AGS' escape sequence support, but just using "Here followeth character 16: x10" should work also - i.e. backslash, x, character number in hex.

Not possible currently, but suggested.

Kinoko

#8
Quote from: Gilbot V7000a on Tue 07/06/2005 07:37:43
Well an alternative way is to use a translation file, just write those strings in a translation text file with whatever programmes that can do it, you can even make such programme with AGS itself.

Hehe Kinoko, I know what you're for, you should actually check out my two AGS "Japanese" translators (you know where to find them := ), even though your font may not use the same character assignments as mine, you can probably find uses from their sources.

Well, I HAD thought about that, but you know, I'm not very good with the technical stuff ^_^ But how does your translator output those characters in the final translation file? Can't I use the same text it does for characters 16-31?

EDIT: The major problem I had with the ASCII table was that I didn't know what all the CAN and EM and SUB and whatnot meant. I gathered the red characters were what you type on the keyboard to get that number character, but how could I type those in the left-hand column? I guess I can't... seriously, what's the point of them then?

Gilbert

The translators actually work like this:
1. parse the textbox repeatedly
2. whenever you press space (and "convert" mode on) it will check if your last entered characters form a phrase understandable by it (eg. KA, MA, etc.).
3. if a known phrase is detected it replaces that part of text with the desired character(s) from ASCII table
4. you can save all the lines with the translator, so to make a text file with desired texts.

Since your font may not have the character arrangement as mine, what you can actually do is find the part of codes in my translators which parses the textbox and modify the text and change it s whatever you want, for example, something like (roughly, need to be familiar with the original scripts first):
if (StrComp(text, "TADA")==0) replace that last characters of the string to char #16

If you think it's too complicated you can just send me your font and I can make a version of the translator for you (easy).

TheYak

What a confusing question.  Less on the ASCII end and more on the question end.  I know jack about Japanese except for the triple alphabet thing.  Since there are more than 26 letters, you're trying to find out how to use ASCII codes and extended ascii to input text?  You're replacing "A" with <Japanese letter here> and "Ç" with another, for example? 

If a translation program's been made, it would seem the most efficient method aside from learning how to enter alt-codes or use Windoze character mapper.  You could use Windoze customized character creator to make a TTF but that sounds awfully time-consuming (especially considering the fonts like Kanji that exist).

Kinoko

Gil: ...and I WILL try that, but er, I guess what I'm asking is what does the translation file that your translator outputs... look like? For example, say I have a line I type in as "muzukashii naa"... when that's translated in your interpretor and the final file is output, what does that line look like? ie, is it like "ksjaaoe js" (just a random example ^_^;;) ?

To elaborate, the translation file your plugin outputs has to put the text in a way AGS can interprete, and then assign the correct number character from the SCI font I have. How does it do that for characters 16 - 32?

Sorry, I know I'm slow with this sort of thing, I KNOW this must be frustrating, trying to explain this crap to a dickhead like me.

Gilbert

Quote from: Kinoko on Tue 07/06/2005 13:08:29
Gil: ...and I WILL try that, but er, I guess what I'm asking is what does the translation file that your translator outputs... look like? For example, say I have a line I type in as "muzukashii naa"... when that's translated in your interpretor and the final file is output, what does that line look like? ie, is it like "ksjaaoe js" (just a random example ^_^;;) ?
Yes, something like that. It can make any standard text files with such kind of text, if you use the special "translate" mode, it will simply parse a translation text file (created by AGSedit) for lines of text to translate, and you can translate it one by one and save it to another file which can then be compiled by AGSEdit as a .TRA filr.

Quote
To elaborate, the translation file your plugin outputs has to put the text in a way AGS can interprete, and then assign the correct number character from the SCI font I have. How does it do that for characters 16 - 32?
Yes. You can actually try compiling my two translators and set them up to use the silly japanese translations to see how they will work (the two translators were all "translated" into Japanese already as examples, read the manual about this).
However, I can see a problem in your font set, you say you used character #16-32 right? ASCII #26 definitely won't work (since it's ctrl-Z), you have to at least move that character to some other slot. One thing you must be careful is that the characters should not occupy some of the more important control characters (like #13 is carriage return), otherwise the translation file won't work.
When I made my translators I had tested a bit, moving characters around, just to avoid clashing with those control characters. You can actually try loading my font in FontEdit, and see which of the slots are unused and try to avoid them in your font. (Or, more simply modify your SCI font, so that the characters are arranged identically to mine, then you don't enev need to modify the translators.)


Kinoko

Quote from: Gilbot V7000a on Wed 08/06/2005 01:49:06
Quote from: Kinoko on Tue 07/06/2005 13:08:29
Gil: ...and I WILL try that, but er, I guess what I'm asking is what does the translation file that your translator outputs... look like? For example, say I have a line I type in as "muzukashii naa"... when that's translated in your interpretor and the final file is output, what does that line look like? ie, is it like "ksjaaoe js" (just a random example ^_^;;) ?
Yes, something like that. It can make any standard text files with such kind of text

So, what characters correspond to #16, #17, etc? I can move #26 so that isn't being used, but for the ones I can use, what exactly do I type to have those characters recognised by AGS?

Gilbert

The Ctrl-Alphabets can be recognized easily by coutning:
ASCII #1 = Ctrl-A
ASCII #2 = Ctrl-B
...
ASCII #13 = Ctrl-M (Carriage Return)
...
ASCII #16 - Ctrl-P
ASCII #17 - Ctrl-Q
...
ASCII #26 = Ctrl-Z
(I think they're also in AGS manual's ASCII table.)

I can't remember, but possibly Ctrl-P and Ctrl-Q are not important control characters so they may be usable.

Actually normally it's not trivial to enter these control characters directly into a text file (since most text editors simply wouldn't write these characters as raw). Two possible ways are:
1. Use ordinary text editor to enter text, but for characters you can't enter directly, type some other characters as placeholder (like say, typing ^ to represent Ctrl-P, * to represent Ctrl-Q), after that, open up the text file with a hex editor and replace the appropiate characters with the desired values. This can be an annoying task though (not annoying if you just want to replace say, ALL ^ into Ctrl-P, but can be annoying if you do want some of the ^ to be changed and some not).
2. Make a text editor which you can actually enter those values into a text file directly, using technique like:
(if user tells the editor to add character ASCII #16 here)
--> (add the byte with value 16 to a string)
and then save it to a file. (which is exactly how my translators work)

Kinoko

#15
Quote from: Gilbot V7000a on Wed 08/06/2005 11:02:31
The Ctrl-Alphabets can be recognized easily by coutning:
ASCII #1 = Ctrl-A
ASCII #2 = Ctrl-B
...
ASCII #13 = Ctrl-M (Carriage Return)
...
ASCII #16 - Ctrl-P
ASCII #17 - Ctrl-Q
...
ASCII #26 = Ctrl-Z
(I think they're also in AGS manual's ASCII table.)

I can't remember, but possibly Ctrl-P and Ctrl-Q are not important control characters so they may be usable.

Actually normally it's not trivial to enter these control characters directly into a text file (since most text editors simply wouldn't write these characters as raw). Two possible ways are:
1. Use ordinary text editor to enter text, but for characters you can't enter directly, type some other characters as placeholder (like say, typing ^ to represent Ctrl-P, * to represent Ctrl-Q), after that, open up the text file with a hex editor and replace the appropiate characters with the desired values. This can be an annoying task though (not annoying if you just want to replace say, ALL ^ into Ctrl-P, but can be annoying if you do want some of the ^ to be changed and some not).
2. Make a text editor which you can actually enter those values into a text file directly, using technique like:
(if user tells the editor to add character ASCII #16 here)
--> (add the byte with value 16 to a string)
and then save it to a file. (which is exactly how my translators work)

Thanks heaps Gil! I think I understand now. I didn't realise that a character could be "there" if it wasn't visible in the editor, so I was confused.

EDIT: I've had someone explain hex editors to me now, so I get it even more now ^_^

EDIT: Gil - I had a look at your font, and you also used character #26 (for the small hiragana 'a'). I actually used your font as a template to create my own. I also made a mistake, I meant that I had used characters #16 to #31 ... #32 is a space so I'd left that.

Can anyone confirm which characters from #16 and onwards CANNOT be used?

Also, #16 - #26 appear to be ctrl P - ctrl Z, and #27 is ESC, but I can't figure out what #28, 29, 30 and 31 are. (if they can be used)

Gilbert

Quote from: Kinoko on Wed 08/06/2005 12:29:24
EDIT: Gil - I had a look at your font, and you also used character #26 (for the small hiragana 'a'). I actually used your font as a template to create my own. I also made a mistake, I meant that I had used characters #16 to #31 ... #32 is a space so I'd left that.
Don't look at the original font file I posted, look at the ones included in the translators, when I made the translators I can confirm that're some characters taht I shall not touch so I had to move them several times, until there (seemlessly) is no problem any more.

Quote
Can anyone confirm which characters from #16 and onwards CANNOT be used?

Also, #16 - #26 appear to be ctrl P - ctrl Z, and #27 is ESC, but I can't figure out what #28, 29, 30 and 31 are. (if they can be used)
Upon fast googling these are defined as stuff like File/Group/Record/Unit Separators, but it seeems that they can be used in AGS texts without the engine vomiting.
You can just check my font for which of the slots are occupied, it seems that even #27 ESC may be used for display without any problem, but experiments had proven that AGSEdit cannot accept a translation text file with #26 Ctrl-Z for compilation, in fact, you'll see that ALL characters from #26 onwards are used in that font.
HOWEVER, remember that in a normal AGS string the control characters /quotes/whatever (" \ % etc.) may not be displayed directly, so I just avoided changing these entries.

SMF spam blocked by CleanTalk