Show and Hide Problems

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
VaanAshe
Regular
Posts: 30
Joined: Mon Aug 18, 2008 5:39 pm
Projects: Halcyon High
Location: England
Contact:

Show and Hide Problems

#1 Post by VaanAshe » Wed Aug 20, 2008 4:51 pm

I've got a slight problem again. It's probably something really simple, but yeah, whatever.

Firstly, my character can't return back to images used previously in the scene for some reason, and I'm not sure why.

In the code below, "danii" has three facial expressions in a school uniform - "01", "02" and "03", all of which are tagged "danii_01", "danii_02" and "danii_03". However, in the below, she doesn't actually change to "03" the second time round:

Code: Select all

show danii_03
    with dissolve
    
    "Girl" "Hey mister? Are you dead?"
    w "Wha'? Do I look dead?!"
    
    show danii_02
    
    "Girl" "Yay! You're alive!"
    w "...who is she...?"
    "Girl" "Huh? Oh yeah! My name is Danii!"
    
    hide snowblossom with dissolve
    
    da1 "What's your name mister?"
    w "Huh?! You don't even know me! Why are you telling me your name?! Didn't you mother ever tell you not to talk to strangers?!"
    
    show danii_03
This actually applies later on as well, when she changes to "01", but then can't change back to "03".

On top of that, at the end, I've put this in:

Code: Select all

    "She ran off down the street, not even answering my question."
    
    hide danii with dissolve
    
    "I wasn't really sure what to make of her, but that was just the beginning of my crazy summer."
However, she doesn't actually go, and instead remains until after that sentence when the scene changes. The same happens later with another character called "Jax", but this is worse because Danii actually ends up on top of her (and, as such, they're labelled the same way).

However, it works on a third character called "Callie" who's labelled exactly the same way, so I'm not really sure.

So...err, what am I doing wrong?
LiveJournal and [url=http://myrrh_tree.livejournal.com/]Reviews[/url]... I has them

User avatar
N0UGHTS
Miko-Class Veteran
Posts: 516
Joined: Mon Jul 28, 2008 7:47 pm
Location: California, USA
Contact:

Re: Show and Hide Problems

#2 Post by N0UGHTS » Wed Aug 20, 2008 4:58 pm

Indentation, indentation...

Code: Select all

   show danii_03 with dissolve
    
   "Girl" "Hey mister? Are you dead?"
   w "Wha'? Do I look dead?!"
    
   show danii_02
    
   "Girl" "Yay! You're alive!"
   w "...who is she...?"
   "Girl" "Huh? Oh yeah! My name is Danii!"
    
   hide snowblossom with dissolve
    
   da1 "What's your name mister?"
   w "Huh?! You don't even know me! Why are you telling me your name?! Didn't you mother ever tell you not to talk to strangers?!"
    
   show danii_03
...That's a pretty interesting conversation you have there. XD So your game involves a dead and hysterical protagonist... Interesting...

Those statements can't be grouped together, just remember that.
World Community Grid
"Thanksgiving is a day for Americans to remember that family is what really matters.
"The day after Thanksgiving is when Americans forget that and go shopping." —Jon Stewart
Thank you for playing Alter Ego. You have died.

User avatar
VaanAshe
Regular
Posts: 30
Joined: Mon Aug 18, 2008 5:39 pm
Projects: Halcyon High
Location: England
Contact:

Re: Show and Hide Problems

#3 Post by VaanAshe » Wed Aug 20, 2008 5:08 pm

Actually, it is indented (I don't know why I didn't highlight the whole line ;_;):

Code: Select all

    show danii_03 with dissolve
    
    "Girl" "Hey mister? Are you dead?"
    w "Wha'? Do I look dead?!"
    
    show danii_02
    
    "Girl" "Yay! You're alive!"
    w "...who is she...?"
    "Girl" "Huh? Oh yeah! My name is Danii!"
    
    hide snowblossom with dissolve
    
    da1 "What's your name mister?"
    w "Huh?! You don't even know me! Why are you telling me your name?! Didn't you mother ever tell you not to talk to strangers?!"
    
    show danii_03
It actually still doesn't work, not even like that. ;_;
LiveJournal and [url=http://myrrh_tree.livejournal.com/]Reviews[/url]... I has them

User avatar
N0UGHTS
Miko-Class Veteran
Posts: 516
Joined: Mon Jul 28, 2008 7:47 pm
Location: California, USA
Contact:

Re: Show and Hide Problems

#4 Post by N0UGHTS » Wed Aug 20, 2008 5:10 pm

Any traceback or error texts? Or it just runs without changing?
World Community Grid
"Thanksgiving is a day for Americans to remember that family is what really matters.
"The day after Thanksgiving is when Americans forget that and go shopping." —Jon Stewart
Thank you for playing Alter Ego. You have died.

User avatar
VaanAshe
Regular
Posts: 30
Joined: Mon Aug 18, 2008 5:39 pm
Projects: Halcyon High
Location: England
Contact:

Re: Show and Hide Problems

#5 Post by VaanAshe » Wed Aug 20, 2008 5:12 pm

N0UGHTS wrote:Any traceback or error texts? Or it just runs without changing?
It just runs without changing.

I've actually tried shoving a "hide danii_02" before the second "show danii_03", and it changes it then, but I'm not sure why it's not grouping the two together under "danii", while it does group "callie_01/2/3" together.

Of course, it means I can get it to run with the changes and stuff, but I'd prefer to keep my sanity and keep them grouped. ;_;
LiveJournal and [url=http://myrrh_tree.livejournal.com/]Reviews[/url]... I has them

User avatar
PyTom
Ren'Py Creator
Posts: 15469
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: Show and Hide Problems

#6 Post by PyTom » Wed Aug 20, 2008 5:25 pm

The problem is that the separator between image parts is space ' ', not underscore '_'. So Ren'Py is considering danii_01, danii_02, and dani_03 to be three separate images. If you break them up, then things will work as you expect.

Note that you probably shouldn't include bare numbers in an image name. I'm not sure if it will work or not, but it shouldn't. Instead, you could define 'danii e01', or better yet 'danii happy'.
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
N0UGHTS
Miko-Class Veteran
Posts: 516
Joined: Mon Jul 28, 2008 7:47 pm
Location: California, USA
Contact:

Re: Show and Hide Problems

#7 Post by N0UGHTS » Wed Aug 20, 2008 5:41 pm

Yeah, bare Arabic numerals don't work at all as image variables. Filenames purely made out of them don't, either..

If you want to define images by numbers you could go Roman. danii i, danii ii, stuff like that.
World Community Grid
"Thanksgiving is a day for Americans to remember that family is what really matters.
"The day after Thanksgiving is when Americans forget that and go shopping." —Jon Stewart
Thank you for playing Alter Ego. You have died.

User avatar
VaanAshe
Regular
Posts: 30
Joined: Mon Aug 18, 2008 5:39 pm
Projects: Halcyon High
Location: England
Contact:

Re: Show and Hide Problems

#8 Post by VaanAshe » Wed Aug 20, 2008 5:43 pm

Yeah, I shoved an "e" before the numbers (putting a space instead of underscore too), and it's working now. ^_^ Thanks!
LiveJournal and [url=http://myrrh_tree.livejournal.com/]Reviews[/url]... I has them

Post Reply

Who is online

Users browsing this forum: AlexiSonicKST, Google [Bot]