[Solved] Readback.rpy and "extend"

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.
Message
Author
Levrex
Veteran
Posts: 280
Joined: Mon Jun 18, 2012 12:16 pm
Contact:

[Solved] Readback.rpy and "extend"

#1 Post by Levrex » Wed Jul 04, 2012 11:50 pm

The problem is, when using a "text history" module (http://www.renpy.org/wiki/renpy/doc/coo ... xt_History), "extend" special character multiplies the line which it extends in text history.

I.e. the following example code:

Code: Select all

    n "\"Sup cutie,"
    extend " wanna ride in my car?\""
will give this:
"Sup cutie,"
"Sup cutie, wanna ride in my car?"
result in text history.

Is there a way to work this around?
Last edited by Levrex on Wed Jul 18, 2012 4:58 am, edited 1 time in total.
If your question is solved, please add [Solved] to theme's name by editing its first post, so that the helpful guys out there wouldn't mistakenly think the problem is still unanswered and waste their time.

User avatar
redeyesblackpanda
Eileen-Class Veteran
Posts: 1006
Joined: Thu Dec 22, 2011 4:26 am
Projects: Eternal Memories, plot bunnies that won't die.
Organization: HellPanda Studios
Location: United States
Contact:

Re: Readback.rpy and "extend"

#2 Post by redeyesblackpanda » Thu Jul 05, 2012 12:54 am

I'd try this code:

Code: Select all

    "\"Sup cutie, {w}wanna ride in my car?\""
It should have the same effect, but not repeat. (Hopefully. I haven't tested it personally.)
(All projects currently on a hiatus of sorts. I blame life.)
Tsundere VN
Not really checking the forums any more due to time constraints, so if you want to contact me, PM. I'll get a notification and log in. :mrgreen:
Also, I've been hit and run posting, which means I don't see many replies. If you want to respond to something I've said, also feel free to PM me.

NOTE: if you've got questions about vnovel or things like that, it's Leon that you should be contacting. Leon's been pretty much handling everything, but due to various reasons, I've had to withdraw entirely.

Levrex
Veteran
Posts: 280
Joined: Mon Jun 18, 2012 12:16 pm
Contact:

Re: Readback.rpy and "extend"

#3 Post by Levrex » Thu Jul 05, 2012 5:15 am

Well, i thought of that first, but that's ain't no option.
Click-to-continue indicator needs to be shown, otherwise it would seem strange and some unexperienced readers may think that the game is broken.

Of course, i can insert a click-to-continue anim.Filmstrip right into the line, but big novels tend to have many "extends", and that is too much time to waste and a bad optimisation.
If your question is solved, please add [Solved] to theme's name by editing its first post, so that the helpful guys out there wouldn't mistakenly think the problem is still unanswered and waste their time.

apricotorange
Veteran
Posts: 479
Joined: Tue Jun 05, 2012 2:01 am
Contact:

Re: Readback.rpy and "extend"

#4 Post by apricotorange » Thu Jul 05, 2012 6:22 am

I think the issue is just that ReadbackADVCharacter and ReadbackNVLCharacter defined there need to override do_extend. I'll take a closer look sometime soonish.

Levrex
Veteran
Posts: 280
Joined: Mon Jun 18, 2012 12:16 pm
Contact:

Re: Readback.rpy and "extend"

#5 Post by Levrex » Thu Jul 05, 2012 11:48 am

Looking forward to, thanks!
If your question is solved, please add [Solved] to theme's name by editing its first post, so that the helpful guys out there wouldn't mistakenly think the problem is still unanswered and waste their time.

User avatar
Samidarenina
Regular
Posts: 137
Joined: Sun Aug 01, 2010 1:21 pm
Contact:

Re: Readback.rpy and "extend"

#6 Post by Samidarenina » Tue Jul 10, 2012 6:16 pm

Actually, you can use "ctc_pause=" to set the CTC indicator to work with {w} and {p}.
Of course, if you need to show new pictures on the screen in the middle of the line, then you'll still need to use extend, but for the normal things, ctc_pause should do the thing.

(That being said, I stumbled across this thread for the exact same reason.)

apricotorange
Veteran
Posts: 479
Joined: Tue Jun 05, 2012 2:01 am
Contact:

Re: Readback.rpy and "extend"

#7 Post by apricotorange » Wed Jul 18, 2012 2:32 am

Attaching a revised text history module; I stripped out a whole bunch of unnecessary stuff, and "extend" should work properly. Let me know if it works as expected.
Attachments
readback.rpy
Revised text history
(5.32 KiB) Downloaded 110 times

Levrex
Veteran
Posts: 280
Joined: Mon Jun 18, 2012 12:16 pm
Contact:

Re: Readback.rpy and "extend"

#8 Post by Levrex » Wed Jul 18, 2012 4:58 am

Holy heck, man, you are... you are... a man!
I expected that you'll just fix an "extend" bug, but you actually made it scrollable, just like i wanted to!!!
And yes, it works as expected.

Thank you very much.

Just one more thing, if i may ask...
If i want to divide the pages by some spaces (empty lines), should i add the code like this to NVLCharacter?
It's not that much necessary, but preferable.

Code: Select all

def do_nvl clear(self):
            add text "\n\n"
            super(ReadbackNVLCharacter, self).do_nvl clear()
            return
If your question is solved, please add [Solved] to theme's name by editing its first post, so that the helpful guys out there wouldn't mistakenly think the problem is still unanswered and waste their time.

apricotorange
Veteran
Posts: 479
Joined: Tue Jun 05, 2012 2:01 am
Contact:

Re: [Solved] Readback.rpy and "extend"

#9 Post by apricotorange » Wed Jul 18, 2012 5:35 am

I didn't think I did anything which should affect the scrolling...

Slightly tweaked version: adds space after "nvl clear", and a bugfix to make it work properly across saves.
Attachments
readback.rpy
Revised text history, tweaked
(5.73 KiB) Downloaded 85 times

User avatar
Samidarenina
Regular
Posts: 137
Joined: Sun Aug 01, 2010 1:21 pm
Contact:

Re: [Solved] Readback.rpy and "extend"

#10 Post by Samidarenina » Wed Jul 18, 2012 9:24 am

apricotorange wrote:I didn't think I did anything which should affect the scrolling...

Slightly tweaked version: adds space after "nvl clear", and a bugfix to make it work properly across saves.
I am sure this is asking for too much, but I'll try anyway.
Would you have a bit of time on your hands to also fix "extend" in the NVL page version you did for me some while ago in http://lemmasoft.renai.us/forums/viewto ... =8&t=15728? For now, it works perfectly, but the only problem I have is the extend not working.
I did try combining those 2 codes myself, but I keep getting an error.
Of course, you'd get a credits mention (again).


*crosses fingers and waits*

Levrex
Veteran
Posts: 280
Joined: Mon Jun 18, 2012 12:16 pm
Contact:

Re: [Solved] Readback.rpy and "extend"

#11 Post by Levrex » Wed Jul 18, 2012 9:27 am

apricotorange wrote:I didn't think I did anything which should affect the scrolling...

Slightly tweaked version: adds space after "nvl clear", and a bugfix to make it work properly across saves.
Now i'm happy.
Thank you again!
If your question is solved, please add [Solved] to theme's name by editing its first post, so that the helpful guys out there wouldn't mistakenly think the problem is still unanswered and waste their time.

apricotorange
Veteran
Posts: 479
Joined: Tue Jun 05, 2012 2:01 am
Contact:

Re: [Solved] Readback.rpy and "extend"

#12 Post by apricotorange » Thu Jul 19, 2012 1:26 am

Attaching combined version which supports both scrolling and "paged" variants, for Samidarenina.
Attachments
readback.rpy
Combined version
(7.95 KiB) Downloaded 258 times

User avatar
Samidarenina
Regular
Posts: 137
Joined: Sun Aug 01, 2010 1:21 pm
Contact:

Re: [Solved] Readback.rpy and "extend"

#13 Post by Samidarenina » Thu Jul 19, 2012 10:58 am

Ah, thank you so very much, Apricotorange. This is incredibly helpful to me.

Levrex
Veteran
Posts: 280
Joined: Mon Jun 18, 2012 12:16 pm
Contact:

Re: [Solved] Readback.rpy and "extend"

#14 Post by Levrex » Sat Jul 28, 2012 11:59 am

After some use, i noticed that blocking "rollback" key (assigning it to NullAction) for yesno_prompt screen won't work with readback.rpy. Because readback module overwrites the function of that key, but it overwrites that function on top of everything, which would be unwanted in my case.

I.e. i make the yesno_prompt show up while in "nvl" screen and it's supposed not to disappear until the user makes a decision, but if i roll back, going to the "text history" screen, i can watch the text history, call game menu, call prompt again, etc.
I tried to look into the code, but did not want to break anything, 'cos almost everything's going so smoothly now.

Though it's not that much of a problem.
If your question is solved, please add [Solved] to theme's name by editing its first post, so that the helpful guys out there wouldn't mistakenly think the problem is still unanswered and waste their time.

apricotorange
Veteran
Posts: 479
Joined: Tue Jun 05, 2012 2:01 am
Contact:

Re: [Solved] Readback.rpy and "extend"

#15 Post by apricotorange » Sat Jul 28, 2012 8:45 pm

If you want to manage the rollback and rollforward keys yourself, you can set "config.readback_full" (one of the custom config variables at the beginning of the script) to False, and the script won't touch them. You can then trigger the readback yourself with the action (SetVariable("readback_yvalue", 1.0), ShowMenu("text_history")); maybe put it on a screen which you show at the start of the game, then hide at certain key points.

On a side note, Ren'Py 6.14 will come with some more flexible options for controlling rollback, which might be an alternative to this script depending on your use-case.

Post Reply

Who is online

Users browsing this forum: Google [Bot]