I've got a character status screen that shows stats and then an image of the character.
What I'm currently attempting to do is use a dict (posed) and variable (displayed_character) to generate sub-images by pointing renpy to a specific sub-directories within the image directory depending on the character or values in the dict. The sub-images are then passed to LiveComposite as layers of the final image. The sub-images are all the same dimension to avoid having to fiddle with a bunch of position values if we need to change one sort of sub-images (ie, if we need to change all the eyes).
Whenever image tries to find the directory variable, however, I get this error:
Exception: In DynamicImage u'[directory]/base.png': Could not find substitution 'directory'.
My guess is that this has something to do with how/when images are created, but I can't figure it out.
Any solutions? Is this just a no-go?
Code: Select all
init - 1 python:
$define posed = {
"position": "foo",
"eyes": "bar"
}
$displayed_character = "baz"
$position = posed["position"]
$directory = "[position]/[displayed_character]"
$eyes = posed["eyes"]
image base = "[directory]/base.png"
image eyes = Animation("[directory]/[eyes].png", 2.0, "[directory]/eyes shut.png", 0.2)
image status_screen_character_display = LiveComposite(
(800, 600),
(0,0), "base",
(0,0), "eyes"
)
screen status():
add "status_screen_character_display"