Various questions (pause, shaking screen, commands in text)

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
User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

Various questions (pause, shaking screen, commands in text)

#1 Post by monele » Sat Oct 29, 2005 5:29 am

These questions are mostly preventive : I'm not absolutely sure I'd have a use for them but I'd like to know if the problems can be solved either way :).

Pause :

I used the pan animation and renpy.pause to wait for it to end. The problem is that the user can still click through this. In my case, this made a character appear in mid-air while the background was still scrolling down ^^;. Not very good looking.
Workaround : have the command after Pause place the background where it should be at the end of the animation.

Shaking screen :

hpunch is really nice. I used it with "show" so someone appears as he runs into you. My problem is that I'd like to use the shaking just as some text appears. My tries so far proved using hpunch along with a dialog line prevented from clicking and going on.

Code: Select all

someone "Says something" with hpunch
Commands in text :

So far I think there is a way to pause in the middle of a dialog and have the player click to go on, keeping the text in the same window.
I saw something in a LiveMaker game that seemed nice : changing character graphics during the text display. This means you can have someone start with a regular face and have them all shocked as they realize something, mid-sentence. How possible is this ?

Everlasting dialog box :

I noticed that sometimes it would be nice to have the text window stay on screen while characters change. But it seems to disappear whenever there is an animation (with...). This is mostly esthetic but I find it annoying how the window blinks just because someone's face changed a bit.

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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:

Re: Various questions (pause, shaking screen, commands in te

#2 Post by PyTom » Sat Oct 29, 2005 9:23 am

monele wrote:These questions are mostly preventive : I'm not absolutely sure I'd have a use for them but I'd like to know if the problems can be solved either way :).
Most of these have simple workarounds. Or at least workarounds, and so I'm not so sure there need to be fixes.

Pause - I think this is the right workaround/way to do this. It also allows one to put up a smaller image, which saves memory.

Shaking - Wow, that's disturbing. I'll look into seeing what I can do about this.
So far I think there is a way to pause in the middle of a dialog and have the player click to go on, keeping the text in the same window.
Yes, just added.
I saw something in a LiveMaker game that seemed nice : changing character graphics during the text display. This means you can have someone start with a regular face and have them all shocked as they realize something, mid-sentence. How possible is this ?
It's currently not possible. I'm also not sure if it's something that I will implement any time soon... The text box is separate from everything else, and so I'd need to figure out a way to combine them.
I noticed that sometimes it would be nice to have the text window stay on screen while characters change. But it seems to disappear whenever there is an animation (with...). This is mostly esthetic but I find it annoying how the window blinks just because someone's face changed a bit.
I'll add a way of fixing this to the next version of Ren'Py. Probably a hook of some sort that is called to set up the screen when a with statement executes, as opposed to a with clause on menus and such.

(Hm... wasn't this fixed in metropolitan blues? I need to remember how that was done.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Watercolorheart
Eileen-Class Veteran
Posts: 1314
Joined: Mon Sep 19, 2005 2:15 am
Completed: Controlled Chaos / Sum of the Parts / "that" Midna game with ZONEsama
Projects: Sparse Series/Oddments Shop original cartoon in Pevrea; Cybernetic Duels (fighting game); Good Vibin'
Organization: Watercolorheart Studios
IRC Nick: BCS
Tumblr: adminwatercolor
Deviantart: itsmywatercolorheart
Github: Watercolordevdev
Skype: heartnotes
Soundcloud: Watercollider
itch: watercolorheart
Location: Florida
Contact:

#3 Post by Watercolorheart » Sat Oct 29, 2005 9:44 am

Um, though it's a bad workaround, isn't there some sort of embedded text tag that makes the user click mid-dialogue? Can't you have their expression change then?

Aria: "Hey, there's something on your hands! That's ... that's (click) shock! Blood!"

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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 » Sat Oct 29, 2005 9:54 am

The answer is no, since there's no way to run code when the thing pauses.

I'm thinking that the right answer to this may be to have a tag that specifies where slow text begins displaying. Call this the {fast} tag, and we could have something like:

Code: Select all

show eillen mad
e "Prepare to feel the wrath..."
show eileen mad as hell
e "Prepare to feel the wrath... {fast}of a woman scorned!"
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
shaja
Regular
Posts: 73
Joined: Sun Oct 16, 2005 8:34 am
Contact:

#5 Post by shaja » Sat Oct 29, 2005 12:42 pm

I noticed that sometimes it would be nice to have the text window stay on screen while characters change. But it seems to disappear whenever there is an animation (with...). This is mostly esthetic but I find it annoying how the window blinks just because someone's face changed a bit.
I've managed to do this in a somewhat hackish way by using a custom say routine, similar to how the Kana extra is done, and putting the say window on a separate (non-transient) layer.

Of course, with this approach, every character has to have the say routine declared in their Character init statement, and there have to be explicit clear and hide window routines that you call in your script when you need them.

User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#6 Post by monele » Sat Oct 29, 2005 2:24 pm

Pause : Ok, I'll use the workaround. It's not too horrible :)

Shaking : Thanks for looking into it, I'm rather fond of this effect ^.^

Mid-sentence script : Ah well, too bad. Though the idea of the fast tag doesn't sound too hard to use and would allow pretty much anything in-between

Text window stays : If it's possible to just set a variable isWindowPermanent = true/false, that would be great ^.^. That way we could change it if needed or let it with a default value.

Text speed : Just thought about this! Is there any variable that could be simply set in the script so I can have a default speed ? (I know most people like instant display but letter-by-letter helps me simulate speech speed in my head ^^; ). I'm also still wondering if there could be any way for it to actually display only *one* letter by displayed frame, but I guess this goes with all the other speed problems I spotted :/
I've managed to do this in a somewhat hackish way by using a custom say routine, similar to how the Kana extra is done, and putting the say window on a separate (non-transient) layer.
Sounds like a lot of work :/ (yes I'm lazy XD). It's just a minor annoyance for me so I guess I'm not up to make lots of script hacking for it. I'd rather do it for a part of gameplay :)

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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:

#7 Post by PyTom » Sat Oct 29, 2005 3:18 pm

monele wrote:Text window stays : If it's possible to just set a variable isWindowPermanent = true/false, that would be great ^.^. That way we could change it if needed or let it with a default value.
Well, it probably will be more like:

Code: Select all

init:
    python hide:
        def with_callback(trans):
            narrator('', interact=False)
        config.with_callback = with_callback
The function will be called on every with statement, adding the narration to the screen. Or something like that... I'm about to implement this now. Ask me again in an hour or so.
Text speed : Just thought about this! Is there any variable that could be simply set in the script so I can have a default speed ? (I know most people like instant display but letter-by-letter helps me simulate speech speed in my head ^^; )
You can use a code fragment similar to the following:

Code: Select all

init:
    python:
        if not persistent.set_text_cps:
            persistent.set_text_cps = True
            _preferences.text_cps = 42
Where 42 is the speed you want it set to. This will only work the first time the game is run. After that, you want to delete game/saves/persistent to get rid of the flag that says not to set it again.

Hm... a bunch of people working on games. I need to put this up on the Big Board.

Update:

Fixed the with_function example to match the actual API.
Last edited by PyTom on Sat Oct 29, 2005 7:00 pm, edited 1 time in total.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#8 Post by monele » Sat Oct 29, 2005 5:12 pm

Permanent window : Oh, a one time thing ? Sounds good ^.^ *happy dance*

Text speed : so with this, the very first time the game is run (not just "new game" eh?), a speed will be set and a boolean will also be set so it does this only once... Then, anyone can change the preferences through the regular panel to adjust the speed right ? If so, sounds exactly like what I hoped for ^_^ thanks !

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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:

#9 Post by PyTom » Sat Oct 29, 2005 8:39 pm

Text speed : so with this, the very first time the game is run (not just "new game" eh?), a speed will be set and a boolean will also be set so it does this only once... Then, anyone can change the preferences through the regular panel to adjust the speed right ? If so, sounds exactly like what I hoped for ^_^ thanks !
Glad I could help... that's exactly what it is.

FYI, the following updates were added to Ren'Py's codebase today.

Fixed Motion (the class that implements Move and Pan) to allow motions
to be used as transitions, in conjunction with the say and menu
statements. Previously, they only worked with the with statement.

Added a new variable, config.with_callback, that can be used to
specify a function that is called when a with statement runs. This can
be used, for example, to put up a window when a transition occurs,
which has the effect of preventing the window from disappearing. [doc]

Implemented a new text tag, {fast}. This tag causes the slow text
display to start from a given point in the text string. This allows
one to show some text, run some command, and show the same text with
additions, and have the slow text display occur correctly. [doc]


If anyone needs these ASAP to support a game release, let me know. Otherwise, these will be in the next release of Ren'Py.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#10 Post by monele » Sun Oct 30, 2005 11:05 am

Wow, great! ^_^. Personally, I don't need them right now so I'll wait for the next release :).

I stumbled upon a new problem today though >.>.. See, I planned to have a face system similar to Gloria : they're displayed in the lower left corner and change rather often. They're also hidden as soon as the text displayed is a thought. No problem when it comes to the window (just changed min/max) nor the face (added a "thumb" position I can use with show). The annoyance comes with the many show/hide commands. All faces are displayed at the same place, and there can be only one at the same time. Whenever there is a simple say statement ("text"), any face that is shown should be hidden.
Obviously there is a very repetitive flow of action that, I think, could be simplified. Is there a way to turn this :

Code: Select all

show bruno neutral at thumb
br "I have something to say"
show bruno embarassed
br "It will sound a bit strange..."
hide bruno
show masha curious at thumb
ma "What is it ?"
hide masha
"How can I tell her ?..."
show masha angry at thumb
ma "Come on, don't make me wait !"
Into this :

Code: Select all

br_neutral "I have something to say"
br_embarassed "It will sound a bit strange..."
ma_curious "What is it ?"
"How can I tell her ?..."
ma_angry "Come on, don't make me wait !"
I thought that if a Character object can be given a function as "show someone at position", I'd just need to create a Character per emotion, and use "hide" from time to time.

If I can do this by modifying the "say" function, I guess I could try. I just want to know if I have a chance before diving into it :)

Oh btw, I tried using the "image" option of the Character object, but it's to be used with small and horizontal pictures I take it :)

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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:

#11 Post by PyTom » Sun Oct 30, 2005 11:53 am

You're right, there are better ways of adding a corner image then simply using show every time someone says something.

The way I favor is using the function argument of Character. This specifies a function that is called, instead of display_say, each time the character speaks. So one could write code like:

Code: Select all

init:
    python:
        def side_say(who, what, side=None, **kwargs):
            if side:
                ui.image(side, xpos=0, ypos=1.0, xanchor='left', yanchor='bottom')
            renpy.display_say(who, what, **kwargs)

    $ e_happy = Character('Eileen', function=side_say, side='e_happy.png')
    $ e_mad = Character('Eileen', function=side_say, side='e_mad.png')
And so on. I haven't actually tested this code, but it should be fairly close.

Thanks for asking this question. There's usally an easy way of doing repetative things in Ren'Py, and I think it's good that you realized that and asked before doing things the hard way.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#12 Post by monele » Sun Oct 30, 2005 12:25 pm

Oh boy, oh boy! *claps hands happily*. This works like a charm!
And there I was, feeling bad, thinking you'd have yet another thing to add because of me ^^;... But nope, it's already there, eheh :D. Thanks a lot, really ! Seeing things work that easily is very motivating ^_^

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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:

#13 Post by PyTom » Wed Nov 02, 2005 10:43 pm

Since this thread has been turning into the unofficial 5.1.6 worklist, I thought I'd post about a new feature I just implemented.

There is now a new function, LiveComposite. It's similar to im.Composite, but it lets you composite together arbitrary displayables. This means that it can be used to composite an eye animation onto a static body, for example. In this situation, it's more efficient then an Animation of im.Composites.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Watercolorheart
Eileen-Class Veteran
Posts: 1314
Joined: Mon Sep 19, 2005 2:15 am
Completed: Controlled Chaos / Sum of the Parts / "that" Midna game with ZONEsama
Projects: Sparse Series/Oddments Shop original cartoon in Pevrea; Cybernetic Duels (fighting game); Good Vibin'
Organization: Watercolorheart Studios
IRC Nick: BCS
Tumblr: adminwatercolor
Deviantart: itsmywatercolorheart
Github: Watercolordevdev
Skype: heartnotes
Soundcloud: Watercollider
itch: watercolorheart
Location: Florida
Contact:

#14 Post by Watercolorheart » Thu Nov 03, 2005 2:29 pm

PyTom wrote:Since this thread has been turning into the unofficial 5.1.6 worklist, I thought I'd post about a new feature I just implemented.

There is now a new function, LiveComposite. It's similar to im.Composite, but it lets you composite together arbitrary displayables. This means that it can be used to composite an eye animation onto a static body, for example. In this situation, it's more efficient then an Animation of im.Composites.
Yay!

User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#15 Post by monele » Sat Jan 21, 2006 7:13 pm

Going back to this thread since I had never tried the new say+menu transition thing so far. I'm just wondering how to use it now. I thought

Code: Select all

"WHAT THE HELL ?" with hpunch
would have worked but it complains ^^; (expects a picture...).
So... how can I have the screen shake just as some text appears on the screen ?

Post Reply

Who is online

Users browsing this forum: _ticlock_