What's new

NScripter Fixing Wordwrapping


dazedanon19

Well-known member
Joined
May 21, 2018
Messages
332
Reputation score
364
I'm translating (MTL) a game that uses NScripter, and I've been mostly successful. However I'm pretty new to this stuff so I don't really have an idea of how these engines work yet. It's easy enough to fix crashing issues, but one issue I have no idea where to start with is wordwrapping. Thus, I end up with a bunch of these in the translation.

1615086228813.png

Therefore, I was wondering if anybody here knows how these issues typically get fixed... I have access to all of scripting code and what not to make any changes, just not sure how to approach the problem. If anybody more experienced than I can point me in the right direction. I would greatly appreciate it.

As an additional request, if anybody can point me to a decent resource on the technical details for translating VN's, Games, Etc that I could reference, that would be great.

Also if this isn't the right place for this I apologize, just say the word and I can move the thread elsewhere.
 
Last edited:

habisain

Tentacle God
Joined
Jul 15, 2012
Messages
1,447
Reputation score
465
You have a fixed width font, so word wrapping is fairly easy to implement in the scripts (i.e. happens when the game runs), or in your post processing of the translation (i.e. happens when translating). Suppose you can have X characters per line. Then you just have to make it so that when you get to each space, you scan forward over the next word (i.e. until the next space or the end of string, whichever is first) and count how many characters would be on the line if you printed the next word. If that's greater than X, you replace the space with a newline. Job mostly done.

Things might get trickier if the newlines cause your text box to overfill vertically, because that may require you to insert a new dialogue box to break it up. I'm not too familiar with NScripters internals, so I'm not sure exactly what would happen. However, in my experience, this is a somewhat infrequent occurrence, so it might be something you can handle manually.
 
OP
dazedanon19

dazedanon19

Well-known member
Joined
May 21, 2018
Messages
332
Reputation score
364
Exactly what I was looking for. Thanks!
 

Fenril

Grim Reaper
Joined
Jul 26, 2013
Messages
879
Reputation score
275
Maybe it's better to just copy and paste the Y symbol into ctrl-F. At one point, Windows decided that its file management system should replace \ with that Y symbol. Oftentimes "\n" is a shortcut for a new line in various programming languages, so if you replace the "-Y-n" with "\n" it might work as a workaround.
 

habisain

Tentacle God
Joined
Jul 15, 2012
Messages
1,447
Reputation score
465
Maybe it's better to just copy and paste the Y symbol into ctrl-F. At one point, Windows decided that its file management system should replace \ with that Y symbol. Oftentimes "\n" is a shortcut for a new line in various programming languages, so if you replace the "-Y-n" with "\n" it might work as a workaround.
Not sure what you're talking about here - it seems a bit off the original subject. However, I can shed some light on this for you, because you don't seem to be aware. When running Windows in cp932 mode (and possibly some other modes, but this is probably what you're familiar with), the font used replaces \ with ¥. That's it. It's just a font level substitution, so the \ key on your keyboard is still a \ key, and everywhere there's a \ in the filesystem it's still logically a \, it just displays as ¥.
 
OP
dazedanon19

dazedanon19

Well-known member
Joined
May 21, 2018
Messages
332
Reputation score
364
Maybe it's better to just copy and paste the Y symbol into ctrl-F. At one point, Windows decided that its file management system should replace \ with that Y symbol. Oftentimes "\n" is a shortcut for a new line in various programming languages, so if you replace the "-Y-n" with "\n" it might work as a workaround.
I imagine you're talking about the image I posted as an example. This was just something I used to give a picture of what I'm talking about for the word wrapping issue. In my translation, I don't have a problem with `\n` being visible in the text so I'm good in that department.
 
Top