[SOLVED] Character expressions not changing
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.
- DollhouseRose
- Regular
- Posts: 61
- Joined: Tue Aug 27, 2019 2:36 pm
- Completed: Graveyard Girls & Starlight Shores
- Projects: Graveyard Girls & Starlight Shores
- Organization: Delphinium Interactive
- itch: tidalblossoms
- Location: Canada
- Contact:
[SOLVED] Character expressions not changing
So in my scene, the character arrives and things seem fine/sprites are displaying properly at first. But once I reuse an expression, it doesn't appear when I use "show" in the second instances. I've tried using the "hide" feature, but when I use it after every change of expressions to hide the previous expression, it gets exhausting to constantly command "hide", and when I do that my game gets choppy. Text loads slowly, and transitions like dissolve are distorted in a laggy way. I've included my code below.
show smile1kc
with dissolve
i "Blah."
d "Blah blah?"
show shock1kc
with dissolve
i "How did you know?"
d "My roommate told me, he knows you."
show smirk2kc
with dissolve
i "He did? How nice of him... Did he mention that blahblah?"
d "..."
d "No, Blah."
show smile3kc
with dissolve
i "Blah!"
i "Blah."
d "Blah."
show shock1kc
with dissolve
So for example, when I use "shock1kc" in the second instance at the bottom of this code, it doesn't display the shock expression. Sorry, I'm a total noob. Can anyone help me out?
show smile1kc
with dissolve
i "Blah."
d "Blah blah?"
show shock1kc
with dissolve
i "How did you know?"
d "My roommate told me, he knows you."
show smirk2kc
with dissolve
i "He did? How nice of him... Did he mention that blahblah?"
d "..."
d "No, Blah."
show smile3kc
with dissolve
i "Blah!"
i "Blah."
d "Blah."
show shock1kc
with dissolve
So for example, when I use "shock1kc" in the second instance at the bottom of this code, it doesn't display the shock expression. Sorry, I'm a total noob. Can anyone help me out?
Last edited by DollhouseRose on Wed Sep 18, 2019 1:35 pm, edited 1 time in total.
- parttimestorier
- Veteran
- Posts: 428
- Joined: Thu Feb 09, 2017 10:29 pm
- Completed: No Other Medicine, Well Met By Moonlight, RE:BURN, The Light at the End of the Ocean, Take A Hike!, Wizard School Woes
- Projects: Seeds of Dreams
- itch: janetitor
- Location: Canada
- Contact:
Re: Character expressions not changing
I'm not sure if this is the problem, but I wonder if it has something to do with how you've defined the images? I've always done it with the character name first and then the description of the expression second, like "show kc shock1" and "show kc smile1" or something. That's the way the tutorial does it, with examples like "eileen happy". I would guess that maybe the way you have it set up might means that it doesn't recognize that they're different expressions for the same character, and so it's treating them all as separate images and just layering them over each other instead of switching between them. I would try rearranging the way you've defined the images and see if anything changes.
- Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
- Contact:
Re: Character expressions not changing
You should try to use tags within your image definitions... If you show a tag (with different attributes/expression) that is already showing, it replaces it...
Even better is to name your images well and let Ren'Py do all the defines automatically
Now, if you have 1kc_shock.png it will automatically create an image with tag 1kc and attribute shock
Note: the image name starts with the tag
Code: Select all
# just the tag on its own
image 1kc = "images/normal1kc.png"
# same tag, with attribute smile
image 1kc smile = "images/smile1kc.png"
# same tag, with attribute shock
image 1kc shock = "images/shock1kc.png"
define kc = Character("KC", image="1kc")
label start:
show 1kc
kc smile "smiling"
kc shock "shocking"
kc -shock "normal"Code: Select all
define config.automatic_images = [' ', '_'] # Add underscores in interpreted automatic image namesNote: the image name starts with the tag
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
- hell_oh_world
- Miko-Class Veteran
- Posts: 777
- Joined: Fri Jul 12, 2019 5:21 am
- Projects: The Button Man
- Organization: NILA
- Github: hell-oh-world
- Location: Philippines
- Contact:
Re: Character expressions not changing
Try to declare your images like this:DollhouseRose wrote: ↑Wed Aug 28, 2019 5:37 pmSo in my scene, the character arrives and things seem fine/sprites are displaying properly at first. But once I reuse an expression, it doesn't appear when I use "show" in the second instances. I've tried using the "hide" feature, but when I use it after every change of expressions to hide the previous expression, it gets exhausting to constantly command "hide", and when I do that my game gets choppy. Text loads slowly, and transitions like dissolve are distorted in a laggy way. I've included my code below.
show smile1kc
with dissolve
i "Blah."
d "Blah blah?"
show shock1kc
with dissolve
i "How did you know?"
d "My roommate told me, he knows you."
show smirk2kc
with dissolve
i "He did? How nice of him... Did he mention that blahblah?"
d "..."
d "No, Blah."
show smile3kc
with dissolve
i "Blah!"
i "Blah."
d "Blah."
show shock1kc
with dissolve
So for example, when I use "shock1kc" in the second instance at the bottom of this code, it doesn't display the shock expression. Sorry, I'm a total noob. Can anyone help me out?
Code: Select all
image kc shock = ""
image kc smirk = ""
label start:
"some dialogue"
show kc shock
"some dialogue"
show kc smirk
## These will automatically replace the images of the same tag without the need for the hide statement.
Code: Select all
show smile1kc
with dissolve
i "Blah."
d "Blah blah?"
show shock1kc
with dissolve
i "How did you know?"
d "My roommate told me, he knows you."
show smirk2kc
with dissolve
i "He did? How nice of him... Did he mention that blahblah?"
d "..."
d "No, Blah."
show smile3kc
with dissolve
i "Blah!"
i "Blah."
d "Blah."
show shock1kc ## Are these the last lines of your code?
with dissolve ## Are these the last lines of your code?
You could use pause statement to see if the second instance appears.
Code: Select all
show smile1kc
with dissolve
i "Blah."
d "Blah blah?"
show shock1kc
with dissolve
i "How did you know?"
d "My roommate told me, he knows you."
show smirk2kc
with dissolve
i "He did? How nice of him... Did he mention that blahblah?"
d "..."
d "No, Blah."
show smile3kc
with dissolve
i "Blah!"
i "Blah."
d "Blah."
show shock1kc ## Are these the last lines of your code?
with dissolve ## Are these the last lines of your code?
pause # waits for the next interaction from the user
- DollhouseRose
- Regular
- Posts: 61
- Joined: Tue Aug 27, 2019 2:36 pm
- Completed: Graveyard Girls & Starlight Shores
- Projects: Graveyard Girls & Starlight Shores
- Organization: Delphinium Interactive
- itch: tidalblossoms
- Location: Canada
- Contact:
Re: Character expressions not changing
Thanks for your help everyone! I wasn't defining images at the beginning of my game and just using the file name from the images directory. After defining the images for my main characters, the expressions changed perfectly. I've left minor character images undefined (because I've got 100s of lines of code with them undefined running fine) and it seems alright because they don't appear or change as frequently. I appreciate all the help!
Who is online
Users browsing this forum: Google [Bot]


