Calling a screen when a character appears
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.
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.
- Hijiri
- Eileen-Class Veteran
- Posts: 1519
- Joined: Sun Mar 25, 2012 6:35 pm
- Completed: Death Rule:lost code Overdrive Edition, Where the White Doves Rest-Tsumihanseishi
- Projects: Death Rule: Killing System
- Organization: MESI Games
- IRC Nick: Hizi
- Tumblr: mesigames
- Skype: kurotezuka
- itch: hijiri
- Location: Los Angeles
- Contact:
Calling a screen when a character appears
I was wondering if there's a way to have a screen be shown every time a certain character speaks. I know I can do this the old fashioned way by calling the screen each time, but is there a way to add it to the defined character?
- Zetsubou
- Miko-Class Veteran
- Posts: 522
- Joined: Wed Mar 05, 2014 1:00 am
- Completed: See my signature
- Github: koroshiya
- itch: zetsuboushita
- Contact:
Re: Calling a screen when a character appears
Incomplete solution, but I believe you're looking for something like:
Code: Select all
init python early:
def callback_transition(event, interact=True, **kwargs):
if interact and event == "begin":
renpy.show_screen("screen_name")
#elif interact and event == "end": #to hide when they finish speaking
# renpy.hide_screen("screen_name")
define test = Character("Test character", callback=callback_transition)
Last edited by Zetsubou on Tue Dec 22, 2015 1:04 am, edited 1 time in total.
Finished games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails
Working on:
Sable's Grimoire 2
https://zetsubou.games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails
Working on:
Sable's Grimoire 2
https://zetsubou.games
Re: Calling a screen when a character appears
Do you want the screen to be shown or called? What are you trying to do specifically?
- Hijiri
- Eileen-Class Veteran
- Posts: 1519
- Joined: Sun Mar 25, 2012 6:35 pm
- Completed: Death Rule:lost code Overdrive Edition, Where the White Doves Rest-Tsumihanseishi
- Projects: Death Rule: Killing System
- Organization: MESI Games
- IRC Nick: Hizi
- Tumblr: mesigames
- Skype: kurotezuka
- itch: hijiri
- Location: Los Angeles
- Contact:
Re: Calling a screen when a character appears
Well I guess I can show it:philat wrote:Do you want the screen to be shown or called? What are you trying to do specifically?
The code I use right now is:
Code: Select all
##Screens
screen Dev_tag ():
zorder 999
add "ui/namebox/Dev.png" xpos -27 ypos 553
screen Greg_tag ():
zorder 999
add "ui/namebox/Greg.png" xpos -27 ypos 553
##Script
start:
show screen Dev_tag
$ renpy.transition(dissolve)
D"This is a test."
D"And this is to see if the screen remains."
hide screen Dev_tag
show screen Greg_tag
$ renpy.transition(dissolve)
G"And this test is to see if I can change the names with little notice."
G"Hopefully it does because then I think I found an answer to my namebox problem."
hide screen Greg_tag
$ renpy.transition(dissolve)
"And if this works, then the nametag should disappear with little issue."
Re: Calling a screen when a character appears
As far as I can tell, literally the only reason to do this is to apply transitions to the namebox, and this is a lot of effort for that...
If you're going to expend that much effort in the first place, I would propose that having a ConditionSwitch with transitions would be more efficient than using a callback to show a screen. See TransitionConditionSwitch here: http://lemmasoft.renai.us/forums/viewto ... 12#p326683
If you're going to expend that much effort in the first place, I would propose that having a ConditionSwitch with transitions would be more efficient than using a callback to show a screen. See TransitionConditionSwitch here: http://lemmasoft.renai.us/forums/viewto ... 12#p326683
Re: Calling a screen when a character appears
Barring the fancy two bits of advice from above (both of which should work), lets not forget that there is a screen that is shown every time someone is speaking:Hijiri wrote:I was wondering if there's a way to have a screen be shown every time a certain character speaks.
screen say(who
You should be able to condition it with the who argument passed to it and show any number of screens through if/showif + use/timers applying any transition/atl and etc. I never tried this exactly but similar things worked for me in the past really, really well and this seems like the easiest solution. Just note that I am still unclear as to what you're trying to do exactly even after watching the video so I am just responding to OP, if your wish is too show fancy screens conditioned of Characters every time that they speak, this would not be the worst way of handing that...
Re: Calling a screen when a character appears
The issue is (at least, I imagine) that you can't apply a transition/ATL to the who element/box in screen say, because it's reshown every interaction and/or run behind the scenes (for prediction and other reasons). I mean, what people want is for the namebox to dissolve in/out when the character changes, not every time there's a new line. This is a question I see pop up every so often on the forums, but I've never seen a particularly easy fix for it.
Re: Calling a screen when a character appears
You're right. I remembered playing this cat/mouse game with say screen before, although winning in the end, code was absolutely awfulphilat wrote:...
- Starshine
- Veteran
- Posts: 247
- Joined: Mon Jan 30, 2012 7:50 am
- Completed: http://berry-melon.blogspot.co.uk/2016/ ... -2016.html
- Projects: Pancake Surprise (2016)
- Tumblr: http://bettybooplover.tumblr.com
- Deviantart: berry-melon
- Soundcloud: sweepea-1
- Contact:
Re: Calling a screen when a character appears
I think he wants to show a side image, when the text appears.philat wrote:Do you want the screen to be shown or called? What are you trying to do specifically?
http://www.renpy.org/doc/html/side_image.html
http://berry-melon.blogspot.com
I'm not resting until I find
What would make your eyes
Glisten like mine
With loves divine!
Boo-Boo I couldn't aspire....to anything...
Higher...than to fill that one desire to make it
My own....Bop-Bop-a-Dop-Boop-Oop-a-Doop honey?
I'm not resting until I find
What would make your eyes
Glisten like mine
With loves divine!
Boo-Boo I couldn't aspire....to anything...
Higher...than to fill that one desire to make it
My own....Bop-Bop-a-Dop-Boop-Oop-a-Doop honey?
Re: Calling a screen when a character appears
Maybe... but that's not how I understood it. My guess is that OP wants to add automatic transition when switching between characters and just for those character names. Ren'Py does not seem to offer that functionality out of the box and any approach suggested there or that I could think of results in some weird and sh!tty codeStarshine wrote:I think he wants to show a side image, when the text appears.
- Starshine
- Veteran
- Posts: 247
- Joined: Mon Jan 30, 2012 7:50 am
- Completed: http://berry-melon.blogspot.co.uk/2016/ ... -2016.html
- Projects: Pancake Surprise (2016)
- Tumblr: http://bettybooplover.tumblr.com
- Deviantart: berry-melon
- Soundcloud: sweepea-1
- Contact:
Re: Calling a screen when a character appears
Oh, I see!xela wrote:Maybe... but that's not how I understood it. My guess is that OP wants to add automatic transition when switching between characters and just for those character names. Ren'Py does not seem to offer that functionality out of the box and any approach suggested there or that I could think of results in some weird and sh!tty codeStarshine wrote:I think he wants to show a side image, when the text appears.
http://berry-melon.blogspot.com
I'm not resting until I find
What would make your eyes
Glisten like mine
With loves divine!
Boo-Boo I couldn't aspire....to anything...
Higher...than to fill that one desire to make it
My own....Bop-Bop-a-Dop-Boop-Oop-a-Doop honey?
I'm not resting until I find
What would make your eyes
Glisten like mine
With loves divine!
Boo-Boo I couldn't aspire....to anything...
Higher...than to fill that one desire to make it
My own....Bop-Bop-a-Dop-Boop-Oop-a-Doop honey?
Who is online
Users browsing this forum: Google [Bot]