Page 1 of 1

Auto-Advance help request

Posted: Fri Aug 05, 2011 6:27 pm
by Data Junkie
So, I'm sure this has come up before, but five pages of the search results turned up nothing.

Anyway, I've encountered an issue when using auto-advancing text (what_slow_cps=20) in NVL mode. Namely, if I've got more than one line from the same character, clicking to load the next line reloads all the previous lines in the same block as well. For example, if I click to show the second line after the first one is done advancing, the first and second line both start from the beginning, instead of the first line staying put. How can I fix this? I've gone through the wiki, the documentation, and this forum, and if a fix exists there I'm just not seeing it.

Re: Auto-Advance help request

Posted: Sun Aug 07, 2011 5:50 am
by Data Junkie
So, it occurs to me that I should possibly show my code so that people can help me figure out what's wrong with it.

Code: Select all

# Declare characters used by this game.
define narrator = Character(None, what_slow_cps=20, kind=nvl)

# The game starts here.
label start:
    
    init python:
        style.nvl_vbox.box_spacing = 10
    
    init python:
        config.nvl_paged_rollback = True

    "They say that life is what happens while you plan."
   
    "But what if you live your life by the second, with no holds barred, and you live on the whim of the breeze? Is that life? I wouldn’t know."
     
    "My life is structured and lonely; I live in the clock shop across from the cinema. I know when each movie starts, stops, and what days it’ll be 
    playing. I know who the regulars are:"
    

Re: Auto-Advance help request

Posted: Sun Aug 07, 2011 8:01 am
by PyTom
You don't want to force a text speed like this, as Ren'Py will (correctly, IMO) apply it each time the text is shown. Instead, just set a default_text_cps in the preferences file. and Ren'Py will use that as the default value for the new text preference.

Also, 20cps is horribly slow. Forcing it on all text is a good way to make people abandon your game.

Re: Auto-Advance help request

Posted: Sun Aug 07, 2011 10:24 am
by Data Junkie
That... doesn't really help me. Like, at all.

Also, the "what_slow_cps=20" was actually taken from the code for the text demo in the tutorial. Because for some reason the tutorial doesn't provide sample code for any of the things in the demos, so I had to go look at the code of the demo itself to see how it was done.

Edit: To expound upon my own rather unhelpful post, an example would be nice, because I've no idea what you're talking about. This is pretty much the first thing I've ever made.

Re: Auto-Advance help request

Posted: Mon Aug 08, 2011 1:13 am
by SleepKirby
PyTom's referring to setting this in your options.rpy:

Code: Select all

    ## The default text speed in characters per second. 0 is infinite.

    config.default_text_cps = 0
Set it to 20, for instance. That'll become the default text speed (game-wide, not just for a particular Character like the narrator) which the game has when the player first runs the game. (You can test this 'clean state' by using "Delete Persistent" in your Ren'Py launcher.) Then the player can change the text speed through the Preferences screen if they want.

I'm not familiar with NVL mode at all, but maybe Character-specific CPS doesn't work too well with NVL? I heard that NVL mode is a bit harder to work with in general.

Also, the tutorial shows plenty of code examples, but.. it happens that text_cps isn't one of them.

Re: Auto-Advance help request

Posted: Mon Aug 08, 2011 7:57 am
by Data Junkie
Oh, yeah. The tutorial has plenty of examples, but when you get to the "demo" sections (which are only identified as such in the .rpy files), they just sort of show off what you can do without telling you how. Took me forever to figure out how to make it so that the player could enter their own name.

Also, the code put an auto-forward time slider in the preferences menu, but no matter what number I put after =, or how much I mess around with the slider, the text no longer auto advances, It just shows the whole block at once.

Re: Auto-Advance help request

Posted: Tue Aug 16, 2011 2:46 am
by Data Junkie
I know it's been a week, but I'd really appreciate it if someone could help me fix this. I can't finish my project until it's fixed, and I've no idea how to fix it on my own.

Re: Auto-Advance help request

Posted: Tue Aug 16, 2011 11:42 am
by Starlightkitty7
I'm surprised how slow the forums are compared to how it used to be. (...since its been a week since you got a response. ^^ I took a long break and haven't been on here in forever!)
Here this fixes your problem:

Code: Select all

# You can place the script of your game in this file.

init:
    define narrator = Character(None, what_slow_cps=20, kind=nvl)


# The game starts here.
label start:
   
    init python:
        style.nvl_vbox.box_spacing = 10
   
    init python:
        config.nvl_paged_rollback = True

    "They say that life is what happens while you plan."
    nvl clear
    "But what if you live your life by the second, with no holds barred, and you live on the whim of the breeze? Is that life? I wouldn’t     know."     
    nvl clear
    "My life is structured and lonely; I live in the clock shop across from the cinema. I know when each movie starts, stops, and what days it’ll be
    playing. I know who the regulars are:"
    nvl clear
Add nvl clear after each sentence.

Re: Auto-Advance help request

Posted: Tue Aug 16, 2011 7:20 pm
by Data Junkie
That doesn't quite solve my problem. I was hoping to keep multiple lines on screen at the same time. I think I've figured out how to do it with the pause function, though. It's not exactly elegant, but it works.

Re: Auto-Advance help request

Posted: Wed Aug 17, 2011 3:45 pm
by Data Junkie
Bleh. Well I'd almost solved my problem. Is there any way to put line-breaks in a single block of text?

Re: Auto-Advance help request

Posted: Wed Aug 17, 2011 3:48 pm
by Aleema
Data Junkie wrote:Bleh. Well I'd almost solved my problem. Is there any way to put line-breaks in a single block of text?
Yes.

Re: Auto-Advance help request

Posted: Thu Aug 18, 2011 5:31 am
by Data Junkie
Or, right. I'd forgotten about {p}. Thanks.