PDA

View Full Version : ONScripter: single-byte text and variables


delta
2007-02-27, 14:08
Hi. I have a problem with ONScripter, maybe someone has encountered it already and found a workaround.

Is it possible to display single-byte text stored in variables properly? let's say I have the variable "$1000", with the content "This is single-byte text". Now, in Japanese the variable would just be displayed like this:

$1000

But of course, this doesn't work properly (spaces messed up), because it needs the backtick. If I enter the backtick before the variable name, it just displays the variable name. If I put the backtick inside the variable, it isn't parsed, but displayed. Of course, the workaround is to use double-byte characters, but these are full-width and ugly, not to mention a pain to input. Of course, one could hack the font or something, but that's something I'd rather not do if at all possible.

Any ideas?

Starchanchan
2007-02-27, 14:16
Nope. It either requires hacking of the ONScripter build, or some massive coding that's way too complicated for me (Haeleth helped me when I had the same problem).

Message
2007-02-27, 23:38
I've never tried this, but perhaps spaces are possible in static numaliases? Although the usability of that is, of course, very low. You could use several variables in sequence, but it would require some smart coding to allow for user input to be spread across them (if it's even possible). One thing you could do is use some strange unused character like | as a seperator and modify your font file to display that as a space. Won't allow for user input unless they use |s as well, but if you're only modifying it yourself it should work.

Actually using double-byte characters is not an option, unless you're planning to use NScripter or do the entire game in fullwidth. ONS does not support halfwidth and fullwidth at the same time. Come to think of it... I wonder why?

pbsaffran
2007-02-28, 03:47
Oh, but it does? I tested this.

http://img216.imageshack.us/img216/4058/largefontsbg5.jpg

My default language for programs that don't support Unicode is japanese though, that might be the reason.
Oh, and I do have a backquote in front of that line.

Message
2007-02-28, 05:09
Hmm... I take it you mean that 'Meme' is in fullwidth? From my experience ONS does not support leaving lines untranslated, or leaving for example fullwidth spaces in front of text lines. Now I'm confused. T__T

delta
2007-02-28, 07:57
Hmm... I take it you mean that 'Meme' is in fullwidth? From my experience ONS does not support leaving lines untranslated, or leaving for example fullwidth spaces in front of text lines. Now I'm confused. T__T

Oh, it does. It's having single- and double-byte characters on one line that causes problems. Possibly not even egregious ones, double-byte characters in single-byte lines are only really problematic in the message history. Check partially translated projects like Higurashi 7 or Kagetsu Tohya. However, I need this the other way around here, which is more of a problem. I guess I'll try inserting a blank glyph in the singe-byte section of the font.

P.S. Okay, fixed it. I blanked the circumflex glyph (which I don't need) and replaced the spaces with it, and now it works. However, a point to remember is that you have to pad the string to an even number of characters, or ONScripter will swallow the last one. In my case, I just added a normal space at the end of the string if the number of characters was uneven.