What I'm trying to do is set up a system whereby I can quickly drop looping animations into the game without defining each one through ATL. I can get a DynamicDisplayable to run through numbered files in a folder, but I need it to return to frame 1 when there's no more frames left. I've attempted to create an 'if' block just before the frame's filename is returned that resets the CurrentFrame int to 1 once the animation completes (relevant code between all the #'s below)
Code: Select all
init python:
def AnimationFrame(st, at):
global CurrentFrame
global CurrentFrameString
global CharName
global ExpressionName
if st > 0.7:
CurrentFrame = CurrentFrame+1
CurrentFrameString = str(CurrentFrame).zfill(5)
##################################################################################################################
if renpy.loadable("images/CHARS/[CharName]/[ExpressionName]/[ExpressionName]_[CurrentFrameString].png")==False:
CurrentFrame = 1
CurrentFrameString = str(CurrentFrame).zfill(5)[/b]
####################################################################################################################
return "CHARS/[CharName]/[ExpressionName]/[ExpressionName]_[CurrentFrameString].png", 0.7
init:
image Portrait = DynamicDisplayable(AnimationFrame)
label start:
scene bg room
show Portrait
"Hello, world."
return
I think I'm using 'renpy.loadable' wrong because it seems to be returning false every time. Does anyone have the specifics on how I should enter the filepath?
Some variations I've already tried are:
Code: Select all
renpy.loadable("game\images/CHARS/[CharName]/[ExpressionName]/[ExpressionName]_[CurrentFrameString].png")
renpy.loadable("[ExpressionName]_[CurrentFrameString].png") ##the documention just says 'a file that can be loaded from an archive' so I thought maybe I didn't need to specify folders at all)