Need help getting characters displayed on screen!

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
BigFish
Regular
Posts: 36
Joined: Thu Nov 22, 2007 4:13 pm
Contact:

Need help getting characters displayed on screen!

#1 Post by BigFish »

I want to get which character is at a certain position. Like, something similar to " character_at_left() = 'eileen happy' " (Obviously, that's psudeocode, but you get the idea :? ) I've looked all through the manual (including reading over the function index many times), but can't find anything like this. Get_at_list won't work because all it does is return the position for a character's name, and doesn't work with specific expressions.

The reason it needs to be this specific is that I want to develop a function that can make lips move while the text is typing like Phoenix Wright, and the method I'd use for this would be: It finds which slot has the right character in it, then, while the text is typing, it changes the image in that slot to the slot's current image plus " t". Then, after the text is done typing, it would change it back to the original. So, it would work kind of like this:

Code: Select all

image eileen happy = "e1.png"
image eileen happy t = Animation("e1t.png",.1,"e2t.png",.1)

$ e = Character('Eileen',callback=lips)

show eileen happy at left
e "I'm talking!"
I have a prototype of the callback, but it can only get the position of the character, not the right expression or anything, so it's just a fixed expression.

Thanks in advance for any help given. :)

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: Need help getting characters displayed on screen!

#2 Post by PyTom »

This information isn't kept around by Ren'Py. You can define your own config.show and config.hide functions that store this information in a form you can use. (Be sure to have them call renpy.show and renpy.hide.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: No registered users