Help with dolling/Dynamic image definition

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
HammeredEnt
Regular
Posts: 33
Joined: Sat May 04, 2019 8:09 am
Contact:

Help with dolling/Dynamic image definition

#1 Post by HammeredEnt »

Hi team!

I'm trying to doll my characters, but I'm having trouble getting the image expressions to work. I've got the LiveComposite stuff working so when I use show expression "tonys" + outfit, the doll systems works just fine.

However, I'm trying to use a DynamicImage statement comprised of the character's name and the outfit as defined by the variable.

default outfit = ["tux"]
image tony = 'tonys' + ["outfit"]

image tonystux:

LiveComposite (
(768,1024),
(0,0), "base",
(0,0), "shirt",
(0,0), "tux"
)


As I say, I've tried using the expression listed above in the core game itself and that works fine, but when I try to define the image 'tony' as a dynamic image usin gthe variable, I get the following error:

[code]
While running game code:
File "game/script.rpy", line 46, in script
show tony
Exception: DynamicImage [u'outfit']: could not find image. (u'outfit')


I've seen that "u'____'" thing when I've displayed those things so I think it's just an aspect of how that variable is incorporated into the code. Is there something I should be doing to keep the 'u' bit out as it looks like it should work if that 'displayed' in the code line properly.

I imagine it's something really silly and simple and I'm just overlooking it, but any help would be greatly appreciated!

Ultimately I hope to be able to have two variables in the 'tony' image definition so I can control the emotion and outfit in one go, but I figure I need to get the outfit aspect working properly first!

philat
Eileen-Class Veteran
Posts: 1909
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Help with dolling/Dynamic image definition

#2 Post by philat »

Either layered images or dynamic images (in particular condition switches) should be what you're looking into.

https://renpy.org/doc/html/layeredimage.html
https://renpy.org/doc/html/displayables ... splayables

HammeredEnt
Regular
Posts: 33
Joined: Sat May 04, 2019 8:09 am
Contact:

Re: Help with dolling/Dynamic image definition

#3 Post by HammeredEnt »

Yeah, I've got the layered images sorted so thanks for that.

I'm just trying to do an easier version of condition switching which I figure could be done just by having an expression with two variables - the outfit and the emotion - but I'm just trying to 'proof of concept it' with one variable (before expanding it to two) and can't seem to get that to work.

Could it be because I'm using a list as the variable in the first place rather than some other form?

philat
Eileen-Class Veteran
Posts: 1909
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Help with dolling/Dynamic image definition

#4 Post by philat »

Point being that layered images can combine the layers and attribute picking into one mechanism. But obviously you don't have to use it.

There's also no reason you couldn't just use condition switches, but if you're hellbent on it, you can use variables in image definitions, yes. https://www.renpy.org/doc/html/changelo ... mic-images

Post Reply

Who is online

Users browsing this forum: craboozled, Semrush [Bot]