Jump to content

help with text box? (kirikiri2)


kudaratan

Recommended Posts

Hey, it's me again! I'm working with the Prince Pia Carrot PC version demo and I can't quite figure out how to get the text to work properly.

 

First of all, it only takes up half of the entire box.

 

8bf7fff02b47de13aee43b7e4c4744f9.png

 

The font size is also quite big, as you can see. Might be hard to fit more complex sentences in. That's a lower priority, though.

 

Second of all, I don't know how to get it to wordwrap. I've tried both the Nagato and insani methods, but "class KAGWindow extends Window", HistoryLayer.tjs, and MessageLayer.tjs don't exist. Here's the data.xp3 if anyone would like to take a look--the rest of the info is divided into archives like 'game01.xp3'.

 

https://www.mediafire.com/?3yo1umgy0yuolno <==Default names are edited, but otherwise clean.

 

Thanks again in advance!

Link to comment
Share on other sites

At the top of the file, around line 14, just add 2 lines:

 

scFONTSIZE = 18;

scDRAWMAX = 90;

 

The font size speaks for itself, set it to whatever you like best. DRAWMAX is the maximum number of characters per line. 100 was too big in general, 90 works nicely for me, but it does depend on the actual line you're writing. So if you hit some weirdness with it, you can take the number down a bit.

 

Optionally, do a ctrl+f for "wnd.add(MessLayer" and change pxMESTEXT into some other number. This alters the x position of the text, so you can move it more to the left and cut down on that big empty left column if you want to. I set it to 35. If you do change this, change the y value just after it as well.

 

To add line wrapping on space, go to line 1784 (with an unedited file), and change the line

if((MessArray[inx] == "/") || (draw_cnt == scDRAWMAX))

into

if((MessArray[inx] == "/") || ((draw_cnt >= scDRAWMAX) && MessArray[inx] == " "))

 

and also change the line just below it

if(MessArray[inx] == "/"){ ++inx; }

into

if(MessArray[inx] == "/" || MessArray[inx] == " "){ ++inx; }

 

That'll cause the line to go over scDRAWMAX until it finds a space, and then it'll newline.

 

With all the changes I made, this is how it looks in-game (it's all one really big line):

 

Nd3zMqW.jpg

 

For the sake of ease, here's my MessObject: https://www.mediafire.com/?zghu791vmzrczmi

Link to comment
Share on other sites

Thank you very much! It works beautifully until I get to the line right after the one in myscreenshot above, though. I'm not certain why.

 

4880078f79f55787ee4f64ab3d414ea0.png

 

This happens and I have to quit the game. I don't get why. The line isn't even different.

 

[talk name=心の声]
As soon as I entered I was greeted by a tall waiter, who guided me to a seat by the window.
[hitret]
 
[talk name=心の声]
The name tag on his chest said, "Manager: Kinoshita Kuon".
[hitret]
 
[talk name=心の声]
Still young and a manager. Impressive.
[hitret]
 
But it crashes on the "still young" line...
Link to comment
Share on other sites

Ah ok, with that changed scenario I now get the crash. Will have to go through line by line and see what's causing it to happen I guess.

 

EDIT: Ok I narrowed down the error to the "But the classy cafe is gone now, and my dream along with it." line. Anything which doesn't contain the Japanese newline /with 2 lines of text causes that crash. Very very odd. I think I need help from someone who knows kirikiri, because I really don't know why that happens.

 

EDIT2: Fixed it. Use these instead: https://www.mediafire.com/?14w632vw7s8mfa6

 

The scFONTSIZE and scDRAWMAX were defined in Constant.tjs. Which is weird, I searched for them but got no hits, I don't know why. But I changed them in the constants instead, and now it doesn't error. So yeah, try those 2 files instead and should all be fine now.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...