Paged (Kana) Mode

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Paged (Kana) Mode

#1 Post by PyTom »

I was bored for a few seconds, so I thought I would try my hand at hacking up a mode in which the text is added to a page, like it is in the Digital Object games Kana and Crescendo.

After spending 10 minutes getting it working, I thought I would post it here in case anyone else wants to try out this style.

To use it, include in your game the following init block:

Code: Select all

init:
    python:        
        def page(what):
            store.text = what
            renpy.display_say(None, store.text)

        page.say = page
        p = page

        def add(what):
            store.text += "\n" + what
            renpy.display_say(None, store.text)

        add.say = add
        a = add
        
        style.window.yfill = True
        style.window.xmargin = 0
        style.window.ymargin = 0
Then, you can have the "p" character say something to start a new page, and the "a" character say something to add a new line to the page. For example:

Code: Select all

p "It was a dark and stormy night."
a "Actually, that wasn't really true."
a "But that's how this sort of thing is supposed to start, right?"

p "It was actually late evening, and there was a slight drizzle going on."
a "I was procrastinating on writing my game, and so I came to be here..."
I don't think I'll use this style for my game, but it's here if anyone wants it. If someone is really interested, I could even help you write functions that combine character names with p and a. (Although as Ren'Py stands now, those names couldn't be colored in.)

Alessio
Miko-Class Veteran
Posts: 576
Joined: Fri May 07, 2004 9:40 am
Completed: GO! Magical Boy (2006), Angelic Orbs (soundtrack)
Projects: Cyberlin (in progress)
Location: Finland
Contact:

#2 Post by Alessio »

Excellent hint, thanks! Combining character names on one screen could be useful, I remember it worked pretty well in Kana and Seasons of Sakura. Colour is not an issue currently IMHO (I'll have the same colour for every character).

Trachmyr
Newbie
Posts: 19
Joined: Fri Dec 24, 2004 2:16 am
Location: Miami, FL
Contact:

#3 Post by Trachmyr »

Is there anyway for the text lines to have a line of space between them without using another say statement that the user would have to click through?

Additionaly, how can you incorporate this windows settings and a more standard window at different parts through the game.


Basicaly, most of the game will use a "dedicated" portion of the lower screen for the text window (Of a 800x600 screen, the bottom 150 Y pixels, and the rightmost 640 X pixels). It will include a health-bar widget that is flush with the text window (10 x 150 in size), and an Image Widget next to that which displays the date & time (150 x 150 in size)... it also acts as the button to acess the Character Status screen.

However the Very Beginning and End of the game I want to use Kana-like text, as the story begins and ends with the player reading the character's diary/journal.

The game I plan has quite a few endings (24), and the only way I can feasibly do them all is to present it in mostly text with a few CG between the "pages".

Currently I'm using the "Centered" say object, but the layout is somestimes clunky in appearance... there wouldn't happen to be a "Justified" or even "Right-Aligned" say object that places text on screen? If so that would actually be the perfect solution...
Last edited by Trachmyr on Thu Jan 13, 2005 3:56 am, edited 1 time in total.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#4 Post by PyTom »

Actually, the best way to do this is for me to go and rewrite this stuff using the new ui functions, which could probably allow for alot more customization. (Since it's now reasonably easy to add widgets to the screen, we can now do things like have each character's name with a colored name as well as text.)

Do you actually want Kana mode (where each line appears after a click, the screen clearing once in a while), or do you just want a narration mode showing a screen of text at a time?

Let me know, and I'll consider something like this for the next major release, or at least a better-supported version of these things.

24 endings is huge. How long do you expect the game to be? I may have to implement script overlays before it's all over. (But maybe not... I've tested Ren'Py with > 10k line scripts, and I think it could probably handle 10 times that.)

Trachmyr
Newbie
Posts: 19
Joined: Fri Dec 24, 2004 2:16 am
Location: Miami, FL
Contact:

#5 Post by Trachmyr »

PyTom wrote:Actually, the best way to do this is for me to go and rewrite this stuff using the new ui functions, which could probably allow for alot more customization. (Since it's now reasonably easy to add widgets to the screen, we can now do things like have each character's name with a colored name as well as text.)
I wouldn't want you to do a big rewrite on my account... I'm sure I can make do with what's already there, I just have to be a bit flexible and creative.

As for widgets being "reasonably" easy... I'll have to take your word on it :oops: , I'm still scratching my head on getting the say window working the way I want it too... (The text goes out of the window before scrolling to the next line... I'm trying to get my say window only to operate from x coordinates 0 to 640 on a 800 x 600 screen :( ). I'm dreading making the Status Screnn UI. But I've only started coding a few days ago, I'll figure it out... Not to mention that from the support you've been giving to the community, I'm sure I'll get it all working in a few days (OK, maybe more than a few... but y'know what I mean)

EDIT: I figured out part of my scrolling problem (My string was one LONG single word), but I'm still trying to get it to cooperate with my say window dimensions as mentioned above.
Do you actually want Kana mode (where each line appears after a click, the screen clearing once in a while), or do you just want a narration mode showing a screen of text at a time?
The latter... I want to show a block of text on a screen at one time... to be able to center the text on the Y-Axis, and Right-Align the text on the X-Axis (perhaps with the ability to set X & Y margins). I'd prefer it if this was a seperate window from the "say" window, so I could have two completely different sets of styles.

EDIT: I found that [$ style.centered_text.textalign = 0] meets my needs well enough for the formatting.

All text in this 'style' will be narrative/thought, so I don't need any labels... but I will have to figure out how to make a widget pop up with a Menu selection during certain parts (or simply have the Menu appear on screen with the rest of the narrative text).

I would like the option to insert spaces (for indentation) and spacing between the lines, as to make seperate paragraphs or to leave a space between narrative and Menu options.

The reason is that the opening narrative is also the character creation interaction... for example, the way the player will choose between playing a male or female character goes kinda like this (abridged version):

::Narative Text::
::Narative Text::
::Narative Text::
::Narative Text::
My father was hoping for a son...

I guess 'becareful what you wish for' would apply in this case.
It seems I started disappointing my father right from the beginning.

------------

So by interacting with the narrative the player will indirectly choose their starting statistics, hobbies, friends, gender and beginning reputations. Although it might be some extra effort, I think it's a real slick way to generate a character and get character backgroung at the same time.

Let me know, and I'll consider something like this for the next major release, or at least a better-supported version of these things.
Well I certainly appreciate Ren'Py and your involvement the way it is, anything else would be gravey.... :D
24 endings is huge. How long do you expect the game to be? I may have to implement script overlays before it's all over. (But maybe not... I've tested Ren'Py with > 10k line scripts, and I think it could probably handle 10 times that.)
Certainly it's alot longer than I think it's going to be... but I'm sure you understand that concept.

Actually 24 ending is not that bad when you consider how they intertwine and use alot of the same material.

There are the plots in the game that run simultaneously:
>Romance
>The Debt
>The Curse
(see the Archer's Curse thread in Game Maker's Corner if your interested in the details)

In order to get the "Best Endings" you have to stay alive, pay off the debt, remove the curse and get a VERY high romance score. There are 6 "datable" characters, each with one Best ending. There is also their Normal endings if you only get a Good romance score, the Normal endings are simply 'less complete' Best Endings with different text. If the player doesn't remove the curse, they get a "Tragic Ending"... which uses the first part of a Normal Ending, then spins off into a tragic event which is universal (save a bit of text) amongst all of the Tragic Endings. So that covers 18 of the 24 endings, yet alot of material is shared...

The other 6 endings includes an ending if you Dieand a "no Girl" ending. The remaining (4) endings occur if you fail to pay off the debt, and they all share quite a bit of material.

Yet I know the game is going to be long, The dialog I've wtitten is divided between a half-dozen notebooks.... and I write small.

I think a 100K line of script should be ok, but I do think it might be in that area once all the coding and variable tracking is added in.

Hey, but don't worry about it... let me get to that limit before I bug you about overlays, if I need it I'll send you a Demo to prove it... 8)


------------------

Thanks for your response...
I'll let you know if I have other questions (and I'm sure I will)

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Ocelot