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.
image testimage = "folder/test.jpg"
define npc = Character("npcguy", image="testimage")
label any:
npc "Hello, you can see my name npcguy, but you can't see the image associated with my character object."
The expected result is that the testimage is shown somewhere, anywhere on the screen, right?
Why even bother associating an image with character if you still need to use show anyways, doesn't that defeat the purpose of even specifying something in the image= part of the character object?
It is there to streamline image display. As most show statement are used just to change expression of already displayed character, baking it within say statement makes code more clear:
image testimage neutral = "folder/test.jpg"
image testimage bored = "folder/test-bored.jpg"
image testimage annoyed = "folder/test-annoyed.jpg"
define npc = Character("npcguy", image="testimage")
# . . .
show testimage neutral
npc "Right now the neutral image is showing..."
npc bored "... and now I am bored. At least I didn't have to write 'show testimage bored' before this statement..."
npc @ annoyed "... this saves me from writing 'show testimage annoyed' before and 'show testimage bored' after this statement..."
npc annoyed @ neutral "and this saves me from writing "'show testimage neutral'/'show testimage annoyed' before/after this statement"
npc "I am still annoyed there."
# . . .
show testimage neutral
npc "..."
show testimage bored
npc "..."
show testimage annoyed
npc "..."
show testimage bored # If there are transitions defined, both those statements could have an effect
show testimage neutral
npc "..."
show testimage annoyed
npc "..."